You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Current »

This section will discuss the setup needed by users to use the installed Magics library and its applications.

Magics environment variables

The variable $MAGPLUS_HOME is the path where Magics will find all auxiliary data at run-time. If Magics is installed where the configure prefix option was set to, this variable does NOT need to be set. Otherwise the variable needs to be set for all users of Magics programs. If Magics reports problems at run-time about missing coastlines or fonts this variable might not be set correctly.

Magics provides feedback on the console. You can control the amount of messages plotted by setting any of the following environment variables:

$MAGPLUS_INFO - Information and hints to what Magics is doing

$MAGPLUS_QUIET - suppresses the Magics header, footer and info output – only errors and warnings will cause output

System environment variables

Hint: If you choose a standard system folder, such as /usr or /usr/local/, for your installation you might not have to change any system environment variables.

$LD_LIBRARY_PATH - To work with shared libraries the locations of these libraries need to be known at run-time. This environment variable contains a list of paths where at run-time the system loader will look for libraries. To use the shared library version of Magics the location of the library needs to be set in $LD_LIBRARY_PATH. If the variable is not set correctly the loader might pick up a version of Magics which was not intended.

If EmosLib is compiled with Pgf90, it binds in libpgc.so dynamically at run-time and so the path to this library needs to be in $LD_LIBRARY_PATH.

$PATH - Magics provides not only libraries, but also some executables. To use these, the $PATH needs to include the location of these programs. Usually this will be $MAGPLUS_HOME/bin.

magics-config

In the past we offered a tool called magics-config to ease the compilation of Fortran programs using Magics. Unfortunately this tool caused many problems for users and we replaced it with the more generic pkg-config setup described below.

Compiling with pkg-config

pkg-config is a script that provides a unified interface for querying installed libraries for the purpose of compiling software from its source code. pkg-config was originally designed for Linux but is now also available for the various BSDs, Microsoft Windows, Mac OS X, and Solaris. It outputs various information about installed libraries. This information may include parameters for C or C++ compiler and parameters for linker.

This script is very similar to what magics-config offered previously, but pkg-config is more general while magics-config was very Magics specific options. For example:

For C programs:   gcc -o  wind wind.c $(pkg-config --libs --cflags magics)

For single float precision Fortran:   gfortran -o wind wind.f -lMagPlusSingle $(pkg-config --libs magics)

For double float precision Fortran:     gfortran -o wind wind.f -fdefault-real-8 -lMagPlusDouble $(pkg-config --libs magics)

To find these information about the Magics compilation the environment, the variable PKG_CONFIG_PATH needs to contain the directory $MAGPLUS_HOME/lib/pkgconfig:

export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:$MAGPLUS_HOME/lib/pkgconfig

For more information visit pkg-config on Wikipedia.

  • No labels