Installation
Step 2: Setup GammaLib environment
Step 4: Setup ctools environment
Note: These installation instructions apply to ctools-00-04-00 or later.
ctools
depends on GammaLib and thus GammaLib needs to be installed on your
system prior to installing ctools. If you do not have GammaLib
installed, or if you need to upgrade GammaLib, fetch the latest copy
from https://sourceforge.net/projects/gammalib/
and
follow the GammaLib installation instructions on
http://gammalib.sourceforge.net/.
Step 2: Setup GammaLib environment
Before building and installing ctools, you have to configure GammaLib by setting up some environment variables. This will be done automatically by an initialisation script that is found in the bin directory of the GammaLib directory (we call here "GammaLib directory" the directory into which GammaLib has been installed). Assuming that you have installed GammaLib in the default directory /usr/local/gamma you need to add the following to your $HOME/.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 $HOME/.cshrc or $HOME/.tcshrc script:
setenv GAMMALIB /usr/local/gamma
source $GAMMALIB/bin/gammalib-init.csh
After downloading the ctools tarball, save it in an appropriate location (for example /usr/local/gamma/src), and type
> tar xvfz ctools-00-04-00.tar.gz
Step in the created directory using
> cd ctools-00-04-00
and build and install ctools by typing
> ./configure
> make
> make check
> make install
at the operating system prompt. The ./configure command customizes the Makefiles for the particular system, the make command compiles the source files and builds the executables, the the make check command performs a system test, and the make install command installs the executables in the bin 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
A full list of configuration options can be found using
> ./configure --help
Step 4: Setup ctools environment
If ctools have been installed in the same directory as GammaLib (which is the default configuration for ctools) you are done.
If you decided to install ctools in a different directory, you have to configure ctools by setting up some environment variables. This will be done automatically by an initialisation script that is found in the bin directory of the directory into which ctools has been installed. Assuming that you have installed ctools into /usr/local/ctools you need to add the following to your $HOME/.bashrc or $HOME/.profile script on a Linux machine:
export CTOOLS=/usr/local/ctools
source $CTOOLS/bin/ctools-init.sh
If you use C shell or a variant then add the following to your $HOME/.cshrc or $HOME/.tcshrc script:
setenv CTOOLS /usr/local/ctools
source $CTOOLS/bin/ctools-init.csh
Python
support
ctools comes with Python wrappers so that all classes can be
directly used from Python. To compile-in Python support, ctools
needs the Python.h
header file, which on many distributions is not
installed by default.
To make Python.h
available, install the Python developer package
in your distribution. Otherwise you will not be able to use ctools
from Python.
Mac OS X
The Python development package is not installed as default on Mac
OS X, and consequently, the Python.h
header file is missing that is
needed to compile in the Python bindings. The configure
script recognises this fact and adjust the build procedure accordingly,
but you
will not be able to use ctools from Python. So better install the
Python development package before installing ctools.
It
was also reported that adding of export
MACOSX_DEPLOYMENT_TARGET=10.6 to the .bashrc
file was necessary one
some Mac OS X 10.6 installations to make ctools compile.
Solaris
Although ctools builds on Solaris using the Sun compiler, there are
problems with global symbols in shared libraries and exception
catching, which prevents the FITS interface to work
correctly. ctools has however been built and tested successfully
using the GNU
compiler, and this is the only build method that is currently
supported.
Problems have also been encountered when compiling cfitsio versions
more recent than 3.250. The problems have been reported to the cfitsio
developer team, and are likely to be solved in the future. For the
time being, it is recommended to use cfitsio version 3.250 on Solaris.
OpenSolaris
On OpenSolaris, the same problems concerning the SunStudio compiler
occur as for Solaris, and also here, the GNU compiler is the
recommended
tool to build ctools. Also here, cfitsio version 3.250 is the
recommended library as more recent version feature relocation
problems. ctools has been tested using gcc 4.3.2 on OpenSolaris
2009.06. Make sure to create the symbolic links
ln -s /usr/bin/gcc4.3.2 /usr/bin/gcc
ln -s /usr/bin/g++4.3.2 /usr/bin/g++
which are not there by default to avoid excess warnings during compilation.
Any questions, bug reports, or suggested enhancements related to ctools should be submitted to knodlseder@cesr.fr.
Last updated by: Jürgen Knödlseder (4 April 2012)