[SciPy-user] compiling on Windows: getting closer

Brett G. Olivier bgoli at sun.ac.za
Mon Jan 5 22:56:23 CST 2004


I have also been trying to compile scipy under windows using MinGW and
experienced similar problems. However, inspired by this thread, I seem to
have found a way that works with my set up. I've included build
environment details at the end of this message.

Here is the procedure I followed:

++++++++ Compiling scipy on windows ++++++++++++

First, I uncomment the ignore packages bit in setup.py to not build sparse
and chaco and set up the atlas path. Then try to build with:

python setup.py build --compiler=mingw32

This fails with the compiler error as discussed in this thread:

"Lib\special\specfun\specfun.f:1513: internal compiler error: in
at reg-stack.c:987"

Some preliminary investigation has revealed that the -O2 and -O3 flag
seems to cause the compiler error when building specfun.f so I go to
Lib\special\specfun and build specfun.f without optimization (removing the
offending functions allows a successful compile but leads to many scary
link errors later on). I just used the setup compile call without the -O3

g77 -Wall -fno-second-underscore -funroll-loops -march=pentium3
-malign-double -fomit-frame-pointer -c specfun.f -o specfun.o

this built a specfun.o which I copied to: build\temp.win32-2.3

rebuild: python setup.py build --compiler=mingw32

specfun.f should now build but setup fails with:

"g -shared build\temp.win32-2.3\Release\lib\cluster\src\vq_wrap.o
-Lc:\python23\libs -Lc:\python23\PCBuild -Lbuild\temp.win32-2.3 -lpython23
-lrootfind -lc_misc -lcephes -o build\lib.win32-2.3\scipy\cluster\_vq.pyd
error: command 'g' failed: No such file or directory"

I am still trying to find where this call is made to patch, but in the
meantime I went to the mingw\bin directory (in my case c:\mingw\bin) and

copied g++.exe to g.exe

rebuild: python setup.py build --compiler=mingw32

Scipy should now build to completion.

install: python setup.py build --compiler=mingw32 install


I'm sure there is a better way of doing this but I managed to get a
working installation, which (after running them a few times) passed all
the scipy.test() tests. I'll try this with the latest cvs snapshot
sometime soon.

My evironment is win2000, Python 2.3, mingw 3.1 plus latest updates (uses
gcc 3.3.1), Atlas 3.6.0 built with cygwin (gcc 3.3.1). A relatively recent
f2py cvs version, Numeric 23.1 built with mingw and scipy cvs version

Hope this helps a bit

>> Could you try to find a work around to this compiler bug?
>> Or just comment the offending function in specfun.f out in
>> order to complete scipy completion.
>> Pearu
> Compiling on Windows, continued.
> I short-circuited the functions in specfun.f that were causing problems.
> Those functions are RMN2L and ASWFB, the radial and angular prolate and
> oblate spherical functions of the first kind.
> Hopefully, I've not created a land mine.  Now specfun.f compiles to
> completion.
> But I have a new problem, one that looks odd to my eye.  See below.  Is
> there a command called "g" ?
> BTW, if anyone can tell me that they've built scipy on Windows, and how
> they
> did it, please contact me.
> How did the Enthought people do it?
> -gary

Brett G. Olivier  (bgoli at sun.ac.za)

Biochemistry Dept, Stellenbosch University
Tel: +27 21 8085871    Fax: +27 21 8085863

More information about the SciPy-user mailing list