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
f2py fails to link program on windows using v1.26.0 - works on earlier versions of numpy #26352
Comments
Can you try again with numpy 1.26.4? Numpy 1.26.3 had a number of f2py-related fixes. |
Hi Nathan
Yes – certainly. I have updated to 1.26.4 and I get a different set of errors:-
```
(aov) C:\Users\keith\temp\fib_test>f2py -c fib1.f90 -m fib1 --backend meson
Using meson backend
Will pass --lower to f2py
See https://numpy.org/doc/stable/f2py/buildtools/meson.html
Reading fortran codes...
Reading file 'fib1.f90' (format:free)
Post-processing...
Block: fib1
Block: fib
In: :fib1:fib1.f90:fib
get_useparameters: no module iso_c_binding info used by fib
Applying post-processing hooks...
character_backward_compatibility_hook
Post-processing (stage 2)...
Building modules...
Building module "fib1"...
Generating possibly empty wrappers"
Maybe empty "fib1-f2pywrappers.f"
Constructing wrapper function "fib"...
a = fib(n)
Wrote C/API module "fib1" to file ".\fib1module.c"
The Meson build system
Version: 1.2.1
Source dir: C:\Users\keith\AppData\Local\Temp\tmpz_nfwcsm
Build dir: C:\Users\keith\AppData\Local\Temp\tmpz_nfwcsm\bbdir
Build type: native build
Project name: fib1
Project version: 0.1
Fortran compiler for the host machine: ifx (intel-llvm-cl 2022.1.0)
Fortran linker for the host machine: xilink.exe xilink 2022.1.0
C compiler for the host machine: cl (msvc 19.29.30146 "Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30146 for x64")
C linker for the host machine: link link 14.29.30146.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Traceback (most recent call last):
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\mesonmain.py", line 194, in run
return options.run_func(options)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\msetup.py", line 358, in run
app.generate()
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\msetup.py", line 183, in generate
return self._generate(env, capture, vslite_ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\msetup.py", line 228, in _generate
intr.run()
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreter\interpreter.py", line 2997, in run
super().run()
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 164, in run
self.evaluate_codeblock(self.ast, start=1)
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 190, in evaluate_codeblock
raise e
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 182, in evaluate_codeblock
self.evaluate_statement(cur)
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 198, in evaluate_statement
self.assignment(cur)
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 635, in assignment
value = self.evaluate_statement(node.value)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 200, in evaluate_statement
return self.method_call(cur)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\interpreterbase.py", line 550, in method_call
res = obj.method_call(method_name, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreter\interpreterobjects.py", line 811, in method_call
ret = method(state, args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 109, in wrapped
ret = f(*wrapped_args, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 277, in wrapper
return f(*nargs, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\interpreterbase\decorators.py", line 596, in wrapper
return f(*wrapped_args, **wrapped_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\modules\python.py", line 437, in find_installation
python = self._find_installation_impl(state, display_name, name_or_path, required)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\modules\python.py", line 393, in _find_installation_impl
if python.sanity(state):
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\modules\python.py", line 74, in sanity
ret = super().sanity()
^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\dependencies\python.py", line 116, in sanity
p, stdout, stderr = mesonlib.Popen_safe(cmd)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\utils\universal.py", line 1483, in Popen_safe
p, o, e = Popen_safe_legacy(args, write=write, stdin=stdin, stdout=stdout, stderr=stderr, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\mesonbuild\utils\universal.py", line 1505, in Popen_safe_legacy
p = subprocess.Popen(args, universal_newlines=False, close_fds=False,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\keith\anaconda3\envs\aov\Lib\subprocess.py", line 1538, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment.
Traceback (most recent call last):
File "C:\Users\keith\anaconda3\envs\aov\Scripts\f2py-script.py", line 10, in <module>
sys.exit(main())
^^^^^^
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\numpy\f2py\f2py2e.py", line 766, in main
run_compile()
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\numpy\f2py\f2py2e.py", line 738, in run_compile
builder.compile()
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\numpy\f2py\_backends\_meson.py", line 178, in compile
self.run_meson(self.build_dir)
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\numpy\f2py\_backends\_meson.py", line 171, in run_meson
self._run_subprocess_command(setup_command, build_dir)
File "C:\Users\keith\anaconda3\envs\aov\Lib\site-packages\numpy\f2py\_backends\_meson.py", line 167, in _run_subprocess_command
subprocess.run(command, cwd=cwd, check=True)
File "C:\Users\keith\anaconda3\envs\aov\Lib\subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['meson', 'setup', 'bbdir']' returned non-zero exit status 2.
```
Regards
keith
EDIT (seberg): tied to fix formatting, but emails just disable any markdown stuff, so can only remove the spurious newlines...
|
@HaoZeke Thoughts? |
Hi C:\Users\keith\temp\fib_test>f2py -c fib1.f90 -m fib1 --backend meson ERROR: Unhandled python OSError. This is probably not a Meson bug, but an issue with your build environment. |
Describe the issue:
I have an old fortran program that I access from python using f2py. I have used this successfully on both linux and windows. I have moved successfully to 1.26 on linux but get a link error (1120 unresolved externals) on windows 11. I replicated the problem using a basic fibonacci fortran program (below)
Reproduce the code example:
Error message:
Python and NumPy Versions:
python 3.12.3
Numpy 1.26.0
Runtime Environment:
(aov) C:\Users\keith\temp\fib_test>python -c "import numpy; print(numpy.show_runtime())"
[{'numpy_version': '1.26.0',
'python': '3.12.3 | packaged by Anaconda, Inc. | (main, Apr 19 2024, '
'16:41:55) [MSC v.1916 64 bit (AMD64)]',
'uname': uname_result(system='Windows', node='LENNY2', release='11', version='10.0.22631', machine='AMD64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}},
{'filepath': 'C:\Users\keith\anaconda3\envs\aov\Library\bin\mkl_rt.2.dll',
'internal_api': 'mkl',
'num_threads': 8,
'prefix': 'mkl_rt',
'threading_layer': 'intel',
'user_api': 'blas',
'version': '2023.1-Product'}]
None
Context for the issue:
A user has upgraded to python 3.12 and cannot use our product
The text was updated successfully, but these errors were encountered: