[Numpy-discussion] Building on Windows

Lalo lapataia28-northern at yahoo.com
Thu May 11 11:52:04 EDT 2006


Hi,

I built on Cygwin using the detailed ATLAS+LAPACK build tutorial below. It's great, thanks!

My site.cfg is:

-------------------------------------------------
[DEFAULT]
library_dirs = /usr/lib:/usr/local/lib:/usr/lib/python2.4/config
include_dirs = /usr/include:/usr/local/include
search_static_first = 0

[atlas]
library_dirs = /usr/local/lib/atlas
# for overriding the names of the atlas libraries
atlas_libs = lapack, f77blas, cblas, atlas
-------------------------------------------------

However, I had to create the following link, not sure why it wouldn't find the library otherwise:

ln -s /usr/lib/python2.4/config/libpython2.4.dll.a /usr/lib/libpython2.4.dll.a

Hope this helps,
Lalo



----- Original Message ----
From: Stephan Tolksdorf <st at sigmasquared.net>
To: Albert Strasheim <fullung at gmail.com>
Cc: numpy-discussion <numpy-discussion at lists.sourceforge.net>
Sent: Wednesday, May 10, 2006 4:48:16 PM
Subject: Re: [Numpy-discussion] Building on Windows

Hi Albert,

in the following you find an abridged preview version of my 
MSVC+ATLAS+Lapack build tutorial ;-) You probably already know most of 
it, but maybe it helps.

You'll need a current Cygwin with g77 and MinGW-libraries installed.

Atlas:
======
Download and extract latest development ATLAS (3.7.11). Comment out line 
77 in Atlas/CONFIG/probe_SSE3.c. Run "make" and choose the appropriate 
options for your system. Don't activate posix threads (for now). 
Overwrite the compiler and linker flags with flags that include 
"-mno-cygwin". Use the default architecture settings. Atlas and the test 
suite hopefully compile without an error now.

Lapack:
=======
Download and extract www.netlib.org/lapack/lapack.tgz and apply the most 
current patch from www.netlib.org/lapack-dev/
Replace lapack/make.inc with lapack/INSTALL/make.inc.LINUX. Append 
"-mno-cygwin" to OPTS, NOOPT and LOADOPTS in make.inc. Add
".PHONY: install testing timing" as the last line to lapack/Makefile.
Run "make install lib" in the lapack root directory in Cygwin.  ("make 
testing timing" and should also work now, but you probably want to use 
your optimised BLAS for that. Some errors in the tests are to be expected.)

Atlas + Lapack:
===============
Copy the generated lapack_LINUX.a together with "libatlas.a", 
"libcblas.a", "libf77blas.a", "liblapack.a" into a convenient directory.

In Cygwin execute the following command sequence in that directory to 
get an ATLAS-optimized LAPACK library
"ar x liblapack.a
ar r lapack_LINUX.a *.o
rm *.o
mv lapack_LINUX.a liblapack.a"

Now make a copy of all lib*.a's to *.lib's, i.e. duplicate libatlas.a to 
atlas.lib, in order to allow distutils to recognize the libs and at the 
same time provide the correct versions for MSVC.

Copy libg2c.a and libgcc.a from cygwin/lib/gcc/i686-pc-mingw32/3.4.4 to 
this directory and again make .lib copies.

Compile and install numpy:
==========================

Put
"[atlas]
library_dirs =  d:\path\to\your\BlasDirectory
atlas_libs = lapack,f77blas,cblas,atlas,g2c,gcc"
into your site.cfg in the numpy root directory.

Open an Visual Studio 2003 command prompt and run
"Path\To\Python.exe setup.py config --compiler=msvc build 
--compiler=msvc bdist_wininst".
Use the resulting dist/numpy-VERSION.exe installer to install Numpy.

Testing:
In a Python console run
import numpy.testing
numpy.testing.NumpyTest(numpy).run()
... hopefully without an error. Test your code base.

I'll wikify an extended version in the next days.

Stephan


Albert Strasheim wrote:
> Hello all,
> 
> It seems that many people are building on Windows without problems, except
> for Stephan and myself.
> 
> Let me start by staying that yes, the default build on Windows with MinGW
> and Visual Studio works nicely.
> 
> However, is anybody building with ATLAS and finding that experience to be
> equally painless? If so, *please* can you tell me how you've organized your
> libraries (which libraries? CLAPACK? FLAPACK? .a? .lib? What about ATLAS's
> LAPACK functions? What about building ATLAS as DLL?). Also, I'd be very
> interested in the contents of your site.cfg.  I've been trying for many
> weeks to do some small subset of the above without hacking into the core of
> numpy.distutils. So far, no luck.
> 
> Does anybody do debug builds on Windows? Again, please tell me how you do
> this, because I would really like to be able to build a debug version of
> NumPy for debugging with the MSVS compiler.
> 
> As for compiler warnings, last time I checked, distutils seems to be
> suppressing the output from the compiler, except when the build actually
> fails. Or am I mistaken?
> 
> Eagerly awaiting Windows build nirvana,
> 
> Albert
> 
>> -----Original Message-----
>> From: numpy-discussion-admin at lists.sourceforge.net [mailto:numpy-
>> discussion-admin at lists.sourceforge.net] On Behalf Of Tim Hochberg
>> Sent: 10 May 2006 23:49
>> To: Travis Oliphant
>> Cc: Stephan Tolksdorf; numpy-discussion
>> Subject: Re: [Numpy-discussion] Building on Windows
>>
>> Travis Oliphant wrote:
>>
>>> Stephan Tolksdorf wrote:
>>>
>>>> Hi,
>>>>
>>>> there are still some (mostly minor) problems with the Windows build
>>>> of Numpy (MinGW/Cygwin/MSVC). I'd be happy to produce patches and
>>>> documentation enhancements, but before doing so I'd like to know if
>>>> there's interest from one of the core developers to review/commit
>>>> these patches afterwards. I'm asking because in the past questions
>>>> and suggestions regarding the building process of Numpy (especially
>>>> on Windows) often remained unanswered on this list. I realise that
>>>> many developers don't use Windows and that the distutils build is a
>>>> complex beast, but the current situation seems a bit unsatisfactory
>>>> - and I would like to help.
>>> I think your assessment is a bit harsh.   I regularly build on MinGW
>>> so I know it works there (at least at release time).   I also have
>>> applied several patches with the express purpose of getting the build
>>> working on MSVC and Cygwin.
>>>
>>> So, go ahead and let us know what problems you are having.   You are
>>> correct that my main build platform is not Windows, but I think
>>> several other people do use Windows regularly and we definitely want
>>> to support it.
>>>
>> Indeeed. I build from SVN at least once a week using MSVC and it's been
>> compiling warning free and passing all tests for me for some time.
>>
>> -tim
> 
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
> 
> 



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060511/e4bcf416/attachment.html>


More information about the NumPy-Discussion mailing list