[Numpy-discussion] System_info options for setup.py

Albert Strasheim fullung at gmail.com
Thu May 4 14:11:08 EDT 2006


Hello Stephan

> -----Original Message-----
> From: numpy-discussion-admin at lists.sourceforge.net [mailto:numpy-
> discussion-admin at lists.sourceforge.net] On Behalf Of Stephan Tolksdorf
> Sent: 04 May 2006 21:13
> To: numpy-discussion at lists.sourceforge.net
> Subject: [Numpy-discussion] System_info options for setup.py
> 
> Hi,
> 
> is there any information besides scipy.org/FAQ and
> Installing_SciPy/Windows on building NumPy (on Windows)?
> 
> Is there any documentation of the various system_info options
> configurable in site.cfg other than (the uncommented) system_info.py?
> More specifically, what do the various BLAS/LAPACK options stand for?
> Should I use atlas or blas_opt/lapack_opt? Is amd an option to directly
> support ACML?
> Can I build NumPy with BLAS only, without LAPACK?
> It should be possible to combine ATLAS/LAPACK compiled with GCC/G77 and
> Numpy with Visual C++, right?

I can confirm that this is possible. However, I noticed that my system is
actually performing really badly with NumPy built in this way, so something
probably went awry somewhere in my build. I'm investigating the issue.

Anyway, the build goes something like this:

Build ATLAS with GCC/G77. This is described in the ATLAS FAQ. Build FLAPACK
from sources. To do this, I used NumPy lapack_src option. When the build
crashes due to too many open files, restart it. Hopefully you'll get a
liblapack.a out here somewhere. Throw this somewhere with your ATLAS libs.

Rename libatlas.a to atlas.lib, etc. and in site.cfg in
numpy/numpy/distutils put the following:

[atlas]
library_dirs = C:\home\albert\work2\ATLAS\lib\WinNT_P4SSE2
atlas_libs = lapack, f77blas, cblas, atlas, g2c

This LAPACK library is the complete LAPACK library. ATLAS provides some
LAPACK functions. To use these instead of the ones in FLAPACK, use ar x to
unpack the object files from the (tiny) LAPACK library made by ATLAS and ar
r to pack them pack into the complete LAPACK library.
 
You need to grab libg2c.a from a Cygwin or MinGW install if I remember
correctly. Now build with something like this:

copy site.cfg c:\home\albert\work2\numpy\numpy\distutils
cd /d "c:\home\albert\work2\numpy"
del /f /s /q build
del /f /s /q dist
del /f /s /q numpy\core\__svn_version__.py
del /f /s /q numpy\f2py\__svn_version__.py
python setup.py config --compiler=msvc build --compiler=msvc bdist_wininst

I also tried building with CLAPACK but this effort ended in tears. I'll try
it again another day. If you want to try, you need to build libI77, libF77
and the LAPACK library using the solution files provided on the netlib site.
You might also need to add blaswr.c (might be cblaswr.c, included with the
CLAPACK sources) in there somewhere to get CLAPACK to call ATLAS BLAS.

Other things I've noticed is that you can reasonably link against
GCC-compiled libraries with MSVC, but using MSVC libraries with GCC can
cause link or other problems. Also, GCC-compiled code can't be debugged with
the MSVC debugger as far as I can tell

If anybody else has some suggestions for easing this process, I'd love to
hear from you.

Regards,

Albert





More information about the NumPy-Discussion mailing list