-
Notifications
You must be signed in to change notification settings - Fork 68
Using and Installing CCL on NERSC
- Using the CCL Python module in the shared environment :
- Setup the environment:
source /global/common/software/lsst/common/miniconda/setup_current_python.sh
- Quick test to be sure things are set up correctly
You can check whether pyccl has been set up correctly by running
python -c "import pyccl"
and checking that no errors are returned.
- Setup the environment:
or
-
Run Example Notebooks
- Set up your NERSC account by adding DESC jupyter kernels to your environment. This only needs to be done once.
source /global/common/software/lsst/common/miniconda/kernels/setup.sh
- Clone the CCL repo to your NERSC $HOME directory
git clone https://github.com/LSSTDESC/CCL.git
- Start up jupyter-dev in your web browser.
-
Choose either
-
The simple notebook editor: http://jupyter-dev.nersc.gov/
OR
-
The more full-featured JupyterLab available by pointing your browser to:
https://jupyter-dev.nersc.gov/user/$USER/lab/tree$HOME
Replace $USER with your NERSC username, and $HOME with the full path to your NERSC $HOME directory (e.g
/global/homes/p/pjm43
)
-
-
Open your notebook
-
Change the kernel to
desc-stack
-
Run your notebook
-
git clone https://github.com/LSSTDESC/CCL.git
cd CCL
git checkout ccl_paper
module load python/3.6-anaconda-4.4
module load latex
pip install --user mkauthlist
export MKAUTHLIST=$HOME/.local/cori/3.6-anaconda-4.4/bin/mkauthlist
cd doc/ccl_paper
make apj
[OUTDATED] These are old notes for building the C library. Leaving this here for now.
-
If class is not installed already (The last step needs to be done in CCL installation directory).
export CFLAGS=-fPIC
export CRAYPE_LINK_TYPE=dynamic
export XTPE_LINK_TYPE=dynamic
python class_install.py
-
Load the necessary modules. You can run the steps as follows (or put them in a script, e.g., CCL_setup.sh, and do
source CCL_setup.sh
)module load gsl/2.1
module load cray-fftw
module load swig
export LDFLAGS+="-L$GSL_DIR/lib -L$FFTW_DIR"
export CPPFLAGS+="-I$GSL_DIR/include -I$FFTW_DIR/../include"
-
Then you can go to the CCL directory and install CCL in /path/you/choose by running
./configure --prefix=/path/you/choose
make
make install
-
Next, do the following to allow your compiled code to call CCL (only need to do once, or write to your .bashrc file):
-
export LD_LIBRARY_PATH=/path/you/choose/lib:$LD_LIBRARY_PATH
.
and add /path/you/choose to LDFLAGS and CPPFLAGS by (pay attention to the space before -L)
export LDFLAGS+=" -L/path/you/choose/lib"
export CPPFLAGS+=" -I/path/you/choose/include"
-
-
Now you can compile your code calling CCL, e.g., ./examples/ccl_sample_run.c by
gcc -Wall -Wpedantic -g $CPPFLAGS -std=gnu99 -fPIC examples/ccl_sample_run.c -o examples/ccl_sample_run $LDFLAGS -lgsl -lgslcblas -lm -lccl
and run it.