[Numpy-discussion] Windows Build with optimized libraries

Albert Strasheim fullung at gmail.com
Sat Feb 25 07:03:01 EST 2006

Hello all

I've got the latest NumPy from SVN building with optimized ATLAS 3.7.11 and
CLAPACK on Windows. I've also replaced the CLAPACK functions that are
provided by ATLAS with the ATLAS ones.
The current page on building with Windows:


doesn't have instructions to do this, so I'd like to add info on building
with MinGW, Visual Studio .NET 2003, Visual C++ Toolkit 2003 and Visual C++
2005 Express Edition (if I can figure out how to make distutils detect
Visual C++ 2005).

I had to change the build scripts in a few places to get things to work.
I've attached the patch if someone is interested in committing it to SVN.

Briefly, I did the following:

1. Built ATLAS 3.7.11 with Cygwin.

I copied libatlas.a as atlas.lib and libcblas.a as cblas.lib to some
directory, say c:\tmp\numpylibs.

2. Built CLAPACK 3.0 for Windows with Visual Studio .NET 2003.

I added cblaswr.c to clapack.lib and disabled building of the other
projects, except for libI77 and libF77. I also changed the project
properties of these three projects to use SSE2 instructions (under C/C++ |
Code Generation | Enable Enhanced Instruction Set). I don't know if this
makes much difference though (anybody have some benchmarks?).

3. I then took release builds of clapack.lib, libF77.lib and libI77.lib and
rolled them together with ATLAS's liblapack.a:

cp clapack.lib lapack.lib
ar x liblapack.a
mkdir Release
ar x libI77.lib
ar x libF77.lib
ar r lapack.lib Release/*.obj *.o

This adds the symbols from libI77 and libF77 to the library and replaces any
existing symbols with the symbols from the ATLAS LAPACK library.

I copied this lapack.lib to c:\tmp\numpylibs.

4. I created the file numpy\numpy\distutils\site.cfg with contents:

library_dirs = c:\tmp\numpylibs
atlas_libs = cblas,atlas
library_dirs = c:\tmp\numpylibs
lapack_libs = lapack

5.1. Visual Studio: python setup.py bdist_wininst

5.2. MinGW: python setup.py config --compiler=mingw32 build
--compiler=mingw32 bdist_wininst

That's it. The build generated a shiny numpy-

A quick question: it seems that NumPy can also use FFTW 2.1.5 to speed up
its FFT functions. Is this the case? If so, I'll take a look at building
FFTW 2.1.5 on Windows too. fftw.org's links to solution files for 2.1.3 are
broken, so I'll probably have to make new ones.

Hope this helps.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy-windowsbuild.diff
Type: application/octet-stream
Size: 2117 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060225/543c2514/attachment.obj>

More information about the NumPy-Discussion mailing list