-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Description
Describe the issue:
I am trying to call some fortran code using the f2py
wrappers in a recent mamba environment. When I attempt to call this, I get the following error (see below).
Would this issue be solved by adding meson
as a numpy
dependency? It seems a recent release is also available on conda-forge: https://anaconda.org/conda-forge/meson
NOTE: after adding meson
to a new environment, I managed to get a little further, although hit another error, that is now reported at mesonbuild/meson#14830
Reproduce the code example:
$ f2py -c --help-fcompiler
Error message:
(env) machine:~ user$ f2py -c --help-fcompiler
Cannot use distutils backend with Python>=3.12, using meson backend instead.
Using meson backend
Will pass --lower to f2py
See https://numpy.org/doc/stable/f2py/buildtools/meson.html
Reading fortran codes...
Post-processing...
Applying post-processing hooks...
character_backward_compatibility_hook
Post-processing (stage 2)...
Building modules...
Traceback (most recent call last):
File "~/miniforge3/envs/cmor3110xcd090/bin/f2py", line 10, in <module>
sys.exit(main())
~~~~^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/site-packages/numpy/f2py/f2py2e.py", line 781, in main
run_compile()
~~~~~~~~~~~^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/site-packages/numpy/f2py/f2py2e.py", line 753, in run_compile
builder.compile()
~~~~~~~~~~~~~~~^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/site-packages/numpy/f2py/_backends/_meson.py", line 192, in compile
self.run_meson(self.build_dir)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/site-packages/numpy/f2py/_backends/_meson.py", line 185, in run_meson
self._run_subprocess_command(setup_command, build_dir)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/site-packages/numpy/f2py/_backends/_meson.py", line 181, in _run_subprocess_command
subprocess.run(command, cwd=cwd, check=True)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/subprocess.py", line 554, in run
with Popen(*popenargs, **kwargs) as process:
~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/subprocess.py", line 1039, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pass_fds, cwd, env,
^^^^^^^^^^^^^^^^^^^
...<5 lines>...
gid, gids, uid, umask,
^^^^^^^^^^^^^^^^^^^^^^
start_new_session, process_group)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "~/miniforge3/envs/cmor3110xcd090/lib/python3.13/subprocess.py", line 1972, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'meson'
Python and NumPy Versions:
(env) machine:~ user$ python
Python 3.13.5 | packaged by conda-forge | (main, Jun 16 2025, 08:24:05) [Clang 18.1.8 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import numpy as np
print(np.version)
2.2.6
Runtime Environment:
import numpy as np
np.show_runtime()
[{'numpy_version': '2.2.6',
'python': '3.13.5 | packaged by conda-forge | (main, Jun 16 2025, 08:24:05) '
'[Clang 18.1.8 ]',
'uname': uname_result(system='Darwin', node='ml-9953350', release='24.5.0', version='Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000', machine='arm64')},
{'simd_extensions': {'baseline': ['NEON', 'NEON_FP16', 'NEON_VFPV4', 'ASIMD'],
'found': ['ASIMDHP'],
'not_found': ['ASIMDFHM']}},
{'architecture': 'VORTEX',
'filepath': '/Users/durack1/miniforge3/envs/cmor3110xcd091/lib/libopenblas.0.dylib',
'internal_api': 'openblas',
'num_threads': 10,
'prefix': 'libopenblas',
'threading_layer': 'openmp',
'user_api': 'blas',
'version': '0.3.30'},
{'filepath': '/Users/durack1/miniforge3/envs/cmor3110xcd091/lib/libomp.dylib',
'internal_api': 'openmp',
'num_threads': 10,
'prefix': 'libomp',
'user_api': 'openmp',
'version': None}]
Context for the issue:
When installing numpy through conda, the meson library dependency is not included