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 hpc2021

GSL version 2.7 is available on hpc2021, there are two flavors: GNU gcc and Intel

GNU gcc version

Load the required module via module load gsl/gcc
Compile and linking program with the library
$ gcc -lgsl -lm

Intel version

Load the required module via module load gsl/intel

Compile and linking program with the library
$ icc -lgsl -mkl

Additional Information

GSL documentation:GSL Reference Manual Online

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