Table of Contents |
---|
Overview
ecCodes uses CMake for compilation and installation. This is a first step towards an homogenisation of the installation procedures for all ECMWF packages.
...
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 depend 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.
...
CMAKE_INSTALL_PREFIX | where you want to install your ecCodes | /usr/local |
CMAKE_BUILD_TYPE | to select the type of compilation:
| RelWithDebInfo |
BUILD_SHARED_LIBS | Select the type of library built:
| ON |
CMAKE_CCXX_COMPILER | C++ Compiler | |
CMAKE_CCXX_FLAGS | Flags for the C++ Compiler | |
CMAKE_Fortran_COMPILER | Fortran Compiler | |
CMAKE_Fortran_FLAGS | Flags for the Fortran Compiler | |
ENABLE_NETCDF | For the grib_to_netcdf conversion tool | ON |
ENABLE_JPG | Enable JPEG2000 support. This option should look for JasPer or OpenJPEG. -DENABLE_JPG_LIBOPENJPEG=ON -DENABLE_JPG_LIBJASPER=ON | ON |
ENABLE_PNG | Enable PNG support for decoding/encoding | OFF |
ENABLE_AEC | Enable Adaptive Entropy Coding (AEC) for GRIB decoding/encoding (CCSDS) | ON |
ENABLE_PYTHON2 | Offers the Python2 interface to the package. Note: This option is deprecated and will bewas removed in Q1 2023. The Python2 interface to the package. (See below) | OFFN/A |
ENABLE_FORTRAN | Offers the Fortran 90 interface to the package | ON |
ENABLE_ECCODES_THREADS | Enable thread-safety using POSIX threads | OFF |
ENABLE_ECCODES_OMP_THREADS | Enable thread-safety using OpenMP threads | OFF |
ENABLE_MEMFS | See Memory based access to definition/sample files Note: When this is enabled, the sample files and definitions are not installed. To install them, add: -DENABLE_INSTALL_ECCODES_DEFINITIONS=ON -DENABLE_INSTALL_ECCODES_SAMPLES=ON | OFF |
ENABLE_EXTRA_TESTS | Enable extended regression testing (which requires data downloads) | OFF |
cmake options | doc | default |
---|
Note: The compilers can also be overridden by setting the environment variables CC CXX and FC.
Note: To see the full output from the compilation, you can use:
make VERBOSE=1
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:
Code Block |
---|
> tar -xzf eccodes-x.y.z-Source.tar.gz > mkdir build ; cd build > cmake -DCMAKE_INSTALL_PREFIX=/path/to/where/you/install/eccodes ../eccodes-x.y.z-Source ... > make > ctest > make install |
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:
Code Block |
---|
> cmake ... -DENABLE_EXTRA_TESTS=ON |
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)
...
> pip3 install eccodes
or
Code Block |
---|
> pip3 install --install-option="--prefix=/path/to/where/you/install/eccodes" eccodes |
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.
Code Block |
---|
> export ECCODES_DIR=/path/to/where/you/install/eccodes |
...
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 new platform.
Legacy build system ("autotools")
From ecCodes version 2.0.0 the "autotools" build system is deprecated and no longer supported.