From bwHPC Wiki
Jump to: navigation, search

The main documentation is available via module help numlib/gsl on the cluster. Most software modules for applications provide working example batch scripts.

Description Content
module load numlib/gsl
License GNU General Public License (GPL)
M. Galassi et al., GNU Scientific Library Reference Manual (3rd Ed.), ISBN 0954612078.
Links Homepage | Documentation
Graphical Interface No

1 Description

The GNU Scientific Library (GSL) is a software library for numerical computations in applied mathematics and science. GSL is written in C, but bindings exist for other programming languages as well. The library provides a wide range of mathematical routines such as random number generators, special functions and least-squares fitting. There are over 1000 functions in total with an extensive test suite.

The complete range of subject areas covered by the library:

• Complex Numbers • Roots of Polynomials • Special Functions • Vectors and Matrices • Permutations • Sorting • BLAS Support • Linear Algebra • Eigensystems • Fast Fourier Transforms • Quadrature • Random Numbers • Quasi-Random Sequences • Random Distributions • Statistics • Histograms • N-Tuples • Monte Carlo Integration • Simulated Annealing • Differential Equations • Interpolation • Numerical Differentiation • Chebyshev Approximation • Series Acceleration • Discrete Hankel Transforms • Root-Finding • Minimization • Least-Squares Fitting • Physical Constants • IEEE Floating-Point • Discrete Wavelet Transforms • Basis splines • Running Statistics • Sparse Matrices and Linear Algebra

1.1 How to use GSL

A man page is available and can be accessed by typing

$ man gsl

1.1.1 Includes

Your source code should contain preprocessor include statements with a gsl/prefix such as

#include <gsl/gsl_math.h>

1.1.2 Compile

A typical compilation command for a source file 'example.c' using the Intel C compiler icc is

 $ icc -Wall -I$GSL_INC_DIR -c example.c 

The $GSL_INC_DIR environment variable points to the location of the include path for the GSL header files.

1.1.3 Link

The following command can be used to link the application with the GSL libraries:

 $ icc -L$GSL_LIB_DIR -o example example.o -lgsl -lgslcblas -lm 

The $GSL_LIB_DIR environment variable points to the location of the GSL libraries. Also make sure to have the GSL module loaded before running applications build with this library.

2 Useful links