On 10/24/2020 8:31 AM Pauli Virtanen <p...@iki.fi> wrote:


la, 2020-10-24 kello 03:11 -0400, Dustin Spicuzza kirjoitti:
Cross-compiling scipy and other projects that depend on numpy's
distutils is a huge pain right now, because to do it [in addition to
lots of other details that you have to get right] you have to have
both
a native and cross-compiled version of numpy installed. It seems
pretty
unreasonable that I need a native version of numpy installed to
compile
scipy. One might ask, why is this needed?
Factoring out numpy.distutils from numpy alone will not enable
compiling scipy without numpy being installed. It probably can help,
though, and might make sense also in view of the incoming deprecation
of Python distutils (https://www.python.org/dev/peps/pep-0632/).

Extension modules, including f2py, need numpy headers and probably also
their platform-specific configuration. There are also some assumptions
about data type sizes and Numpy versions at build-time being compatible
with the ones at runtime, which factoring out distutils won't address.
IIUC, cross-compilation is not actually supported, so that it can be
made to work is surprising.

Yes, as I said, there's a lot of little details that have to be correct for cross-compiling to work, but making numpy.distutils a separate toplevel will simplify other aspects of the process.

For those interested, the crossenv project (https://github.com/benfogle/crossenv) takes care of a lot of those other details pretty well. I posted my steps for cross-compiling numpy/scipy utilizing crossenv at https://github.com/scipy/scipy/issues/8571#issuecomment-715877299

Since this initial feedback seems mostly positive, I'll go ahead and take a stab at refactoring it and make a PR potentially this weekend. It should be fairly straightforward.

Dustin
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to