NERSCPowering Scientific Discovery Since 1974

GNU Science Library (GSL)

 

Description

GSL, a numerical library for C and C++ programmers, is available on Hopper, Edison, and Carver, and PDSF.

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 on Cori and Edison

On Cori or Edison if you want to use the gcc compiler and GSL you must swap the modulefiles for the programming environments.  DO NOT invoke gcc directly. 

module swap PrgEnv-intel PrgEnv-gnu
cc gsl.c -I$GSL_DIR/include -L$GSL_DIR/lib -lgsl

Using GSL on other NERSC Systems

Below, you can see a sample program that uses GSL.  You need to use a command such as mpicc to compile and also provide more libraries for linking:

mpicc  gsl.c -I$GSL_DIR/include -L$GSL_DIR/lib -lgsl -lgslcblas

GSL Example Code

GSL example program 

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

PackagePlatformCategoryVersionModuleInstall DateDate Made Default
GNU Scientific Library babbage libraries/ math host-1.16 gsl/host-1.16 2014-11-04
GNU Scientific Library babbage libraries/ math mic-1.16 gsl/mic-1.16 2014-11-04 2014-11-04
GNU Scientific Library genepool pe_libraries/ math 1.15 gsl/1.15 2012-07-30 2012-08-08
GNU Scientific Library phoebe pe_libraries/ math 1.15 gsl/1.15 2012-07-30 2013-06-26
GNU Scientific Library (GSL) cori libraries/ math 1.16 gsl/1.16 2015-10-02 2015-10-02
GNU Scientific Library (GSL) cori libraries/ math 2.1 gsl/2.1 2016-07-01 2016-07-01
GNU Scientific Library (GSL) edison libraries/ math 1.15 gsl/1.15 2013-01-02 2013-01-02
GNU Scientific Library (GSL) edison libraries/ math 1.16 gsl/1.16 2013-10-01 2015-04-15
GSL pdsf libraries/ math 1.3 gsl/1.3 2012-03-12