Open itcarroll opened 1 year ago
Current status is that I can verify the F2PY parts are all working by compiling with numpy.f2py
and a pip install -e .
As in ...
$ cd hello_f2py
$ python -m numpy.f2py -c hello.f90 _hello.pyf
...
$ cd ..
$ pip install -e .
$ pytest
The error above arises with pip wheel .
or pip install .
.
Adding set_target_properties(_f2py_runtime_library PROPERTIES POSITION_INDEPENDENT_CODE ON)
has silenced the error above.
On to an undefined symbols error at runtime ...
ImportError while importing test module '/home/icarroll/tmp/skb/projects/hello-f2py/tests/test_hello_f2py.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../../../miniconda3/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
tests/test_hello_f2py.py:1: in <module>
from hello_f2py import hello
venv/lib/python3.10/site-packages/hello_f2py/__init__.py:1: in <module>
from ._hello import hello
E ImportError: /home/icarroll/tmp/skb/projects/hello-f2py/venv/lib/python3.10/site-packages/hello_f2py/_hello.cpython-310-x86_64-linux-gnu.so: undefined symbol: hello_
Attempting to add a
hello-f2py
example to the scikit-build-sample-projects repository. Build is successful but linking fails: something about thelib_f2py_runtime_library.a
not getting built with the-fPIC
flag (I think).Paging @xoviat, creator of
add_f2py_target
, for advice if available 🙇.