Page tree

Overview

GSL is the GNU Scientific Library

How to use 


The Latest versions of GSL library are compiled with Intel compilers. Because of this, we recommend using Intel compilers with GSL.

For example, to use gsl/2.6 use the following:

# Load modules, always specify version number.
$ module load intel-compiler/2019.3.199
$ module load intel-mkl/2019.3.199
 
$ module load gsl/2.6

For more details on using modules see our software applications guide.

This sets the environment variable GSL_ROOT to the location of the GSL installation and adds the GSL bin and lib directories to your PATH and LD_LIBRARY_PATH. Also adds the GSL include directory to the environment variable CPATH.

You need to include the relevant gsl header file in your code.

The use of Intel compilers allows you to use highly optimized MKL cblas libraries with gsl. Use the following link line for this:

$ icc prog.c -lgsl -lmkl_core -lmkl_intel_lp64 -lmkl_intel_thread -liomp5 -lm

It is also possible to use non-optimised cblas libraries that comes with gsl:

$ icc prog.c -lgsl -lgslcblas -lm

Note however, that use of MKL cblas may give your program a 10x times speed up and thus is the recommended way to use GSL.

Authors: Yue Sun, Andrey Bliznyuk, Mohsin Ali
  • No labels