Skip to content

Commit 5ad5096

Browse files
committed
🐛 fix f2py build error with numpy headers not being found by cmake
1 parent 777f3f1 commit 5ad5096

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

projects/pi-fortran/CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ find_package(PythonInterp REQUIRED)
66
find_package(PythonLibs)
77
find_package(PythonExtensions REQUIRED)
88

9+
#NumPy headers
10+
execute_process(
11+
COMMAND "${PYTHON_EXECUTABLE}"
12+
-c "import numpy; print(numpy.get_include())"
13+
OUTPUT_VARIABLE NumPy_INCLUDE_DIRS
14+
OUTPUT_STRIP_TRAILING_WHITESPACE
15+
)
16+
917
# F2PY headers
1018
execute_process(
1119
COMMAND "${PYTHON_EXECUTABLE}"

0 commit comments

Comments
 (0)