[SciPy-User] numpy.distutils cross compile question

Zhenfei Yuan zfyuan at mail.ustc.edu.cn
Wed Nov 7 03:26:14 EST 2012


On 11/03/2012 03:37 AM, Ralf Gommers wrote:
>
>
>
> On Tue, Oct 30, 2012 at 4:18 AM, Zhenfei Yuan <zfyuan at mail.ustc.edu.cn 
> <mailto:zfyuan at mail.ustc.edu.cn>> 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 "i686-w64-mingw-32-gcc"
>     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
>
> Ralf
>
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
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 machine?

Thanks a lot, Ralf.

-- 
zfyuan <zfyuan at mail.ustc.edu.cn>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20121107/6b698724/attachment.html>


More information about the SciPy-User mailing list