-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: f2py (meson): undefined symbol error when building MPI-enabled extension (--dep mpi not working as expected) #28902
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
Comments
Thanks for the clear report @elcorto. This looks like a limitation of the current CLI interface numpy/numpy/f2py/_backends/_meson.py Lines 84 to 87 in 00f2733
Probably the way to address this is making Of course the CLI interface is going to remain limited compared to writing one's own build files (see https://numpy.org/devdocs/f2py/buildtools/meson.html), but this does feel like too much of a limitation - if we offer |
Thanks for the quick answer. In the context of In cases that require more customization of the build, the suggested workflow here seems to be writing |
I don't think so.
That's a nice suggestion. It's pretty much all implemented already - just requires a new CLI flag I'd think. |
Describe the issue:
When building an extension, I see the same error as in #25159 (
undefined symbol mpi_comm_rank_
), but in that issue the OP seems to use the distutils backend, hence a new issue here for the meson backend (and a work around, see below). The code below uses OpenMPI 4.1.4.Reproduce the code example:
Error message:
Python and NumPy Versions:
Runtime Environment:
Context for the issue:
The error occurs because the extension is not linked against MPI libs. Even though we use
FC=mpifort
, the compiler wrapper is (maybe?) not used.The
meson_builddir/meson.build
file looks like this, and saysdependency('mpi')
:According to the
meson
docs, the MPI dependency should be specified asdependency('mpi', language: 'fortran')
. With this change, things work:Build logs are attatched.
log_fail.txt
log_ok.txt
The text was updated successfully, but these errors were encountered: