= Program development with eclipse = ''This page describes how to use [http://www.eclipse.org eclipse] on the Linux cluster at IMuK, but the description should also be valid in general for any other Linux environment.'' At IMuK, eclipse requires !SuSe version 12.1. Eclipse is a free IDE (Integrated Development Environment) with a plugin for subversion and Fortran (photran). Generally, eclipse allows to manage projects in two different ways: * with a managed makefile\\\\ When a new project is created, eclipse generates a makefile from the source code files including all dependencies. Because photran is a relatively new tool, detection of dependencies does not work properly in case of large sources.\\\\ * with user-provided makefile or build mechanism\\\\ The user can either provide his own makefile, which must be placed in the base directory of the project, or can define an external command to compile the code (which replaces the simple unix make-mechanism).\\\\ For PALM projects the second mechanism should be used with '''palmbuild''' replacing the simple make (see below). \\\\\\ === Generating and configuring a workspace with user-define build === Step by step instructions for generating and configuring a PALM project from code residing in an svn-repository. This replaces the manual checkout of the PALM code. * start eclipse (if you already have checked out the code from the repository, you should first delete the existing trunk-directory.) {{{ cd $HOME/palm/current_version rm -rf trunk mkdir trunk eclipse & }}} * in the opening window set {{{/home//palm/current_version}}} as the workspace * open: {{{Window --> Perspective --> Open Perspective --> Other --> Fortran}}} \\ and quit with {{"OK"}} * open: {{{File --> Import --> SVN --> project from SVN}}} * enter the repository location (URL): \\ {{{http://130.75.105.7/svn/palm/trunk}}} * on slider "Advanced" disable "Enable Structure Detection" and proceed with ''"next"''\\ You will be asked for your svn user name and password. If not, enter user name and password under slider "General" (below URL) and proceed with ''"next"''. * activate button ''"Head Revision"'' \\ and quit with ''"finish"'' * choose ''"Check out as a project configured using the New Project Wizard"'' \\ and quit with ''"Finish"'' * in the opening window, open {{{C/C++ --> Makefile Project with Existing Code}}} \\ and quit with ''"next"'' * in the opening window type as project name ''trunk'', ('''very important! '''), select your trunk folder location (e.g., {{{/home//palm/current_version/trunk}}}) as Existing code location and choose '''' as toolchain (which is the default) \\ quit with ''"Finish"'' * eclipse might then ask you for a ''secure storage password''. If you are running eclipse for the first time, you have to choose a new one and to give some additional information. * in case you see the starting window of eclipse, close it and continue with the next step * in the left window: right mouse click on ''"trunk"'' {{{--> Properties}}} * choose: {{{C/C++ Build --> Settings --> Elf Parser}}} * click on ''"Error Parsers"'' \\ and choose ''"Photran Error Parser for Intel(R) Compilers"'' as well as ''"Photran Error Parser for PGI Fortran"'' and ''"Photran Error Parser for Cray Fortran"''\\ quit with ''"OK"'' * in the left window: right mouse click on ''"trunk"'' {{{--> Properties --> C/C++ Build}}} \\ deactivate button ''"Use default build command"'' and type as ''"Build command"'': {{{ palmbuild -c lcmuk -K "parallel" -v }}} and change "Build directory" to {{{ ${workspace_loc} }}} * on slider ''"Behaviour"'' deactivate button ''"Build on resource save (Auto build)"'' then click on ''"Apply"''. \\ * you can define alternative build configurations (e.g. with trace options) by clicking on the ''"Manage Configurations"'' button. * use the ''"Manage Configurations"'' button and rename the ''"Default"'' to ''"Source"''. * create a new configuration named ''"Utilities"'', and select ''"Existing configuration: Source"''. Quit with ''"OK"'' and again ''"OK"''. * select ''"Utilities"'' from the ''"Configuration"'' menu and edit ''"Build command"'' as follows: {{{ palmbuild -u -c lcmuk -K "parallel" -v }}} then quit with ''"OK"''. * You can now choose between ''"Source"'' and ''"Utilities"'' as active build configuration * '''Note:''' before you can compile the code, make sure you have placed a working {{{.palm.config.}}} file in {{{$HOME/palm/current_version}}}! \\\\ === Using palmrun with eclipse === Step by step instruction to configure the eclipse run configuration in a way that [wiki:doc/app/palmrun palmrun] is used as an external tool. * in the main eclipse window open: {{{Run --> External Tools --> External Tools Configuration...}}} * right mouse click on ''"Program"'' in left window, select ''"New"'' * in the opening window, give the following informations \\ ''"Name:"'' e.g. {{{palmrun}}} \\ ''"Location:"'' {{{${workspace_loc}/trunk/SCRIPTS/palmrun}}} \\ ''"Working Directory:"'' {{{${workspace_loc}}}} \\ ''"Arguments:"'' {{{-r example_cbl -c default -X4 -T4 -a d3#}}} \\ or any other {{{palmrun}}}-options that you like to use * on slider ''"Build"'' disable ''"Build before launch"'' * on slider ''"Common"'' select ''"External tools"'' under ''"Display in favorites menu"'' * right mouse click on ''"Program"'' in left window allows to define other alternative run configurations (e.g. with other {{{palmrun}}}-options) * quit with ''"Close"'' or proceed with * launch '''palmrun''' by selecting {{{Run --> External Tools --> palmrun_prompt}}} Configuring eclipse in a way that '''palmrungui''' is used as an external tool. * in the main eclipse window open: {{{Run --> External Tools --> External Tools Configuration...}}} * right mouse click on ''"Program"'' in left window, select ''"New"'' * in the opening window, give the following informations \\ ''"Name:"'' e.g. {{{palmrungui}}} \\ ''"Location:"'' {{{${workspace_loc}/trunk/SCRIPTS/palmrungui}}} \\ ''"Working Directory:"'' {{{${workspace_loc}}}} \\ * no ''"Arguments"'' are required in this case * on slider ''"Build"'' disable ''"Build before launch"'' * on slider ''"Common"'' select ''"External tools"'' under ''"Display in favorites menu"'' * quit with ''"Close"'' * launch '''palmrungui''' by selecting {{{Run --> External Tools --> palmrungui}}}