Open P-Kaempf opened 1 month ago
Running into the same issue here. Our CI (which tests against a Fortran reference code) has been broken since NumPy 2.0.
@HaoZeke Ping.
Until a fix comes around, you can always add some bogus executable statements to the assignment module. They do not even need to be reachable. Worked fine for me.
Describe the issue:
Take this F90 module:
When compiled with f2py 2.0.1 and included as "f_test" in a Python script, this:
will cause this error message:
Reproduce the code example:
Error message:
Python and NumPy Versions:
Python 3.12.4 numpy 2.0.1 Fortran compiler for the host machine: gfortran (gcc 14.1.0 "GNU Fortran (Homebrew GCC 14.1.0_2) 14.1.0") Fortran linker for the host machine: gfortran ld64 1053.12 C compiler for the host machine: cc (clang 15.0.0 "Apple clang version 15.0.0 (clang-1500.3.9.4)") C linker for the host machine: cc ld64 1053.12 Host machine cpu family: aarch64 Host machine cpu: aarch64
Runtime Environment:
Python 3.12.4 (main, Jun 6 2024, 18:26:44) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin Type "help", "copyright", "credits" or "license" for more information.
Context for the issue:
Code which ran fine in numpy 1.26 fails to run in numpy 2.0.1. A simple if ugly workaround is to add some executable code within the module. Only then will it become visible in Python, including all the assigned variables..