[SciPy-User] numpy.distutils cross compile question
Fri Nov 9 06:53:20 CST 2012
On 11/09/2012 02:55 AM, Ralf Gommers wrote:
> On Wed, Nov 7, 2012 at 9:26 AM, Zhenfei Yuan <firstname.lastname@example.org
> <mailto:email@example.com>> wrote:
> On 11/03/2012 03:37 AM, Ralf Gommers wrote:
>> On Tue, Oct 30, 2012 at 4:18 AM, Zhenfei Yuan
>> <firstname.lastname@example.org <mailto:email@example.com>> wrote:
>> Dear all.
>> I've written a small package in my field containing
>> some pure
>> python scripts and fortran extension libraries. At first I
>> just use f2py
>> for the compiling work before importing these extensions into
>> python and
>> they all worked well. This time, I write a "setup.py" file
>> which import
>> "setup" function in "numpy.distutils.core" and will build a
>> scipy sub
>> package on my ubuntu 64 machine, with gfortran specified by
>> the command
>> "python setup.py build fgnu95", which works well.
>> My questions comes with the problem when I'd like to
>> build a win
>> 32/64 package. I think it concerns cross compiling, so I
>> installed mingw
>> compilers like "i686-w64-mingw32-gfortran" and
>> on my ubuntu 12.04. However I don't know how to write the
>> setup.py file
>> for cross compiling using numpy.distutils. I tried typing "python
>> setup.py" and specify fortran compiler by typing
>> "fi686-w64-mingw32-gfortran" for building, however it doesn't
>> work. So
>> I'm wondering whether I have to build this package on linux
>> 32, 64 bit
>> and win 32, 64 bit?
>> I don't think that will work. Even if the compilers would work,
>> distutils isn't flexible enough to pass the right flags to them.
>> If you want to build Windows binaries on Linux, you should use
>> install MinGW under Wine. Even that is a little painful, but
>> Ondrej Certik recently wrote some scripts to install everything
>> that's needed: https://github.com/certik/numpy-vendor
>> SciPy-User mailing list
>> SciPy-User@scipy.org <mailto:SciPy-User@scipy.org>
> Now I have some problem for creating a win64 package using
> mingw-w64 targeting for either win32 or win64 machine, maybe as
> you said that distutils isn't flexible enough, since I found that
> it could only accept some popular compilers but mingw-w64
> excluded. I wonder that can numpy-vendor do this work, or is there
> any other way? I have seen some unofficial win32 and win-amd64
> binaries, and I wonder how they make it. With msvc flag on win 64
> Indeed, with MSVC, Intel Fortran and Intel MKL typically. MinGW 64-bit
> isn't supported; there's no working 64-bit gfortran so you wouldn't be
> able to make Scipy work.
> SciPy-User mailing list
Both msvc and ifort on win are expensive. Maybe I should give up here.
Thanks a lot, Ralf.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User