The ShARC HPC cluster was decommissioned on the 30th of November 2023 at 17:00. It is no longer possible for users to access that cluster.


The GNU Scientific Library (GSL) is a collection of routines for numerical computing. The routines have been written from scratch in C. See here for the types of routines that the GSL provides.


The GSL library can be loaded using either:

module load libs/gsl/2.4/gcc-6.2
module load libs/gsl/2.4/gcc-8.2


A example program that uses the GSL (taken from the GSL documentation):

#include <stdio.h>
#include <stdlib.h>
#include <gsl/gsl_sf_bessel.h>

int main (void) {
  double x = 5.0;
  double y = gsl_sf_bessel_J0(x);

  printf("J0(%g) = %.18e\n", x, y);

  return EXIT_SUCCESS;

Build this using:

gcc -Wall -lgsl -lgslcblas -o test test.c

Then run using:


which should print the following (correct to double-precision accuracy):

J0(5) = -1.775967713143382642e-01

NB generally, you may not need to compile using -lgslcblas depending on which GSL routines you are using.

Installation notes