Versions Compared

Key

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

...

CMake supports several standard 'build types'. These are:

 

ReleaseRelease mode - the binary package does not include debug symbols and some of the source code is ignored; this mode is the default for users.
DebugDebug mode - the binary package includes debug symbols in the source code are not ignored; this mode is the default for developers and typically uses low or no optimisation.
RelWithDebInfoRelease mode, but the binary package includes debug symbols this mode is for developers and users and is often the default build type.
BitBit-reproducibility mode - This is non-standard and will not be found on other cmake enabled packages. It is used at ECMWF to set compiler options that have been tested to provide bit-reproducibility.

 

Available options

To get additional help on the available options (similar to the 'configure --help' command) run the command:

...

Recommended options are conservative to ensure stability and bit-reproducibility. The cmake and configure commands usually choose a sensible set of optimized compiler flags for the choice of supported compiler for the 'Bit' build type.

Although it Changing compiler options is not normally necessary to specify them. However, the following examples show the recommended compiler options and how to set them for the cmake and configure commands.

...

Compiling, checks and installing

The 'configure' command creates a 'Makefile' in the directory where it residesAfter configuration the next steps are to compile grib-api and install it. To compile grib_api do:

...

Info
titleParallel make

If your computer has multiple cores as many do these days, use the -j flag to make to build grib_api faster. e.g.

Code Block
make -j 3 | tee make.out
would allow make to compile 3 files at once - appropriate on a 4 core machine.

Next, to verify grib_api works correctly run:

...

Code Block
% export PATH=$PATH:$HOME/ecmwf/grib_api_gcc/bin
% grib_info

grib_api Version 1.914.180
Default definition files path is used: ..../grib_api_gcc/share/definitions
Definition files path can be changed setting GRIB_DEFINITION_PATH environment variable
Default SAMPLES path is used: ..../grib_api_gcc/share/samples
SAMPLES path can be changed setting GRIB_SAMPLES_PATH environment variable

...