[SciPy-User] numpy.distutils cross compile question
Wed Nov 7 02:26:14 CST 2012
On 11/03/2012 03:37 AM, Ralf Gommers wrote:
> On Tue, Oct 30, 2012 at 4:18 AM, Zhenfei Yuan <email@example.com
> <mailto:firstname.lastname@example.org>> 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
> "setup" function in "numpy.distutils.core" and will build a scipy sub
> package on my ubuntu 64 machine, with gfortran specified by the
> "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
> 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
> 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:
> SciPy-User mailing list
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User