meson: Problems switching from numpy.distutils to meson
Describe the bug This is likely not a bug, but rather a lack of understanding on the correct procedures. I’ve been working on this on and off for a bit, and am now stuck and hoping for a bit of help or a shove in a useful direction.
My problem is that I can’t get meson to build my python-wrapped-legacy-fortran on Windows. This works on my local computer (OS X Big Sur). My access to Windows is only through GitHub Actions, and the latest failure can be seen here: https://github.com/aburrell/apexpy/runs/7048848662?check_suite_focus=true
It looks like the compiler isn’t finding the Python.h header. This header exists and meson.build can find it (see the meson build step). I am out of ideas on how to fix this. I also tried using miniconda, but that failed much earlier (in the build step, due to the binutils library version not being new enough to be used with meson and no newer library available).
To Reproduce You can check out the working branch at the public repository: https://github.com/aburrell/apexpy/tree/reorg_w_meson
Expected behavior Meson being able to build and install the code on Windows.
system parameters
- Is this a cross build or just a plain native build (for the same computer)? native build
- what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.): Microsoft Windows Server 2022
- what Python version are you using e.g. 3.8.0: Python 3.7.9
- what
meson --version
: meson 0.62.2 - what
ninja --version
if it’s a Ninja build: ninja 1.11.0
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (12 by maintainers)
I’m looking at a local patch for this, it reduces the number of build steps by 22 (down to 1551, which isn’t all that much in proportion).
EDIT: and there’s a 9-line warning it produces.
Yep, I think that’s the simplest way for now. I recommend copying https://github.com/scipy/scipy/blob/55fca818b49d5730c3cc77d012a593a910f3c03c/scipy/meson.build#L39-L52, and after that every extension module that uses
f2py
should have dependencies like https://github.com/scipy/scipy/blob/55fca818b49d5730c3cc77d012a593a910f3c03c/scipy/interpolate/meson.build#L142-L146Yes, we should do that in some form or another. This is tracked in gh-9598.
The install declarations aren’t quite correct yet either. Here’s a patch that demonstrates how to do it correctly: