Cython interface for the GNU Scientific Library (GSL).
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
cython_gsl functions are nogil Dec 23, 2016
examples Port nonlinear least-squares fitting (gsl/gsl_multifit_nlin.h). Jan 18, 2014
CHANGES.rst Bumped version to 0.2.1. Updated CHANGES. Nov 12, 2012
GPLv3.txt DOC: Added license information. Feb 1, 2012
LICENSE Added interface to MANIFEST. Nov 12, 2012
README.rst * like to GSL for Windows Mar 14, 2014 Bump version to 0.2.2 Feb 23, 2017 Bumped version to 0.2.1. Updated CHANGES. Nov 12, 2012 Bumped version to 0.2.1. Updated CHANGES. Nov 12, 2012



Date:May 13, 2012
Authors:Thomas Wiecki, thomas.wiecki[at]
Web site:
Copyright:This document has been placed in the public domain.
License:CythonGSL is released under the GPLv3.


CythonGSL provides a Cython interface for the GNU Scientific Library (GSL).

Cython is the ideal tool to speed up numerical computations by converting typed Python code to C and generating Python wrappers so that these compiled functions can be called from Python. Scientific programming often requires use of various numerical routines (e.g. numerical integration, optimization). While SciPy provides many of those tools, there is an overhead associated with using these functions within your Cython code. CythonGSL allows you to shave off that last layer by providing Cython declarations for the GSL which allow you to use this high-quality library from within Cython without any Python overhead.

Fork of PyrexGsl by Mario Pernici (


For a quick demo, see:

Import CythonGSL in your pyx file

In your cython file from which you want to call gsl routines, import gsl like this:

from cython_gsl cimport *

From there you should be able to call any gsl function, see for the GSL reference.

For more examples, check out the examples directory.

Compile your module

Here is what your could look like:

from distutils.core import setup
from Cython.Distutils import Extension
from Cython.Distutils import build_ext
import cython_gsl

    include_dirs = [cython_gsl.get_include()],
    cmdclass = {'build_ext': build_ext},
    ext_modules = [Extension("my_cython_script",



Installing CythonGSL

python build
python install

Installing CythonGSL Unittests

python build
python install
nosetest cython_gsl