I just got a similar email from someone using mingw/msys. He built
a dll (I always used a
static library). He had the same problem; but he solved it copying
gsl.dll into the
In my opinion gsl.dll should be installed in the %Systemroot%\system32\
is typically c:\windows\system32\.
I do not know if then the library has to use __stdcall instead of
Could you give it a try?
I confused names - the guide was not written by Brad Chapan, but by
Brian Gladman, and it is available over here:
however, I realized that trying to use libraries compiled with Visual
Studio 2010 against minGW might not work as well as I'd like, so I just
downloaded msys for minGW, and compiled the GSL with minGW using msys,
and that went smoothly.
After doing that, I obtained a 'normal' directory structure, and I was
able to build pyGSL fine, so the installation went well.
After the installation, I tried following the readme file directions
and changed to the /tests directory, and ran:
python run_test.py - and got the following message:
Did you try to import pygsl in the build directory?
Well, that does not work out of the box. If you want to do that, please
python setup.py build_ext -i
to add the necessary extension module in the local pygsl/ directory!
Please read the README first! Any further questions or missing
please post to email@example.com!
Traceback (most recent call last):
File "run_test.py", line 69, in <module>
File "run_test.py", line 47, in run
File "C:\Python27\lib\site-packages\pygsl\__init__.py", line 57, in
ImportError: DLL load failed: The specified module could not be found.
I wasn't in the directory, but I tried to fix it by doing:
python setup.py build_ext -i
as reccomanded, then repeating the command. This runs fine with no
errors/bugs, but doesn't fix the problem, I get the same error about
Is there a PATH file that is not set or what exactly is the DLL that
the program is failing to run?
On Wed, Mar 2, 2011 at 9:56 AM, Pierre
Congratulation... Compiling on windows is a story of itself ...
> After extensive googling, I managed to compile the GSL libraries
on windows using Visual Studio 2010 with Brad Chapman's excellent guide.
Please can you post a link to the guide you mention above?
Unfortunately I have not access to the compiler (and currently not even
windows machine) so I can only give you hints to success.
A first point: blanks separate arguments to commands in command line
parantheses, brackets, braces have special meanings. So these can create
extra headache if you have them in the name of the pathes; for a first
I would try to avoid them.
Further try to type the command that fails in the shell (using copy; if
you use the dos shell, set it to quick edit mode; it is still painfull,
the pain is a little less)
Better too much than too little info ... ;-)
The library resides in:
C:\Program Files (x86)\gsl-1.14
and the directory structure looks like this: (apologies about the spam)
Can you have a look,in these directories and look for the *.h files?
¦ ¦ +---Win32
¦ ¦ +---Debug
Are they there
Fine, but where did it put the include files? Is there a standard
The actual compiled directory files are here:
C:\Program Files (x86)\gsl-1.14\build.vc10\lib\Win32\Debug>dir
Volume in drive C is OS
Volume Serial Number is CA49-670D
Directory of C:\Program Files (x86)\gsl-1.14\build.vc10\lib\Win32\Debug
06/02/2011 17:10 <DIR> .
06/02/2011 17:10 <DIR> ..
06/02/2011 17:10 1,113,268 cblas.lib
06/02/2011 17:10 61,440 cblas.pdb
06/02/2011 17:10 17,849,866 gsl.lib
06/02/2011 17:10 266,240 gsl.pdb
4 File(s) 19,290,814 bytes
2 Dir(s) 172,105,408,512 bytes free
directory? The unix makes files of GSL include a link command to the
include directory, executed at the beginning of the build. What has
happend to them in your build?
So this is the way to write it for gcc:
Now - how do I set up the gsl_site.py file?
My best guess, was something like this:
# Some systems do not provide gsl-config. So here the locations can be
# by hand.
# The path to the directory where gsl is installed. Currently setup.py
# that the include files are located in "prefix/include".
prefix = os.path.join("C:\\", "Program Files (x86)", "gsl-1.14")
The flag -I is the way to specify a include directory (just to make
sure) -g is the debug flag
So I guess in your case it should be
cflags = "-g -I" + os.path.join(prefix, "include")
cflags = "/I" + os.path.join(prefix, "gslhdrs", "Win32", "Debug")
Use some find tool and search for the .h files in the source
Right. As stated above, try to find the directory of the header files.
building 'errno' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c
/MD /W3 /GS- /DNDEBUG -DSWIG_COBJECT_TYPES=1 -DGSL_RANGE_CHECK=1
ERIC=0 -DPYGSL_GSL_MAJOR_VERSION=1 -DPYGSL_GSL_MINOR_VERSION=14
rogram Files (x86)\gsl-1.14\include" -IInclude -I.
es\numpy\core\include -IC:\Python27\include -IC:\Python27\PC
Found executable C:\Program Files (x86)\Microsoft Visual Studio
cl : Command line warning D9025 : overriding '/DNDEBUG' with '/UNDEBUG'
src/init/errorno.c(6) : fatal error C1083: Cannot open include file:
rno.h': No such file or directory
error: Command "C:\Program Files (x86)\Microsoft Visual Studio
/c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSWIG_COBJECT_TYPES=1
-DDEBUG=1 -DNUMERIC=0 -DPYGSL_GSL_MAJOR_VERSION=1
-UNDEBUG -I"C:\Program Files (x86)\gsl-1.14\include" -IInclude -I.
with exit status 2
which obviously means the compilation fails to find gsl_erno.h
Then it should work. Please come back if it does not.
GSI Helmholtzzentrum für Schwerionenforschung GmbH
Gesellschaft mit beschränkter Haftung
Sitz der Gesellschaft: Darmstadt
Handelsregister: Amtsgericht Darmstadt, HRB 1528
Geschäftsführung: Professor Dr. Dr. h.c. Horst Stöcker, Dr. Hartmut Eickhoff
Vorsitzende des Aufsichtsrates: Dr. Beatrix Vierkorn-Rudolph
Stellvertreter: Ministerialdirigent Dr. Rolf Bernhardt