-
Notifications
You must be signed in to change notification settings - Fork 68
Using and Installing CCL on NERSC
-
There is a central installation of CCL (now version 0.2) on NERSC. To use it, one can run
source /global/common/cori/contrib/lsst/ccl/setupPyCCL.sh
which will load the required modules and set some path flags.
-
Then we can compile, e.g., ./tests/ccl_sample_run.c by
gcc -Wall -Wpedantic -g -I$CCL_NERSC_DIR/$CCL_NERSC_VER/include $CPPFLAGS -std=gnu99 -fPIC tests/ccl_sample_run.c -o tests/ccl_sample_run -L$CCL_NERSC_DIR/$CCL_NERSC_VER/lib $LDFLAGS -lgsl -lgslcblas -lm -lccl
and run
./tests/ccl_sample_run
.
Note that the current central installed CCL on NERSC is of version 0.2. The package of version 0.2 can be obtained from /global/common/cori/contrib/lsst/ccl/downloads/0.2.tar.gz
, where sample codes are provided. To use the latest version of CCL, one may follow the instructions below to install it on his own.
-
If class is not installed already, do the following in your CCL installation package 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 (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., ./tests/ccl_sample_run.c by
gcc -Wall -Wpedantic -g $CPPFLAGS -std=gnu99 -fPIC tests/ccl_sample_run.c -o tests/ccl_sample_run $LDFLAGS -lgsl -lgslcblas -lm -lccl
and run it.