-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BLD: avoid running run_command(py3, ...)
, for better cross-compiling
#18034
Conversation
Note that I've coded a custom dependency lookup for pybind11 (and made one PR to upstream to make |
Thanks @eli-schwartz, that's great. I did see your PR on the pybind11 repo. Seeing your upcoming Meson PR will also help me understand how that works better, so I can implement |
I can cross-build SciPy with Meson on Void Linux using (a roughly backported) version of these changes: ahesford/void-packages@5e5bae2. This seems like a straightforward way to solve the problem. |
That's great, thanks for testing @ahesford! |
This has been tested now, and since we need it also for conda-forge and it's going to take a while before I'll be able to add a new CI job for this, I think we should merge this as is now. |
@ahesford I was interested in the rest of how Void Linux specifies dependency information. I'm not sure I understand this completely:
Questions:
|
depends is, according to Manual.md, not installed for building at all. The build_helper does handle this though. A build_helper is loaded from the parent directory of this particular build_helper, which is https://github.com/void-linux/void-packages/blob/master/common/build-helper/numpy.sh It adds additional host/makedepends, and injects some CFLAGS/LDFLAGS. |
As @eli-schwartz notes, the The The XBPS does support virtual dependencies, but it's kind of hacky and difficult to control. (The biggest problem with XBPS virtuals is that it's possible to define a default provider for each virtual only in the build system; the package repository has no concept of a preferred default provider, so you will get whatever is listed first in the repository. Replacing virtuals with other providers also doesn't quite work right.) That isn't the mechanism at use here. Instead, note the line in $(vopt_if openblas openblas-devel lapack-devel) This function willl substitute |
Thanks a lot @ahesford and @eli-schwartz, very helpful! I'm trying to wrap my head around how this works across different distros, and figure out some cross compilation improvements that we can make in Python packaging land. I added Void Linux to a page on this topic at pypackaging-native/pypackaging-native#27. |
Adding the ability to specify the paths to the numpy, pybind11 and pythran include directories was discussed in scipygh-14812. Short of pkg-config files for these packages and/or builtin support for them in Meson, this is a decent solution.
06ef9ec
to
01c8273
Compare
This was reviewed and shown to solve the problem for Void Linux. I also need this for next steps, so I'll go ahead and self-merge it. |
Merge conflicts in |
Adding the ability to specify the paths to the numpy, pybind11 and pythran include directories was discussed in gh-14812. Short of pkg-config files for these packages and/or builtin support for them in Meson, this is a decent solution.
Closes gh-16783.
To do:
[ ] add a CI job for cross-compiling (probably Linux x86-64 -> aarch64)