Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
% cd oifs/make
% mkdir mycfg
% ln -s fcmcfg/oifs.cfg mycfg/oifs.cfg           #  the oifs.cfg must exist in the same directory as your custom .cfg file.
% cp fcmcfg/x86_64-intel-opt.cfg mycfg/darwin-intel_v13-opt.cfg
(edit darwin-intel_v13-opt.cfg)
% export OIFS_ARCH=darwin
% export OIFS_COMP=intel_v13
% export OIFS_BUILD=opt
% fcm make -f mycfg/oifs.cfg

 

Change compiler options

...

globally

All the compiler flags and options are contained in the build specific files (e.g. x86_64-intel-opt.cfg). As above, a number of environment variables can be defined to override the default options set in these files. As a general rule, any variable with a {?} can be overriden by setting an environment variable.

...

The description above covers changing the compiler options globally, that is, for all files in the compilation. There may be instances when options for one or a few files need to be changed. For instance, in debugging where array bound checking is required for a handful of changed subroutines.

Changing options per file cannot be done using environment variables. There are several ways in which it can be done:

Edit the oifs.cfg file

The oifs.cfg file is the place to put all file specific options. Some can be found in this file already e.g.

Code Block
build.prop{fc.flags}[algor/internal/fourier]       = $OIFS_FFIXED $OIFS_FFLAGS
build.prop{fc.flags}[algor/internal/lanczos/i2x.F] = $OIFS_FFIXED $OIFS_FFLAGS

More information on the configuration file syntax for FCM can be found on the FCM Users Guide from the UK Met Office.

The first line above sets the build property 'fc.flags' (ie. fortran compiler flags) for the directory algor/internal/fourier (under the 'src' directory). Note this sets compiler flags for all files in that directory.

The second line set the build property, compiler flags, for the specific file, algor/internal/lanczos/i2x.F. Note that all other files in this directory, unless changed elsewhere, will use the default compiler options as described above.

These statements are used to ensure F77 files are compiled correctly.

Example: you need to reduce the optimisation and include array bound checking on a specific file. We suggest you make a copy of the oifs.cfg and add the line:

Code Block
titleEdit a copy of oifs.cfg and add the line:
build.prop{fc.flags}[ifs/module/yomtrans.F90] = -g -O0 -m64 -C -fconvert=big-endian

 

Using the 'include' statement

Inherited build

Recommendations

As described above, the build environment uses 3 types of build:

...