[SciPy-User] numpy.distutils cross compile question
Fri Nov 2 21:44:28 CDT 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
It confused me for some time, and I found a win machine and compiled on
it with mingw32. Thanks very much, Ralf.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User