-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: f2py and public API test compile failures for 1.26.0 on Python 3.12 #24750
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
I'm not sure how urgent this is for Fedora, but if it is blocking for now those can be skipped with a local patch, they're flaky since the shift to EDIT: From the log it seems (expected) that all the F2PY tests fail. The public API failure is unexpected. |
What's the best way to do that as the testsuite currently is? |
The easiest way would be to apply this patch: diff --git c/numpy/f2py/tests/test_compile_function.py i/numpy/f2py/tests/test_compile_function.py
index 3c16f3198..e38fed898 100644
--- c/numpy/f2py/tests/test_compile_function.py
+++ i/numpy/f2py/tests/test_compile_function.py
@@ -17,6 +17,10 @@ def setup_module():
pytest.skip("Needs C compiler")
if not util.has_f77_compiler():
pytest.skip("Needs FORTRAN 77 compiler")
+ if sys.version_info[:2] >= (3, 12):
+ pytest.skip(
+ "F2PY compilation tests do not work with meson."
+ )
# extra_args can be a list (since gh-11937) or string. |
I can't see the public API failure in the log (or the issue) clearly though, its truncated. Here is the complete error (from the linked 74259 │ if modnames:
74260 │ > raise AssertionError(f'Found unexpected modules: {modnames}')
74261 │ E AssertionError: Found unexpected modules: ['numpy.distutils', 'numpy.dis
│ tutils.armccompiler', 'numpy.distutils.ccompiler', 'numpy.distutils.ccompiler_opt',
│ 'numpy.distutils.command', 'numpy.distutils.command.autodist', 'numpy.distutils.comm
│ and.bdist_rpm', 'numpy.distutils.command.build', 'numpy.distutils.command.build_clib
│ ', 'numpy.distutils.command.build_ext', 'numpy.distutils.command.build_py', 'numpy.d
│ istutils.command.build_scripts', 'numpy.distutils.command.build_src', 'numpy.distuti
│ ls.command.config', 'numpy.distutils.command.config_compiler', 'numpy.distutils.comm
│ and.develop', 'numpy.distutils.command.egg_info', 'numpy.distutils.command.install',
│ 'numpy.distutils.command.install_clib', 'numpy.distutils.command.install_data', 'nu
│ mpy.distutils.command.install_headers', 'numpy.distutils.command.sdist', 'numpy.dist
│ utils.conv_template', 'numpy.distutils.core', 'numpy.distutils.cpuinfo', 'numpy.dist
│ utils.exec_command', 'numpy.distutils.extension', 'numpy.distutils.fcompiler', 'nump
│ y.distutils.fcompiler.absoft', 'numpy.distutils.fcompiler.arm', 'numpy.distutils.fco
│ mpiler.compaq', 'numpy.distutils.fcompiler.environment', 'numpy.distutils.fcompiler.
│ fujitsu', 'numpy.distutils.fcompiler.g95', 'numpy.distutils.fcompiler.gnu', 'numpy.d
│ istutils.fcompiler.hpux', 'numpy.distutils.fcompiler.ibm', 'numpy.distutils.fcompile
│ r.intel', 'numpy.distutils.fcompiler.lahey', 'numpy.distutils.fcompiler.mips', 'nump
│ y.distutils.fcompiler.nag', 'numpy.distutils.fcompiler.none', 'numpy.distutils.fcomp
│ iler.nv', 'numpy.distutils.fcompiler.pathf95', 'numpy.distutils.fcompiler.pg', 'nump
│ y.distutils.fcompiler.sun', 'numpy.distutils.fcompiler.vast', 'numpy.distutils.from_
│ template', 'numpy.distutils.fujitsuccompiler', 'numpy.distutils.intelccompiler', 'nu
│ mpy.distutils.lib2def', 'numpy.distutils.line_endings', 'numpy.distutils.log', 'nump
│ y.distutils.mingw32ccompiler', 'numpy.distutils.misc_util', 'numpy.distutils.msvc9co
│ mpiler', 'numpy.distutils.msvccompiler', 'numpy.distutils.npy_pkg_config', 'numpy.di
│ stutils.numpy_distribution', 'numpy.distutils.pathccompiler', 'numpy.distutils.syste
│ m_info', 'numpy.distutils.unixccompiler'] Which seems to suggest that there's something amiss with the source files since those modules should not be present on |
Could that be from the numpy installed on the system being used to build? |
Actually that might be it! Also most of the tests (except one) actually pass locally with 3.12 for |
We're not building with Meson yet, can we patch out that one too? |
That would be a question for @rgommers perhaps, but AFAIK |
It's not 100% gone yet, but likely will be. I can try meson. Is it possible without spin? It's not currently in Fedora but I can package it if needed. |
|
Assuming I can pass similar options to meson as to pip, since we don't build with internet access, can I specify the cflags and libs options separately, using the output of flexiblas-config? The values in the documented openblas.pc don't support everything we build for. |
|
This is interesting. meson.build:9:17: ERROR: Meson version is 1.2.1 but project requires >=1.2.99 Patching that to 1.2.1, then I get: meson_cpu/x86/meson.build:2:15: ERROR: Module "features" does not exist |
@limburgher |
Meson is installed from the Fedora RPM. |
Or maybe |
I take it you are compiling for Python 3.12? |
I think we should be packaging everything needed for building in the sdist, so since we require the vendored-meson submodule it should be packed into the sdist. |
It is part of the sdist. I think the only way this can go wrong is if a distro is trying to unvendor it - that will not work. Or if the user is trying to run
Rather than doing that, you want to do:
I believe Flexiblas provides plain See http://scipy.github.io/devdocs/building/blas_lapack.html#selecting-blas-and-lapack-libraries for docs. |
So I attempted: python -m build -Csetup-args=-Dblas=flexiblas -Csetup-args=-Dlapack=lapack Which ends with: Build targets in project: 101 NumPy 1.26.0 User defined options Found ninja-1.11.1 at /usr/bin/ninja
ERROR Backend subprocess exited when trying to invoke build_sdist |
Just to make sure: since Flexiblas provides LAPACK wrappers also, you may want
I think that means that you don't have a git clone, but a local sdist that you downloaded and unpacked? If not, I don't understand why Meson wouldn't recognize that it's in a git repo. I can reproduce your error by running |
Ok, I managed to make that work with our system. The only remaining issue is two test failures on s390x: |
Thanks @limburgher. Those failures look new, and related to the new
|
The first error should be fixed by #24772:
while the second one should be fixed by gh-24776 which is the back-port of #24479: ______________________ Test_SIMD_MODULE.test_truncate_f32 ______________________
self = <numpy.core.tests.test_simd_module.Test_SIMD_MODULE object at 0x3ff2e4e9bb0>
def test_truncate_f32(self):
> f32 = npyv.setall_f32(0.1)[0]
E AttributeError: module 'numpy.core._simd.VX' has no attribute 'setall_f32'. Did you mean: 'setall_s32'?
self = <numpy.core.tests.test_simd_module.Test_SIMD_MODULE object at 0x3ff2e4e9bb0>
../../../../BUILDROOT/numpy-1.26.0-1.fc40.s390x/usr/lib64/python3.12/site-packages/numpy/core/tests/test_simd_module.py:89: AttributeError |
So they do, thank you! |
Same problem, despite installing the latest version |
The Note that you cannot run a plain
|
@rgommers perfect, thanks! |
I had the same problem.
But then, how do I run tests?
|
No need to do the steps in your first 3 bullets @lorentzenchr. Just |
Even after |
This must be something like a too old version of |
It was an old version of spin. @rgommers Thanks for your super fast support! |
This commit performs the following actions: 1. Adds WASM builds to the CPU family for Meson configurations, but without SSE or SIMD instructions. 2. Removes CPU feature detection message for an unsupported architecture. 3. Enables `IEEE_QUAD_LE` longdouble format for the wasm32 target (cross-builds). 4. Enables run for Emscripten/Pyodide wheels by setting the `if:` condition to `true`. 5. Uses recursive submodules to ensure that vendored-meson is received. 6. Moves the Meson cross file to `tools/ci/emscripten/` (i.e., creates a separate Emscripten folder to store relevant files) 7. Adds a patch for vendored-meson detection for Pyodide and applies this Pyodide-meson patch in the Emscripten CI jobs 8. Builds wasm32 wheels without BLAS and LAPACK support (see numpy#24750 (comment)) 9. Forces coloured and prettified outputs for test runs Some of these changes have been copied with updates and suggestions received from numpy#24603 on 23/02/2024 and authorship is preserved with this commit. Co-Authored-By: Ralf Gommers <ralf.gommers@gmail.com>
This commit performs the following actions: 1. Adds WASM builds to the CPU family for Meson configurations, but without SSE or SIMD instructions. 2. Removes CPU feature detection message for an unsupported architecture. 3. Enables `IEEE_QUAD_LE` longdouble format for the wasm32 target (cross-builds). 4. Enables run for Emscripten/Pyodide wheels by setting the `if:` condition to `true`. 5. Uses recursive submodules to ensure that vendored-meson is received. 6. Moves the Meson cross file to `tools/ci/emscripten/` (i.e., creates a separate Emscripten folder to store relevant files) 7. Adds a patch for vendored-meson detection for Pyodide and applies this Pyodide-meson patch in the Emscripten CI jobs 8. Builds wasm32 wheels without BLAS and LAPACK support (see numpy#24750 (comment)) 9. Forces coloured and prettified outputs for test runs Some of these changes have been copied with updates and suggestions received from numpy#24603 on 23/02/2024 and authorship is preserved with this commit. Co-Authored-By: Ralf Gommers <ralf.gommers@gmail.com>
This commit performs the following actions: 1. Adds WASM builds to the CPU family for Meson configurations, but without SSE or SIMD instructions. 2. Removes CPU feature detection message for an unsupported architecture. 3. Enables `IEEE_QUAD_LE` longdouble format for the wasm32 target (cross-builds). 4. Enables run for Emscripten/Pyodide wheels by setting the `if:` condition to `true`. 5. Uses recursive submodules to ensure that vendored-meson is received. 6. Moves the Meson cross file to `tools/ci/emscripten/` (i.e., creates a separate Emscripten folder to store relevant files) 7. Adds a patch for vendored-meson detection for Pyodide and applies this Pyodide-meson patch in the Emscripten CI jobs 8. Builds wasm32 wheels without BLAS and LAPACK support (see numpy#24750 (comment)) 9. Forces coloured and prettified outputs for test runs Some of these changes have been copied with updates and suggestions received from numpy#24603 on 23/02/2024 and authorship is preserved with this commit. [skip cirrus] [skip circle] [skip azp] Co-Authored-By: Ralf Gommers <ralf.gommers@gmail.com>
This commit performs the following actions: 1. Adds WASM builds to the CPU family for Meson configurations, but without SSE or SIMD instructions. 2. Removes CPU feature detection message for an unsupported architecture. 3. Enables `IEEE_QUAD_LE` longdouble format for the wasm32 target (cross-builds). 4. Enables run for Emscripten/Pyodide wheels by setting the `if:` condition to `true`. 5. Uses recursive submodules to ensure that vendored-meson is received. 6. Moves the Meson cross file to `tools/ci/emscripten/` (i.e., creates a separate Emscripten folder to store relevant files) 7. Adds a patch for vendored-meson detection for Pyodide and applies this Pyodide-meson patch in the Emscripten CI jobs 8. Builds wasm32 wheels without BLAS and LAPACK support (see numpy#24750 (comment)) 9. Forces coloured and prettified outputs for test runs Some of these changes have been copied with updates and suggestions received from numpy#24603 on 23/02/2024 and authorship is preserved with this commit. [skip cirrus] [skip circle] [skip azp] Co-Authored-By: Ralf Gommers <ralf.gommers@gmail.com>
This commit performs the following actions: 1. Adds WASM builds to the CPU family for Meson configurations, but without SSE or SIMD instructions. 2. Enables `IEEE_QUAD_LE` longdouble format for the wasm32 target (cross-builds). 3. Enables run for Emscripten/Pyodide wheels by setting the `if:` condition to `true`. 4. Uses recursive submodules to ensure that vendored-meson is received. 5. Moves the Meson cross file to `tools/ci/emscripten/` (i.e., creates a separate Emscripten folder to store relevant files) 6. Adds a patch for vendored-meson detection for Pyodide and applies this Pyodide-meson patch in the Emscripten CI jobs 7. Builds wasm32 wheels without BLAS and LAPACK support (see numpy#24750 (comment)) 8. Forces coloured and prettified outputs for test runs Some of these changes have been copied with updates and suggestions received from numpy#24603 on 23/02/2024 and authorship is preserved with this commit. [skip cirrus] [skip circle] [skip azp] Co-Authored-By: Ralf Gommers <ralf.gommers@gmail.com> Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
Describe the issue:
Python 3.12 rc2
Numpy 1.26.0
build.log
The Fedora RPM build runs the test suite as part of the build. 6 tests fail:
FAILED ../../f2py/tests/test_compile_function.py::test_f2py_init_compile[extra_args0]
FAILED ../../f2py/tests/test_compile_function.py::test_f2py_init_compile[--noopt --debug]
FAILED ../../f2py/tests/test_compile_function.py::test_f2py_init_compile[] - ...
FAILED ../../f2py/tests/test_compile_function.py::test_compile_from_strings[program test_f2py\nend program test_f2py0]
FAILED ../../f2py/tests/test_compile_function.py::test_compile_from_strings[program test_f2py\nend program test_f2py1]
FAILED ../../tests/test_public_api.py::test_all_modules_are_expected - Assert...
6 failed, 34469 passed, 2339 skipped, 1305 deselected, 32 xfailed, 2 xpassed, 178 errors in 851.43s (0:14:11)
Reproduce the code example:
Error message:
No response
Runtime information:
See above
Context for the issue:
This impacts the update of Numpy in Fedora to support Python 3.12, which is the default in Fedora 39 and up.
The text was updated successfully, but these errors were encountered: