What is GSL?

GSL is a numerical library for C and C++ programmers. The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting.

Using GSL on HPC system

GSL version supported in different HPC system is listed at Scientific Software and Programming Tools

The GSL library header files are installed at /share1/gsl/[version]/include. You should add the preprocessor include statement with a gsl/ directory prefix like,
#include <gsl/gsl_math.h>

Compile and linking program with the library
$ gcc -I/share1/gsl/[version]/include -L/share1/gsl/[version]/lib program.c -lgsl -lm

Using GSL on hpc2015

GSL version 2.1 is available on hpc2015, there are two flavors: x86_64 and Intel MIC

x86_64 version

Load the required module via module load gsl/intel
Compile and linking program with the library
$ icc -lgsl -mkl

MIC version

Load the required module via module load gsl_mic/intel

Compile and linking program with the library (to build program natively run on MIC-card)
$ icc -mmic -lgsl -mkl -L/share1/gsl_mic/[version]/lib -limf -lsvml -lirng -lintlc
Environment variable to be set before running the native binary on MIC-card
(icc_version usually takes the form of ics20XX where 20XX is a year number)
$ LD_LIBRARY_PATH=/share1/gsl_mic/[version]/lib:/share1/intel/[icc_version]/mkl/lib/mic:/share1/intel/[icc_version]/lib/mic:$LD_LIBRARY_PATH

Additional Information

GSL documentation:GSL Reference Manual Online

More information can be found at the GSL homepage: http://www.gnu.org/software/gsl/