GNU Science Library (GSL)
Description
GSL, a numerical library for C and C++ programmers, is available on Franklin, Hopper, Carver, and Euclid.
How to Access GSL
You must use the module utility to access the library on all machines at NERSC. To load:
module load gsl
To see what environment variables are defined by the library:
module show gsl
Using GSL at NERSC
Below, you can see a sample program that uses GSL. To compile this program on Carver or Euclid, use the following:
mpicc gsl.c -I$GSL_DIR/include -L$GSL_DIR/lib -lgsl -lgslcblas
Note: On Hopper if you want to use the gcc compiler and GSL you must swap the modulefiles for the programming environments. DO NOT invoke gcc directly. (This means you should use, for example, module swap PrgEnv-pgi PrgEnv-gnu.) On Hopper the following is sufficient:
cc gsl.c -I$GSL_DIR/include -L$GSL_DIR/lib -lgsl
GSL Example Code
Documentation
Full documentation is available at GNU.org. For questions on using this software at NERSC contact the consultants via email: consult@nersc.gov
Availability
Package | Platform | Category | Version | Module | Install Date | Date Made Default |
---|---|---|---|---|---|---|
GSL | pdsf | libraries/ math | 1.3 | gsl/1.3 | 2012-03-12 |