Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: update version numbers of dependencies and links
Info
titleMagics is now using ecCodes

From version 2.30.0 onwards (see November synchronised release), Magics will be built by default with ECC instead of GRIB-API.

Overview

From the 2.22.0 version, Magics is  using CMake for its compilation and installation. This is a first step towards an homogenisation of the installation procedures for all ECMWF packages. 

Binary versions

Before you install from source code you might want to check that already compiled binary versions are available to you. Magics and third-party dependent software packages might be available as binary packages for you platform in form of RPMs or Debian packages . You might find them by going to the software search services, such as for OpenSuSE and SLES at http://software.opensuse.org/search (select "Search options" - "Include users' home projects"). Ubuntu for Linux. Ubuntu maintains a Magics version in their system default repository

Installing Magics through conda and pip

If you want to use Magics only through Python you have now choices to install Magics with your favourite Python package manager. With the release of Magics 4.

...

0.0 (Feb 2019), the Python interface is separated from the library. This allowed the packaging through pip and conda.

Using pip

When using pip it is required to have the Magics library installed on the system!

Code Block
pip install Magics

Ref: https://pypi.org/project/Magics/

Using conda

Conda will install the Magics library and all its dependencies for you. Please make sure to  activate you conda environment  before running your python program.

Code Block
conda install -c conda-forge Magics
conda activate
python my-magics-script.py


Building Magics from source yourself

Requirements

...

The following table lists the dependency Magics requires to be build from source. Please note, if you install this package from source you also might have to install the respective "-devel" packages of dependencies. 

if BUFR support needed
Compilers
C++http://gcc.gnu.org/ The compiler must support C++ 17. GCC supports it from version 7
Fortranhttp://gcc.gnu.org/fortran/If Fortran or BUFR support neededOnly needed to run Fortran tests
Utilities

make

http://www.gnu.org/software/make/ 
cmakehttps://cmake.orgversion > v2.8.4
Python Support
swighttp://www.swig.org/to generate the python interface
pythonhttp://www.python.org/ 
python-numpyhttp://www.numpy.org/ 
3.12
Third party libraries
projhttphttps://trac.osgeoproj.org/proj/Proj4 to handle projections
boosthttp://www.boost.org/ (Requires 1.5)used for coastlines
netcdfhttp://www.unidata.ucar.edu/software/netcdf/

if for netcdf support needed

Please note: You also need to install the legacy C++ interface and HDF5

cairo + pangohttps://www.cairographics.org
http://www.pango.org/
if for png/pdf support needed
expathttp://expat.sourceforge.net/for XML parsing
ECMWF libraries
ecCodesECC 
grib-apiGRIB-API Home (Requires 1.9 or above)please consider using ecCodes!
Enables GRIB and BUFR support 
odcodc on GitHubodb-apiODB-API Homeif ODB support neededemoslibEMOS

Include Page
SUP:General CMake installation instructions
SUP:General CMake installation instructions

Magics specific CMake options

After changing into the build Magics directory, the user  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. Table below gives an overview of the different options of configure. The default (without any options) will compile a share library only and install it in /usr/local/.

enable grib support
cmake optionsdocdefault

ENABLE_GRIB

on
ENABLE_ECCODES

Use ecCodes for grib support

Setting this variable to OFF will will build Magics with grib_api

onECCODES_PATHwhere to find eccode eccodes ( if non-standard installation  ) 
ENABLE_NETCDFenable netcdf supporton
NETCDF_PATHwhere to find netcdf  ( if non-standard installation  ) 
ENABLE_ODBenable odb supportoff
ODB_API_PATHwhere to find odb ( if non-standard installation  ) 
ENABLE_BUFR

enable bufr support

The bufr support is done through emoslib .

off
EMOS_PATHWhere to find emos lib  ( if non-standard installation  ) 
ENABLE_PYTHONenable python interfaceauto
ENABLE_FORTRANenable fortran interfaceon
ENABLE_METVIEWenable metview support(and Qt support)off
ENABLE_CAIROenable Cairo supportonBOOST_ROOTwhere to find boost ( if non-standard installation  ) 
PROJ4_PATHwhere to find proj4 ( if non-standard installation  ) 

To make sure that a feature is really enabled, you will have to specify with the option ex: -DENABLE_GRIBNETCDF=ON. In that case CMake will fail if the GRIB NetCDF support can not cannot be enabled.

Testing your build

The Magics code contains a directory called test in which, in separate sub-directories, tests for the various interfaces of Magics are provided. Test programs in Fortran , and C , Python and MagML are compiled and run if MAGPLUS_HOME=$PWD make check is invoked from the root directory. (Note that the MAGPLUS_HOME needs to be set!)

...