...
Section | |||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Build configuration
This is a brief introduction on compiling the OpenIFS model. For a more detailed description of the build system for OpenIFS and the different ways to configure it, see HowTo customize the OpenIFS build.
...
If using GNU on a Mac, please see MacOS X known issues.
Building for other systems/environments
As the environment variables refer to the corresponding filename in the make/cfg
directory it is straightforward to create a build configuration for other environments. Take a copy of an existing file and modify it as necessary. It's also possible to alter compile options by the use of additional environment variables (see below). Which approach you use depends on your personal preference. Be aware however that the optimization compiler flags in the provided configuration files are the recommended ones. It is impossible to test all combinations of compiler flags so the model may become unstable or performance may reduce if higher optimizations are tried.
Setting the location of libraries
The model requires a number of libraries (see 5.2 Prerequisites) to compile. As well as the GRIB_API library, the LAPACK & BLAS numerical libraries are required. An MPI library is also required but this is assumed to be provided by compiler wrappers provided by the MPI implementation (e.g. the command mpif90 rather than gfortran).
...
Or if you prefer you can either edit the default value in the appropriate FCM configuration file in make/cfg
directory or make a copy of the supplied configuration file (.cfg) and use that.
Compiling OpenIFS
Once the environment variables are set, OpenIFS can be compiled (make sure you have edited your PATH environment variable to add the FCM installation /bin
directory). Assuming you are in the directory where the OpenIFS source code was unpacked:
...
Code Block |
---|
[init] make # 2012-12-20 19:59:59Z [init] make config-parse # 2012-12-20 19:59:59Z [info] config-file=...../make/oifs.cfg [info] config-file= - ...../make/cfg/gnu-opt.cfg [done] make config-parse # 0.3s [init] make dest-init # 2012-12-20 19:59:59Z [info] mode=new [done] make dest-init # 0.3s [init] make build # 2012-12-20 20:00:00Z [info] sources: total=2194, analysed=2194, elapsed-time=11.7s, total-time=32.2s [info] target-tree-analysis: elapsed-time=9.8s [info] compile targets: modified=2073, unchanged=0, total-time=1095.5s [info] compile+ targets: modified=628, unchanged=0, total-time=1.6s [info] ext-iface targets: modified=1247, unchanged=0, total-time=21.9s [info] install targets: modified=120, unchanged=0, total-time=0.3s [info] link targets: modified=1, unchanged=0, total-time=18.3s [info] TOTAL targets: modified=4069, unchanged=0, elapsed-time=316.3s [done] make build # 329.1s [done] make # 329.8s |
Verbose compilation
The default output of FCM is quite terse. To get more verbose output use the '-v' option. Also if you have a multicore machine you can use the -j option to specify additional processes to build in parallel.
...
will produce a more detailed report and use 4 processes to analyse and build the model code in parallel.
Successful compilation
After a successful compilation, the OpenIFS executable, master.exe
, can be found in the 'make/gnu-opt/oifs/bin
' subdirectory:
...
The 'gnu-opt' subdirectory is generated by FCM using the values of the OIFS_COMP & OIFS_BUILD environment variables. The oifs/include
directory contains all the files referenced in the code by a '#include
' statement. This includes the Fortran interface block files which are auto-generated by FCM and end in .intfb.h
. The oifs/o
directory contains all the compiled object files. The OpenIFS build does not place any additional files in the src
directory (known as building 'out of source').
Compilation problems
If you get the message:
Code Block |
---|
fcm make -f oifs.cfg /bin/ksh: fcm: not found [No such file or directory] |
...