Package installation
====================
.. highlight:: bash
Simplified way for DESI members at NERSC
----------------------------------------
Recommended to use with ``cosmodesi`` environment.
In particular, load it before installing::
source /global/common/software/desi/users/adematti/cosmodesi_environment.sh main
pip install -e /global/common/software/desi/users/mrash/RascalC
This installs the library from a common software folder in the development mode, so that after I update it e.g. with some fix, you will have the new version without the need to re-install most of the time.
You may occasionally need to re-install ``RascalC`` (e.g., when the Python version changes in the ``main`` ``cosmodesi`` environment).
Generic installation
--------------------
Prerequisites
^^^^^^^^^^^^^
OS: Linux (recommended) or macOS. Others (including Windows) not supported.
- C and C++ compilers: `GNU `_ (Linux) or Apple ``clang`` (macOS);
- `GNU Scientific Library (GSL) `_;
- `OpenMP `_ (required for parallelization).
On Linux, install these from your distribution's repositories.
On macOS, install the following with `Homebrew `_ (other setups will likely require editing the ``Makefile``)::
brew install gsl pkg-config libomp
Additionally, the code requires `pycorr `_ and `lsstypes `_ to deal with pair counts and data correlation function estimators.
To compute pair counts of catalogs, you need a `custom version of Corrfunc `_ (see also `pycorr installation instructions `_), or `cucount `_.
``pycorr`` and custom ``Corrfunc`` can be both installed with a single command::
python3 -m pip install 'git+https://github.com/cosmodesi/pycorr#egg=pycorr[corrfunc]'
If you get the GPU support problem with ``Corrfunc`` (``Error: To compile with GPU support define "CUDA_HOME" Else set "USE_GPU=0"``), it is probably easiest to prepend either definition to the command: ``CUDA_HOME=... python3 -m pip install 'git+https://github.com/cosmodesi/pycorr#egg=pycorr[corrfunc]'`` or ``USE_GPU=0 python3 -m pip install 'git+https://github.com/cosmodesi/pycorr#egg=pycorr[corrfunc]'``.
Alternatively, you can ``export CUDA_HOME=...`` or ``export USE_GPU=0`` in your shell before running ``python3 -m pip install 'git+https://github.com/cosmodesi/pycorr#egg=pycorr[corrfunc]'``.
One of the reasons we recommend Linux is that building ``Corrfunc`` with multi-threading support on macOS has been a very hard experience.
RascalC Python package
^^^^^^^^^^^^^^^^^^^^^^
Clone the Github repository and install the package from the source directory::
git clone https://github.com/oliverphilcox/RascalC
cd RascalC
python3 -m pip install .
Make sure to reinstall after pulling updates.
Or you can install with a single command::
python3 -m pip install git+https://github.com/oliverphilcox/RascalC
Repeat this command to update the package.