Building external fortran dependencies using f2py #632
Unanswered
KyleAcheson
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Pip uses "build isolation" by default. You need numpy as a build-system.requires, not just as an install-time dependency, because it needs to be available at build time to run f2py. You're currently missing that, though. The build isolation means even if you have a preinstalled copy of numpy, the build process doesn't see it -- it is built inside a fresh, empty virtualenv. Note: this isn't really specific to a build backend. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm having some trouble compiling fortran libraries with f2py. Using the simple example given by the numpy (https://numpy.org/doc/stable/f2py/buildtools/meson.html) meson.build file,
the code successfully builds,
However, building a python module that depends on the fortran module
fibby
using meson-python fails. Now I include the python modulefib.py
which contains,with a
pyproject.toml
file,when running
pip install .
I get the following error,which results from the command
/opt/miniconda3/bin/python -c 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'
inmeson.build
throwing an error that numpy does not exist despite it being installed and the fact that running this command in the terminal returns the path/home/kyle/.local/lib/python3.10/site-packages/numpy/core/include
. I am new to the meson-python backed and honestly have no idea how to debug this, any help would be great. I would eventually like to build a more complicated project that has many fortran dependencies and that can just be installed withpip install .
Beta Was this translation helpful? Give feedback.
All reactions