Installation#

ExSHalos is wirtten in C/C++ and need some external libraries to work.

Even with the dependence list being small and composed of standard libraries (likely present in clusters), the installation instructions, for each library, is given below.

C/C++ dependencies:#

FFTW3 (required for installation)#

FFTW3 is used for the computation of discret Fourier transform of (mainly) the grid.

It can be installed from the source or from your favorite package manager.

  • From source:

Download and extract the latest version. Then, install for single (if used) and doble precision with openmp support:

tar -zxvf fftw-{$VERSION}.tar.gz
cd fftw-{$VERSION}
./configure --prefix={$PREFIX} --enable-openmp
make install
./configure --prefix={$PREFIX} --enable-openmp --enable-float
make install

Where {$VERSION} is the version of your fftw and {#PREFIX} is the path for the installation directory of fftw.

ExSHalos need the double precision for fftlog and the single precision if it is choosen to be used in the final installation.

  • Debian:

sudo apt install libfftw3-dev
  • Fedora:

sudo dnf install fftw-devel
  • Arch:

sudo pacman -S fftw
  • Nix:

nix-env -iA nixpkgs.fftw

GSL/CBLAS (required for installation)#

GLS is used for the generation of random numbers, interpolations and computation of some special functions.

It can be installed from source or from your favorite package manager.

  • From source:

Download and extract the latest version. Then, install it:

tar -zxvf gsl-latest.tar.gz
cd gsl-latest
./configure --prefix={$PREFIX}
make install

Where {$PREFIX} is the path for the installation.

  • Debian:

sudo apt install libgsl-dev libgslcblas0
  • Fedora:

sudo dnf install gsl-devel gsl-cblas
  • Arch:

sudo pacman -S gsl gsl-cblas
  • Nix:

nix-env -iA nixpkgs.gsl nixpkgs.gslcblas

OpenMP (required for installation)#

Openmp is usually pre-installed in the c/c++ compiler. If it is not the case, you can install in your system with standard commands.

  • Debian:

sudo apt install libomp-dev
  • Fedora:

sudo dnf install llvm-omp
  • Arch:

sudo pacman -S gsl openmp
  • Nix:

nix-env -iA nixpkgs.llvmPackages.openmp

pip (optional for building)#

Pip is the easiest way to install ExSHalos globally. However, it can also be installed with:

python setup.py install

In the case you want to install pip, it can be done with the commands:

  • Debian:

sudo apt install python3-pip
  • Fedora:

sudo dnf install python3-pip
  • Arch:

sudo pacman -S python-pip
  • Nix:

nix-env -iA nixpkgs.python3Packages.pip

Python dependencies#

  • Numpy (required for installation)

  • setuptools (required for installation)

  • scipy (required for running

Setuptools is the library used to compile the C modules and link them to the python package (throgh the .so files).

Numpy.array is the fundamental object (sorry for this OOP word) in ExSHalos. Therefore, it needs to be installed, at compilation time, because of the C/python interface.

Scipy is used in some modules for simple interpolations, optimizations and computation of special function.

Once you have pip (or conda), these libraries can be installed with:

{pip/conda} install numpy setuptools scipy

Where you have to choose between pip or conda denpending of your prefered python package manager.

Package installation#

Once all dependencies are installed, ExSHalos can be install with:

git clone https://github.com/Voivodic/ExSHalos.git
cd ExSHalos
pip install .

Automatic and isolated installation#

If you want a more isolated and segure installation, and do not want to handle the dependencies manually, ExSHalos makes available three options:

Docker#

To create a Docker image you only need to

git clone https://github.com/Voivodic/ExSHalos.git
cd ExSHalos
docker build -t your_image_name .

Then, to create a Docker container and enter into its shell

docker run -it --name your_container_name your_image_name

Apptainer#

An opensource alternative to Docker (usually used in scientific clusters) is Apptainer. You can create similar images doing

git clone https://github.com/Voivodic/ExSHalos.git
cd ExSHalos
apptainer build your_image_name.sif exshalos.def

Then, to enter in an isolated shell

apptainer shell your_image_name.sif

Nix#

Last but not least, you can also create an ephemeral shell using Nix with flakes. For this, you only need to run

git clone https://github.com/Voivodic/ExSHalos.git
cd ExSHalos
nix develop