Installing Colibri on Linux or macOS

This section covers installing colibri in various ways.

1. Development Installation via Conda

You can install colibri easily by first cloning the repository and then using the provided environment.yml file

git clone https://github.com/HEP-PBSP/colibri
cd colibri

from your conda base environment run

conda env create -f environment.yml

This will create a colibri-dev environment installed in development mode. If you want to use a different environment name you can run:

conda env create -n myenv -f environment.yml

2. Installing with pip

If you don’t want to clone the repository and don’t need to work in development mode you can follow the installation instructions below.

Note

Most of the colibri dependencies are available in the PyPi repository, however non-python codes such as LHAPDF and pandoc won’t be installed automatically and need to be manually installed in the environment. Because of this we recommend to use a conda environment.

Create a conda environment from your base environment, for instance

conda create -n colibri-dev python>=3.11

In this new environment install the following conda packages

conda install mpich lhapdf pandoc mpi4py ultranest pip

After having completed this you can simply install the rest of the dependencies with pip:

python -m pip install git+https://github.com/HEP-PBSP/colibri.git

Note, this will install the latest development version, if you want to install a specific release you can specify the version, for instance for v0.2.0 you can use the following command

python -m pip install git+https://github.com/HEP-PBSP/colibri.git@v0.2.0

To verify that the installation went through

python -c "import colibri; print(colibri.__version__)"
colibri --help

3. GPU (CUDA) JAX Support

The installation instructions shown above will install jax in cpu mode. It is however possible to run colibri fits using gpu cuda support too. To do so, after installing the package following one of the methods shown above, if you are on a linux machine you can install jax in cuda mode by running

pip install -U "jax[cuda12]" -f https://storage.googleapis.com/jax-releases/jax_releases.html

Note

It is possible to run fits using float32 precision, the only way of doing so currently is to apply a patch to ultranest so that the json.dump is compatible. To do that, follow the instructions:

git clone git@github.com:LucaMantani/UltraNest.git
cd UltraNest
git switch add-numpy-encoder
pip install .