Building external fortran dependencies using f2py #632
-
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
with a
when running
which results from the command |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 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.
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.