Skip to content
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

Check if likely-to-be-used Numpy include directory is from virtual env #197

Merged
merged 1 commit into from
Aug 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,18 @@ message(STATUS "F2PY headers included from: ${F2PY_INCLUDE_DIRS}")
message(STATUS "LAPACK: ${LAPACK_LIBRARIES}")
message(STATUS "BLAS: ${BLAS_LIBRARIES}")

# https://github.com/python-control/Slycot/issues/193
if((EXISTS "${Python_INCLUDE_DIRS}/numpy")
AND (NOT ("${Python_INCLUDE_DIRS}/numpy" EQUAL "${Python_NumPy_INCLUDE_DIRS}")))

message(FATAL_ERROR
"Python include directory has a numpy sub-directory,
${Python_INCLUDE_DIRS}/numpy,
which is different from Numpy include directory
${Python_NumPy_INCLUDE_DIRS}.
You're probably building in a virtual environment, in which case
uninstall numpy from the base environment and try again.")

endif()

add_subdirectory(slycot)
Loading