GSL - GNU Scientific Library


The GNU Scientific Library (GSL) is a numerical library for C and C++ programmers. It is free software under the GNU General Public License.

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 includes,

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

Unlike the licenses of proprietary numerical libraries the license of GSL does not restrict scientific cooperation. It allows you to share your programs freely with others.

Downloading GSL

The current stable version is GSL-2.6. It was released on 20 August 2019. Details of recent changes can be found in the NEWS file.

GSL can be found in the gsl subdirectory on your nearest GNU mirror

For other ways to obtain GSL, please read How to get GNU Software

Installation instructions can be found in the included README and INSTALL files.

Precompiled binary packages are included in most GNU/Linux distributions.

A compiled version of GSL is available as part of Cygwin on Windows.

Verifying GSL Signature

To verify the signature of the GSL tarball, please download both the gsl-X.Y.tar.gz and gsl-X.Y.tar.gz.sig files. The key used to sign the official releases can be found here.

The signature can be verified with the following steps:

gpg --import gsl_key.txt
gpg --verify gsl-X.Y.tar.gz.sig


GSL includes a reference manual in reStructuredText format. You can view the manual in HTML and PDF, or read it on your system using the shell command info gsl-ref (if the library is installed).

The GSL Reference Manual is available online,

The manual has been published as a printed book (under the GNU Free Documentation License), the latest edition is

GNU Scientific Library Reference Manual - Third Edition (January 2009),
M. Galassi et al, ISBN 0954612078 (paperback) RRP $39.95.

See for ordering information.

A Japanese translation is also available online (may not be the most recent version).

A Portuguese translation is also available online.


If you use and value GSL please consider a donation to help us improve the library.

Supported Platforms

GSL is developed on the following platform,

It has been reported to compile on the following other platforms,

Several people have contributed tools to allow GSL to be easily built on Windows platforms. More information can be found here.

We require that GSL should build on any UNIX-like system with an ANSI C compiler, so if doesn't, that's a bug and we would love a patch! The complete library should also pass "make check".

If you have found a bug, please report it to

Previously submitted bug reports can be found in the bug-gsl mailing list archives and the GSL bug database.

Mailing Lists

Follow the links to the individual mailing lists below to subscribe or view the list archives:

You can also follow announcements via the Savannah GSL RSS feed. RSS


Here are some of the main benefits of using a free scientific library under the GNU General Public License,

Special Features

The library uses an object-oriented design. Different algorithms can be plugged-in easily or changed at run-time without recompiling the program.

It is intended for ordinary scientific users. Anyone who knows some C programming will be able to start using the library straight-away.

The interface was designed to be simple to link into very high-level languages, such as GNU Guile or Python

The library is thread-safe.

Where possible the routines have been based on reliable public-domain Fortran packages such as FFTPACK and QUADPACK, which the developers of GSL have reimplemented in C with modern coding conventions.

The library is easy to compile and does not have any dependencies on other packages.


GSL is distributed under the terms of the GNU General Public License (GPL).

The reasons why the GNU Project uses the GPL are described in the following articles:

Additional information for researchers is available in the following article:

Some answers to common questions about the license:

If I write an application which uses GSL, am I forced to distribute that application?
No. The license gives you the option to distribute your application if you want to. You do not have to exercise this option in the license.

If I wanted to distribute an application which uses GSL, what license would I need to use?
The GNU General Public License (GPL).

The bottom line for commercial users:

GSL can be used internally ("in-house") without restriction, but only redistributed in other software that is under the GNU GPL.

More Information

If you would like to refer to the GNU Scientific Library in a journal article, the recommended way is to cite the reference manual, e.g. M. Galassi et al, GNU Scientific Library Reference Manual (3rd Ed.), ISBN 0954612078.

If you want to give a url, use "".

Related Packages

GSL requires a BLAS library for vector and matrix operations. The default CBLAS library supplied with GSL can be replaced by the tuned ATLAS library for better performance,

ATLAS is free software and its license is compatible with the GNU GPL.

Other packages that are useful for scientific computing are:

All these packages are free software (GNU GPL/LGPL).


GSL development is hosted on at

The repository is available via 'git' with

git clone git://

Note: if you use git, you will need automake, autoconf, libtool, GNU m4, GNU make, and GNU Texinfo (makeinfo).

To begin the build process from a checkout, start with: ./ which will prepare the package for compilation. You can then use ./configure --enable-maintainer-mode and make in the usual way.

Commit notifications are available through the git repository news feed.

In addition to the GSL Reference Manual, anyone wanting to work on the library should read the GSL design document,

GSL is a mature library with a stable API. The main emphasis is on ensuring the stability of the existing functions, tidying up and fixing any bugs that are reported, and adding new, useful algorithms which have been well tested and documented. Potential contributors are encouraged to gain familiarity with the library by investigating and fixing known problems in the BUGS database.

The project is always looking to introduce new capabilities and expand or improve existing functionality. To maintain stability, any new functionality is encouraged as packages, built on top of GSL and maintained independently by their authors, as in other free software projects. The design of GSL permits extensions to be used alongside the existing library easily by simple linking. Once a new extension is proven useful and stable, it can be incorporated into the main GSL repository.

Discussions about the development of the library take place on the mailing list. Any comments from experts in numerical analysis are welcome. You can subscribe to gsl-discuss here.

GSL is part of the GNU Project and so follows the GNU Coding Standards.


The following third-party packages provide extensions to GSL.

If you want to add a feature to GSL we recommend that you make it an extension first. We will list it here so that people can try it out. Extensions can be incorporated after they have been tested in real use (see "How to help" for more information).

Other packages:

Some applications using GSL that we know of:

Wrappers for Other Languages (not necessarily complete):


Project Background

The project was conceived in 1996 by Dr M. Galassi and Dr J. Theiler of Los Alamos National Laboratory.

They were joined by other physicists who also felt that the licenses of existing libraries were hindering scientific cooperation.

Most of the library has been written by a relatively small number of people with backgrounds in computational physics in order to provide a consistent and reasonably-designed framework.

Overall development of the library and the design and implementation of the major modules was carried out by Dr G. Jungman and Dr B. Gough. Modules were also written by Dr J. Davies, R. Priedhorsky, Dr M. Booth, Dr F. Rossi, and Dr P. Alken, along with many useful contributions from others in the user community. Debian packages for the library are maintained by Dr D. Eddelbuettel.

Release History

 [FSF logo]  “The Free Software Foundation (FSF) is a nonprofit with a worldwide mission to promote computer user freedom. We defend the rights of all software users.”