-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
[f2py] BUG: missing Fortran modules in version 1.26.3 #25867
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 sta 8000 tement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@HaoZeke Thoughts? |
Thanks for the report @mancellin. The Can you please add build logs and/or tracebacks that allow us to diagnose the regression? |
Good point @rgommers, thank you. I guess the main divergence is when the following in 1.26.2:
becomes in 1.26.3:
I ran the following set NP_VERSION "1.26.2"
python -m venv /tmp/envs/capy_np$NP_VERSION
source /tmp/envs/capy_np$NP_VERSION/bin/activate.fish
python -m pip install numpy==$NP_VERSION charset_normalizer
mkdir -p /tmp/logs
meson setup --wipe /tmp/meson_build/capy_np$NP_VERSION/ > /tmp/logs/log_np$NP_VERSION 2>&1
meson compile -C /tmp/meson_build/capy_np$NP_VERSION >> /tmp/logs/log_np$NP_VERSION 2>>&1 and the full logs are |
Searching the log message on Github, I found numpy/numpy/f2py/f90mod_rules.py Lines 115 to 117 in e920ca4
and indeed the missing modules are the ones that are used by other modules and not containing only variables. I guess this is related to #25337 |
Thanks for the detailed report @mancellin, there is a fix for this on main, as part of #25337, and I know some of the patches have been left for 2.x |
Are there some kind of nightly builds somewhere or do I need to compile from source? |
There are nightlies at https://anaconda.org/scientific-python-nightly-wheels/numpy. Note that they're not ABI-compatible with 1.26, so if you need scipy/pandas/etc., you should also get those from https://anaconda.org/scientific-python-nightly-wheels. |
It seems that the behavior of the nightly Numpy build is the same as 1.26.3 and the 'used' Fortran modules are missing.
|
I'm confused by #25361, because the comment on the PR does not seem to match the code:
if m['name'] in usenames and not onlyvars: # Used module with functions
outmess(f"\t\t\tSkipping {m['name']} since it is in 'use'...\n")
continue # Skip |
I think that's the right place for a fix, though a better approach would be to only generate interfaces to symbols / routines marked as public (which your code does correctly and should be handled better in F2PY). |
BUG: Fix gh-25867 for used functions and subroutines
Describe the issue:
I have a Python+Fortran library built with meson-python and f2py.
Something in version 1.26.3 is causing
pip install --no-build-isolation .
to compile incomplete binary extension where some Fortran modules are missing. (The ones with a filename starting with a capital letter, coincidentally?)I browsed the list of commits but could not guess where the issue might come from. Do you have any clue?
The meson file: https://github.com/capytaine/capytaine/blob/df41fb23323f5b55ba4aed0c3f4667f86c25af11/meson.build
Reproduce the code example:
Error message:
No response
Python and NumPy Versions:
Python 3.11, Numpy 1.26.2 or 1.26.3
Runtime Environment:
No response
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: