Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

$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.

Warning
titlemagics-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.