GSL¶
Module¶
GNU Scientific Library (GSL) is now available in the 2022r2
software stack:
Compile your own GNU Scientific Library¶
GNU Scientific Library (GSL) is now available in the 2022r2
software stack.
It is quite easy to compile it yourself. On DelftBlue, you will need to do the following:
- Load necessary modules:
- Get the GSL and create an install folder:
- Configure, compile and install GSL:
-
Check to see if GSL works as intended: First, create the following program and name it
example.c
:#include <stdio.h> #include <gsl/gsl_sf_bessel.h> int main (void) { double x = 15.0; double y = gsl_sf_bessel_J0 (x); printf ("J0(%g) = %.18e/n", x, y); return 0; }
Second, compile and link the program with the following commands:
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${HOME}/tools/gsl-2.7.1/install/lib gcc -Wall -I${HOME}/tools/gsl-2.7.1/install/include -c example.c gcc -L${HOME}/tools/gsl-2.7.1/install/lib example.o -lgsl -lgslcblas -lm
Finally, run your program!