To develop new code for CCL, you need to install it using
install. This installation method creates a symbolic link between your
site-packages directory and the copy of CCL you are working on locally. Thus
when you change CCL
Python code, you do not need to reinstall CCL in order
for the changes to be visible system-wide. Note, if you change the CCL
code, you will need to force CCL to recompile the code (and copy the resulting
.so into the
Python package) by rerunning the command below.
To install CCL using a
pip developer installation, you can execute
$ pip install --no-deps -e .
from the top-level directory in the repository. You will need
order to install CCL in this way. See Getting CMake for help installing
CMake if you do not already have it. In order to run the tests,
you will need
FAST-PT installed. See the instructions for
Getting a Boltzmann Code and Getting FAST-PT for details.
C-layer Dependencies and Requirements¶
CCL has several C dependencies. The
CMake build will download and
compile these automatically if they are not present on your system. However,
if you do have them installed locally in a spot accessible to
local versions will be used.
These dependencies are
CCL in Developer Mode¶
CCL in developer mode, simply type
$ pip uninstall pyccl
Boostrapping a CCL Development Environment with
One of the easier ways to get started with CCL development is to use
conda-forge to provide the third-party requirements above and the necessary
compilers. The following commands will get you started with a
development environment. Note that before you start, make sure to follow the
for use and that your
PYTHONPATH variable is not set.
Then do the following
$ conda create -n ccl-dev compilers cmake swig pyccl pytest flake8 $ conda activate ccl-dev $ conda uninstall pyccl --force $ git clone https://github.com/LSSTDESC/CCL.git $ cd CCL $ pip install --no-deps -e .
This set of commands leaves a copy of the compiled
C extension in the checked out
copy of the code, e.g.,
$ ls pyccl/*.so pyccl/_ccllib.so
If you make changes to the
C library or checkout a new branch, simply rerun
pip install --no-deps -e . to rebuild the library.