| 1 | = {{{palmbuild}}} technical description = |
| 2 | |
| 3 | == Introduction == |
| 4 | {{{palmbuild}}} is the shell script to compile PALM and further utilities required for pre- and postprocessing the PALM data. It is invoked by the [wiki:doc/install/automatic automatic installer] as part of the installation process, or it can be called manually, and puts the created binaries in a folder named {{{MAKE_DEPOSITORY_<ci>}}}, where {{{<ci>}}} is the configuration identifier. It is also automatically invoked by the script [wiki:doc/app/palmrun palmrun] in two different ways, but only if {{{palmrun}}} is called manually. If {{{palmrun}}} cannot find pre-compiled PALM sources, it calls {{{palmbuild}}} to create the MAKE_DEPOSITORY. Furthermore, manual calls of {{{palmrun}}} always call {{{palmbuild}}} to generate a specific folder (names SOURCES_FOR_RUN_...) that contains all binaries for the specific run, which may be re-used by automatic restart runs (see ''automatic calls'' further below). |
| 5 | |
| 6 | Manual calls of {{{palmbuild}}} are required in case that a new PALM code version has been checked out from the repository, or if a modified working copy of the code shall be used for PALM runs. |
| 7 | |
| 8 | {{{palmbuild}}} is steered by options as well as settings in the [wiki:doc/app/palm_config configuration file]. It compiles code based on the unix makefile mechanism. |
| 9 | |
| 10 | \\ |
| 11 | == How to call {{{palmbuild}}} manually == |
| 12 | Manual calls of {{{palmbuild}}} are used to generate or update the compiled PALM sources (binaries). Specific informations e.g. about the compiler and the compiler options to be used need to be specified in the [wiki:doc/app/palm_config configuration file]. Relevant variables to be specified are ''source_path'', ''user_source_path'', ''compiler_name'', ''compiler_name_ser'', ''cpp_options'', ''make_options'', ''compiler_options'' and ''linker_options''. See [wiki:doc/app/palm_config configuration file] for a description of these variables. Since you can have different configuration files (for different compilers, compiler options, or hosts), you need to specify the configuration file to be used by {{{palmbuild}}}. Assuming a configuration file {{{.palm.config.abcde}}}, you need to enter |
| 13 | {{{ |
| 14 | palmbuild -h abcde |
| 15 | }}} |
| 16 | {{{abcde}}} is the so-called ''configuration identifier''. After entering the command, informative messages will appear in the terminal: |
| 17 | {{{ |
| 18 | #------------------------------------------------------------------------# |
| 19 | | palmbuild 1.0 Rev: 3210 $ Thu Aug 30 09:29:56 CEST 2018 | |
| 20 | | PALM code Rev: 3220 | |
| 21 | | | |
| 22 | | called on: bora (IP:130.75.105.103) | |
| 23 | | config file: /home/raasch/palm/current_version/.palm.config.abcde | |
| 24 | | makefile: /home/raasch/palm/current_version/trunk/SOURCE/Makefile | |
| 25 | | source path: /home/raasch/palm/current_version/trunk/SOURCE | |
| 26 | | | |
| 27 | | config. identifier: abcde | |
| 28 | | local depository: /home/raasch/palm/current_version/MAKE_DEPOSITORY_ | |
| 29 | | abcde | |
| 30 | | username: raasch | |
| 31 | | address: 130.75.105.103 | |
| 32 | | compiler: mpif90 | |
| 33 | | serial compiler: ifort | |
| 34 | | make options: -j 8 | |
| 35 | | cpp options: -cpp -D__parallel ...... | |
| 36 | | compiler options: -fpe0 -O3 ...... | |
| 37 | | linker options: -fpe0 -O3 ...... | |
| 38 | #------------------------------------------------------------------------# |
| 39 | |
| 40 | >>> continue (y(es)/c(ontinue)/a(bort)) ? |
| 41 | }}} |
| 42 | If {{{y}}} is entered, compilation will be started and compiler messages will appear. After successful completion, you will find the binaries in the directory given in the configuration file by {{{base_directory}}} under the folder name {{{MAKE_DEPOSITORY_abcde}}}. |
| 43 | |
| 44 | In case of a configuration file for PALM runs on a remote host, sources are copied via {{{scp}}} to the remote host and the compiler is called via {{{ssh}}} on the remote host too. Folder {{{MAKE_DEPOSITORY_abcde}}} is created under {{{base_directory}}} on the remote host. |
| 45 | |
| 46 | In case you have updated the PALM code, you need to call {{{palmbuild}}} again: |
| 47 | {{{ |
| 48 | cd ~/palm/current_version |
| 49 | svn update trunk |
| 50 | palmbuild -h abcde |
| 51 | }}} |
| 52 | |
| 53 | If you have changed the compiler options in the configuration file and like to re-compile the PALM code with the new options, you need to touch the source code files in your working copy of the repository first, |
| 54 | {{{ |
| 55 | touch trunk/SOURCE/*.f90 |
| 56 | palmbuild -h abcde |
| 57 | }}} |
| 58 | because otherwise the make mechanism would see no changes in the source code and would not compile at all (message {{{make: Nothing to be done}}}). Alternatively, you may delete the MAKE_DEPOSITORY folder: |
| 59 | {{{ |
| 60 | rm -rf MAKE_DEPOSITORY_abcde |
| 61 | palmbuild -h abcde |
| 62 | }}} |
| 63 | |
| 64 | If you have more than one configuration file, you need to call {{{palmbuild}}} separately for each configuration. |
| 65 | |
| 66 | For further information see the [wiki:doc/app/palmbuild detailed palmbuild description]. |
| 67 | |
| 68 | \\ |
| 69 | == Automatic calls of {{{palmbuild}}} from {{{palmrun}}} |
| 70 | if a [wiki:doc/app/userint user-interface] is used, or if {{{palmrun}}} option {{{-s}}} is used to force compilation of specific routines. Actually, {{{palmbuild}}} is called in each manual call of {{{palmrun}}} to provide various files for the respective run (including the binaries), which are put in a specific folder that is used by all runs of an automatic job chain. |