I want to include the GSL files in a cython program I want to build using "conda build packagename". To connect GNU GSL files with Python I am using the cython_gsl package (https://github.com/twiecki/CythonGSL). However, this requires the GSL files to be installed on each OS. Looking at the init.py file of cython_gsl, the folder which should be passed to the .pyx file is:
Windows: c:\Program Files\GnuWin32\include
OSX/Linux: os.popen('gsl-config --cflags').read()[2:-1]
Can I include downloading and installing the GSL header in the shell/batch files, so this is done automatically through "conda install packagename"?
Thank you for your help.
Also, if it is not possible, is their a python module which downloads GSL files AND allows easy connections for cython builds?
I don't think there is a Python module which downloads GSL files. In GNU/Linux, you can usually use your system package manager to install gsl library with the devel headers. For example, in openSUSE,
and you are done. You can install CythonGSL and it will recognize gsl and use it. (I assume it is similar in OSX.)
In Windows, it is a little bit more involved. CythonGSL will refer to
LIB_GSL
environmental variable for the location of gsl. (If it does not exist, then it will use the hard-codedC:\Program Files\GnuWin32\include
).Basically what you need to do is download gsl with devel headers from https://code.google.com/p/oscats/downloads/list, unpack it, create a environmental variable
LIB_GSL
with the location of the gsl installation, then add thebin
subdirectory of the installation to yourPATH
environmental variable.I have a blog post with detailed instructions: http://blog.joonro.net/en/posts/installing-gsl-and-cythongsl-in-windows.html