Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Info | ||
---|---|---|
| ||
You should have completed: the install grib_api and downloaded the OSM source code. |
Set your environment
The OSM uses software called 'FCM' to handle the compilation of the code. FCM is distributed in the tarball downloaded from the ftp site.
Before trying to compile, make sure the FCM directory is added to your PATH environment variable so the fcm
command can be found (if you already have fcm available on your system, we still recommend using the distributed version):
Code Block | ||
---|---|---|
| ||
export PATH=$PATH:$HOME/ecmwf/osm/fcm/bin |
Build configuration
Info | ||
---|---|---|
| ||
The script In the 'make' directory, change the link 'cfg' so it points to 'cfg.ecmwf' rather than 'cfg.external'. You can ignore the rest of these instructions though they are a useful reference. |
Before compiling the model, the build configuration must first be set by several environment variables:
OSM_COMP - This sets the choice of compiler. The default is 'gnu' which means the gfortran/gcc compilers will be used.
OSM_BUILD - This sets the type of build.
These environment variables directly correspond to the names of the FCM configuration files in the make/cfg/
directory in the source. Please see this directory for the choices provided.
Build types: OSM_BUILD sets the type of build and there will be one FCM configuration file for each type. Build types provided are:
- opt - Recommended optimized compile settings for OpenIFS for this compiler. Tested to provide best performance for this platform & compiler.
- noopt - Debugging options. No optimization set for all of the code. Suitable for use with a debugger. OpenMP is disabled.
- nansC - Debugging options with extra checks. Array bound checking enabled and variables initialized to NAN (not-a-number). Use of a variable set to NaN will trigger a floating point exception. This option is useful for debugging purposes but will run the slowest.
e.g.
Code Block |
---|
export OSM_COMP=intel export OSM_BUILD=opt |
means using the Intel ifort compiler and the model will be compiled with full optimization compiler settings. So the FCM build system will expect to find a file:
Code Block |
---|
make/cfg/intel-opt.cfg |
Setting:
Code Block |
---|
export OSM_COMP=pgi export OSM_BUILD=noopt |
means FCM will expect to find a file:
Code Block |
---|
make/cfg/pgi-noopt.cfg |
suitable for building using the Portland compilers using non-optimized settings.
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
Some environment variables need to be set for the GRIB_API and netCDF libraries.
For GRIB_API library, environment variables need to be defined to set the library and the include paths in as compiler options:
- GRIB_API_LIB - Defines the GRIB_API library link options
e.g.GRIB_API_LIB="-L$HOME/ecmwf/grib-api/lib -lgrib-api-f90 -lgrib-api"
- GRIB_API_INCLUDE - Defines the GRIB_API include path compile option
e.g.GRIB_API_INCLUDE="-I$HOME/ecmwf/grib-api/include"
And, similarly for the netCDF library and include files:
- NETCDF_LIB - Defines the netCDF library link options:
Or if you prefer, you can edit the values in the appropriate FCM configuration file in the make/cfg directory or make a copy of the supplied configuration file (.cfg) and use that.
Compiling OSM
HTML |
---|
<script type="text/javascript" src="https://software.ecmwf.int/issues/s/en_UKet2vtj/787/12/1.2.5/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?collectorId=5fd84ec6"></script> |
Excerpt Include | ||||||
---|---|---|---|---|---|---|
|
Panel | ||
---|---|---|
| ||
|