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. 

 http://www.boost.org/ (Requires 1.5)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 needed
Utilities
Only 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 projectionsboostused 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)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/.

Use ecCodes for grib support

Setting this variable to OFF will will build Magics with grib_api
cmake optionsdocdefault

ENABLE_GRIB

enable grib supporton
ENABLE_ECCODESon
ECCODES_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_PYTHON
enable python interfaceautoENABLE_FORTRANenable fortran interfaceon
ENABLE_METVIEWenable metview support(and Qt support)off
ENABLE_CAIROenable cairo 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!)

The output of the tests should verified before the library is installed. This setup does not check if the user setup is correct, but the code in test can be used to do so. More examples of source code can be found on the Magics web gallery

Installation FAQ

Why do I get the error message while loading shared libraries: libMagPlus.so.1: cannot open shared object file: No such file or directory when running a Magics executable?

You need to alter your $LD_LIBRARY_PATH variable, as described in section “User setup”. The variable needs to contain the path to your Magics library.

Why do I get a message about a missing / not found libpgc.so when trying to run a Magics executable?

If your EmosLib is compiled with Portland’s Pgf90, it requires this library as shared library at run-time. You need to alter your $LD_LIBRARY_PATH variable.

How can I change the coastline files?

Coastline files are given in Shape file format. The GIS data was taken from http://www.naturalearthdata.com.

Can I add GIS information, such as rivers and borders to my plots?

Yes. Information about political borders and rivers have been added with the new coastline files.

Why have the Printercap file and the frame in my PostScript disappeared?

With version 2.4 of Magics we have changed the set-up of how the PostScript driver was internally organised. The Printercap configuration file was created in the past to accommodate differences between printers. This is nowadays no issue any more. Out of the same reason PostScript output was scaled down to 95% to allow room for Printer alignment problems. From version 2.4 onwards the scaling is, as in all other drivers, set back to 100% of the page size.

Why did version 2.6 of Magics was followed by version 2.8?

With Magics 2.4 we introduced a new numbering scheme where the sub version indicates how stable the version of Magics is. Odd numbers (2.5, 2.7, …) indicate unstable development versions and even numbers (2.4, 2.6, 2.8, …) indicate versions we think are stable and tested enough to be used in your applications.

How can I report bugs or ask for help?

Please write an email to magics@ecmwf.int . Please compress any larger files you might need to attach with gzip .