NERSCPowering Scientific Discovery Since 1974

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

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
GSL euclid libraries/ programming 1.13 gsl/1.13 2010-06-14 2010-06-14
GSL euclid libraries/ programming 1.14 gsl/1.14 2012-02-21
GSL euclid libraries/ programming 1.15 gsl-gnu/1.15 2012-10-04 2012-10-04
GSL pdsf libraries/ math 1.3 gsl/1.3 2012-03-12