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'sdistutils is a huge pain right now, because to do it [in addition tolots of other details that you have to get right] you have to havebotha native and cross-compiled version of numpy installed. It seemsprettyunreasonable that I need a native version of numpy installed tocompilescipy. One might ask, why is this needed?Factoring out numpy.distutils from numpy alone will not enablecompiling scipy without numpy being installed. It probably can help,though, and might make sense also in view of the incoming deprecationof Python distutils (https://www.python.org/dev/peps/pep-0632/).
Extension modules, including f2py, need numpy headers and probably alsotheir platform-specific configuration. There are also some assumptionsabout data type sizes and Numpy versions at build-time being compatiblewith the ones at runtime, which factoring out distutils won't address.IIUC, cross-compilation is not actually supported, so that it can bemade 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