Versions Compared

Key

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

Overview

ecCodes uses CMake for compilation and installation. This is a first step towards an homogenisation of the installation procedures for all ECMWF packages.

Like autotools, CMake will run some tests on the user's system to find out if required third-party software libraries are available and note their locations (paths). Based on this information it will produce the Makefiles needed to compile and install ecCodes.

CMake is a cross-platform free software program for managing the build process of software using a compiler-independent method.

Generating the Makefiles with CMake

After changing into the build directory, the user has to run cmake with his/her own options. The command gives feedback on what requirements are fulfilled and what software is still required. The following table gives an overview of the different options.  The default (without any options) will compile a shared library only and install it in /usr/local/.

 

CMAKE_INSTALL_PREFIXwhere you want to install your ecCodes/usr/local
CMAKE_BUILD_TYPE

to select the type of compilation:

  • Debug
  • RelWithDebInfo
  • Release
  • Production
RelWithDebInfo
ENABLE_NETCDFFor the grib to netcdf convert toolAUTO
ENABLE_JPGEnable JPEG2000 support. This option should look for Jasper or OpenJPG

AUTO

ENABLE_PNGEnable PNG support for decoding/encodingOFF
ENABLE_PYTHONOffers the Python interface to the packageAUTO
ENABLE_FORTRANOffers the Fortran interface to the packageAUTO
ENABLE_GRIB_THREADSEnable POSIX threadsOFF
cmake options
doc
default


The C and Fortran compilers are chosen by CMake. (This can be overridden by setting the environment variables CC and FC to the preferred compiler). Further the variables CMAKE_C_FLAGS or CMAKE_Fortran_FLAGS can be used to set compiler flags for optimisation or debugging.

Quick installation guide

Here is an example of a list of commands you could use to install ecCodes.  It is assumed “>” is the shell prompt. The version number may vary.

Code Block
> tar -xzf  eccodes-1.0.0.tar.gz
> mkdir build ; cd build 

> cmake ../eccodes-1.0.0 –DCMAKE_INSTALL_PREFIX=/path/to/where/you/install/eccodes
...

> make
> make test
> make install