Installing the development version

Alternatively to stable releases you can also install the development version of the code which includes the latest features that will become available with the next stable release. Installing the development version is recommended if you want to use latest code features and if you cannot wait for the next stable release. The current ctools development release is ctools-2.1.0.dev.

Installing the development version is also necessary if you want to contribute to code development. In that case please follow the instructions on Using Git and GitLab and ignore the rest of this page.

Getting the development version

The first step is to get the development version of the code. There are three options for that first step: either get the source tarball or clone the source code from the Git repository or download the binary installers for Mac OS.

Getting the source tarball

Download the source tarballs from the following links

Cloning the Git repository

To clone the gammalib and ctools source codes, type

$ git clone https://cta-gitlab.irap.omp.eu/gammalib/gammalib.git
$ git clone https://cta-gitlab.irap.omp.eu/ctools/ctools.git

This will create directories named gammalib and ctools under the current working directory that will contain the gammalib and ctools source code. In case that the cloning does not work you may try adding

$ export GIT_SSL_NO_VERIFY=true

or

$ git config --global http.sslverify "false"

before retrieving the code. Before you will be able to compile the code directly you need to generate the configuration file using the autogen.sh script. Also make sure that you’re actually on the devel branch of the git repository. You do this by typing:

$ cd gammalib
$ git checkout devel
$ ./autogen.sh
$ cd ../ctools
$ git checkout devel
$ ./autogen.sh

Downloading Mac OS binary packages

You can download the Mac OS installer image from the following link

and follow the instructions on Installing as binary package.

Compiling the development version

The second step is to compile the development version. You do not need to compile the code in case that you installed the Mac OS binary packages.

For code compilation, you can either compile the code directly using make or you can build a conda package. The latter is preferred if you want to use ctools in a conda environment. We do not recommend to compile the development version directly against a conda version of Python.

Compiling the development version

ctools and GammaLib can be compiled and configured using the following sequence of commands (the code will be installed into the /usr/local/gamma directory):

$ cd gammalib
$ ./configure
$ make
$ make check
$ sudo make install
$ export GAMMALIB=/usr/local/gamma
$ source $GAMMALIB/bin/gammalib-init.sh
$ cd ../ctools
$ ./configure
$ make
$ make check
$ sudo make install
$ export CTOOLS=/usr/local/gamma
$ source $CTOOLS/bin/ctools-init.sh

Please read the Installing from source code section if you need more information on how to install ctools.

Note

You need swig on your system to build the Python wrappers when you get the code from Git. Python wrappers are not stored in the Git repository but are built using swig from interface files located in the pyext folder. However, you do not need swig when fetching a tarball as the Python wrappers are bundled with the tarballs.

Building a conda package

Alternatively you can create a conda package using the following sequence of commands (make sure that anaconda is included in your $PATH environment):

$ cd gammalib
$ ./configure
$ conda build dev/conda.recipe --python=3.9
$ cd ../ctools
$ ./configure
$ conda build dev/conda.recipe --python=3.9

Once this is done, you can create a conda environment using the development version as follows:

$ conda create -n ctools-devel python=3.9
$ conda activate ctools-devel
$ conda install --use-local ctools=2.0.0.dev

Note that you can choose between Python 2.7, 3.5, 3.6, 3.7, 3.8, 3.9 and 3.10 for your conda environment.