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.
Please be reminded that ecCodes is also available as a "conda" package. See How to install ecCodes with Python bindings in conda - ecCodes FAQ for more information.
Generating the Makefiles with CMake
One nice and highly recommended feature of CMake is the ability to do out of source builds. In this way you can make all your ".o" files, various temporary files, and even the binary executables without cluttering up your source tree. To use out of source builds, first create a build directory, then change into your build directory and run cmake pointing it to the source directory and using your 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/.
Note: When an option is ON by default, it is enabled even if not explicitly requested. Features with default OFF need to be explicitly enabled by the user with -DENABLE_<FEATURE>=ON
|where you want to install your ecCodes
to select the type of compilation:
|Select the type of library built:
|Flags for the C++ Compiler
|Flags for the Fortran Compiler
|For the grib_to_netcdf conversion tool
Enable JPEG2000 support. This option should look for JasPer or OpenJPEG.
|Enable PNG support for decoding/encoding
|Enable Adaptive Entropy Coding (AEC) for GRIB decoding/encoding (CCSDS)
Note: This option is deprecated and was removed in Q1 2023.
The Python2 interface to the package.
|Offers the Fortran 90 interface to the package
|Enable POSIX threads
|Enable OpenMP threads
|See Memory based access to definition/sample files
|Enable extended regression testing (which requires data downloads)
Note: The compilers can also be overridden by setting the environment variables CXX and FC.
Note: To see the full output from the compilation, you can use:
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.
First of all get the tarball "eccodes-x.y.z-Source.tar.gz" from our Releases page. Then:
It is recommended that you always build in a clean directory and also install into a clean directory.
By default the ctest step above (running the tests) does NOT require any data to be downloaded and only runs basic sanity tests. However if you wish to exercise more of the functionality of ecCodes, you are advised to configure the build with:
In this mode the tests will take longer and you need to be connected to the internet (and set the relevant "http_proxy" environment variable if you must use a proxy) so data files can be downloaded for the tests. You can however download all the data files in one go (See the data tarball link at the top of the Releases page)
make -j4", "
ctest -j4"). This will speed up the whole build/test process significantly.
Python 3 bindings
If you are installing into a non-standard installation location (as in the 2nd case above), then set the environment variable ECCODES_DIR to tell the bindings where to find the root installation directory of the ecCodes engine.
Please note: Windows is not a platform that is used for technical work at ECMWF. Therefore we will not be able to support this platform as well as we do for others, such as Linux. For operational use, we strongly advise you to use Linux.
If you find problems, we invite the Windows user community to use our new set-up on GitHub to fork/contribute and issue pull request changes. Old Reliable Tech has set up automatic tests and builds for Windows on GitHub, which should ensure continued releases for this platform.