Overview
codesUI uses CMake for compilation and installation. This is a first step towards an homogenisation of the installation procedures for all ECMWF packages.
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
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.
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_PREFIX | where you want to install your codesUI | /usr/local |
CMAKE_BUILD_TYPE | to select the type of compilation:
| RelWithDebInfo |
BUILD_SHARED_LIBS | Select the type of library built:
| ON |
CMAKE_C_COMPILER | C Compiler | |
CMAKE_C_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 convert tool | AUTO |
ENABLE_JPG | Enable JPEG2000 support. This option should look for Jasper or OpenJPG | AUTO |
ENABLE_PNG | Enable PNG support for decoding/encoding | OFF |
ENABLE_AEC | Enable Adaptive Entropy Coding for decoding/encoding | OFF |
ENABLE_PYTHON | Offers the Python interface to the package. Note: Currently only Python 2 is supported. | AUTO |
ENABLE_FORTRAN | Offers the Fortran interface to the package | AUTO |
ENABLE_ECCODES_THREADS | Enable POSIX threads | OFF |
ENABLE_ECCODES_OMP_THREADS | Enable OpenMP threads | OFF |
ENABLE_MEMFS | See Memory based access to definition/sample files | OFF |
Note: The compilers can also be overridden by setting the environment variables CC 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.
|
It is recommended that you always build in a clean directory and also install into a clean directory.
Note that for the testing step (running the ctest command) 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)
Also note that if you have several CPUs, you can invoke the "make" and "ctest" commands above in parallel (e.g. "make -j4"). This will speed up the whole build/test process significantly.
Legacy build system ("autotools")
From ecCodes version 2.0.0 the "autotools" build system is deprecated and no longer supported.