-
Notifications
You must be signed in to change notification settings - Fork 68
Using and Installing CCL on NERSC
WeikangLin edited this page Sep 14, 2017
·
23 revisions
-
There is a central installation of CCL (now 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
.
-
To install CCL on your own on NERSC, 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 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.