Installation

Getting GammaLib

Prerequisites

Building GammaLib

Testing GammaLib

Installing GammaLib

Setting up your environment

Installing documentation

Known Problems

Getting Help


Note: These installation instructions apply to GammaLib-00-04-06 and later.



Getting GammaLib

The latest version of the GammaLib source code, documentation, and example programs are available on the World-Wide Web from https://sourceforge.net/projects/gammalib/.



Prerequisites

GammaLib should compile on every modern Unix system without any need to install other libraries.

To enable support for FITS file handling, however, the cfitsio library from HEASARC needs to be installed. cfitsio can be downloaded from http://heasarc.gsfc.nasa.gov/fitsio and detailed installation instructions can be found there. If cfitsio does not already exist on your system, we recommend installation of cfitsio in the default GammaLib install directory as a shared library by typing:

> ./configure --prefix=/usr/local/gamma
> make shared
> make install

GammaLib can also benefit from the presence of the readline library that provides line-editing and history capabilities for text input (GammaLib offers however also full functionality without having readline installed). readline can be downloaded from http://ftp.gnu.org/gnu/readline/



Building GammaLib

Download the latest source tarball, save it in an appropriate location, and type

> tar xvfz GammaLib-XX-XX-XX.tar.gz

where XX-XX-XX is the version number of the library. Step in the created directory using

> cd GammaLib-XX-XX-XX

and build GammaLib by typing

> ./configure
> make

at the operating system prompt. The configuration command customizes the Makefiles for the particular system, the make command compiles the source files and builds the library, and the make install command installs the library in the install directory. Type ./configure and not simply configure to ensure that the configuration script in the current directory is run and not some other system-wide configuration script. By default, the install directory is set to /usr/local/gamma. To change the install directory an optional --prefix argument should be given, for example:

> ./configure --prefix=/usr/local

If cfitsio and/or readline is not installed in a standard location for libraries (such as /usr/lib or /usr/local/lib), the appropriate location(s) can be specified using the LDFLAGS (for the library directory) and CPPFLAGS (for the include directory) options:

> ./configure LDFLAGS='-L/opt/local/lib' CPPFLAGS='-I/opt/local/include'

A full list of configuration options can be found using

> ./configure --help



Testing GammaLib

GammaLib should be tested by typing:

> make check

This will execute an extensive testing suite that should terminate with

===================
All 14 tests passed
===================

Eventually, loading the shared cfitsio and/or readline libraries may fail during the test if the libraries are not located in standard locations. In this case, add the library directories to the LD_LIBRARY_PATH environment variables (DYLD_LIBRARY_PATH on Mac OS X), e.g.

export LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH

or

setenv LD_LIBRARY_PATH /opt/local/lib:$LD_LIBRARY_PATH

on C shell variants.



Installing GammaLib

Install GammaLib by typing

> make install

at the operating system prompt.



Setting up your environment

Before using GammaLib you have to setup some environment variables. This will be done automatically by an initialisation script that will be installed in the bin directory. Assuming that you have installed GammaLib in the default directory /usr/local/gamma you need to add the following to your .bashrc or $HOME/.profile script on a Linux machine:

export GAMMALIB=/usr/local/gamma
source $GAMMALIB/bin/gammalib-init.sh

If you use C shell or a variant then add the following to your .cshrc or .tcshrc script:

setenv GAMMALIB /usr/local/gamma
source $GAMMALIB/bin/gammalib-init.csh



Installing documentation

The GammaLib web pages are shipped together with the source code and will be installed in the directory $(prefix)/share/doc/gammalib/html, where $(prefix) is the installation base path, by default /usr/local/gamma.


For developers, a more detailed documentation can be built from the source code using Doxygen. Doxygen will scan the source files for code annotations, and compiles a complete documentation of the implemented C++ classes in a set of www pages. In addition, it will create a set of man files that can be used by the man command. If you have not installed Doxygen on your machine, but you need the development documentation, please visit http://www.stack.nl/~dimitri/doxygen/index.html to download and install the Doxygen package.


Once Doxygen is install, type the following to build and to install the Doxygen documentation:

> ./configure
> make doxygen
> make doxygen-install

The Doxygen documentation will be installed into $(prefix)/share/doc/gammalib/html/doxygen and can be browsed using a regular web browser.


To check man support, type for example

> man GObservations

and you should see the documentation for the GObservations C++ class.



Known Problems

Solaris
GammaLib has been compiled successfully on Solaris 2.10 using the Sun Studio compiler. However, when linked as a shared library, symbols are not globally exported. This prevents the GammaLib library from catching its own exceptions and from registering models. Consequently, many unit tests will fail.

Using gcc (version 3.4.3), GammaLib works correctly on Solaris 2.10, yet loading GammaLib as a Python module fails.



Getting Help

Any questions, bug reports, or suggested enhancements related to GammaLib should be submitted via the Tracker on https://sourceforge.net/projects/gammalib/ or the gammalib-users@lists.sourceforge.net mailing list.