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

Add possible resolution to CMake error and use dolfinx.get_include #44

Merged
merged 2 commits into from
Jan 29, 2025
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
24 changes: 17 additions & 7 deletions multiphenicsx/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ if(NOT NANOBIND_CMAKE_DIR_COMMAND_RESULT)
find_package(nanobind CONFIG REQUIRED)
message(STATUS "Found nanobind python wrappers at ${NANOBIND_CMAKE_DIR}")
else()
message(FATAL_ERROR "nanobind could not be found.")
message(
FATAL_ERROR
"nanobind could not be found. Possibly caused by running without '--no-build-isolation'."
)
endif()

# Check for DOLFINx C++ backend
Expand All @@ -41,9 +44,7 @@ endif()

# Check for DOLFINx python wrappers
execute_process(
COMMAND
${Python_EXECUTABLE} -c
"import os, sys, dolfinx; print(os.path.join(os.path.dirname(dolfinx.__file__), 'wrappers'))"
COMMAND ${Python_EXECUTABLE} -c "import dolfinx; print(dolfinx.get_include())"
OUTPUT_VARIABLE DOLFINX_PY_WRAPPERS_DIR
RESULT_VARIABLE DOLFINX_PY_WRAPPERS_COMMAND_RESULT
ERROR_VARIABLE DOLFINX_PY_WRAPPERS_COMMAND_ERROR
Expand All @@ -53,7 +54,10 @@ execute_process(
if(NOT DOLFINX_PY_WRAPPERS_COMMAND_RESULT)
message(STATUS "Found DOLFINx python wrappers at ${DOLFINX_PY_WRAPPERS_DIR}")
else()
message(FATAL_ERROR "DOLFINx python wrappers could not be found.")
message(
FATAL_ERROR
"DOLFINx python wrappers could not be found. Possibly caused by running without '--no-build-isolation'."
)
endif()

# Check for petsc4py
Expand All @@ -69,7 +73,10 @@ execute_process(
if(NOT PETSC4PY_INCLUDE_COMMAND_RESULT)
message(STATUS "Found petsc4py include directory at ${PETSC4PY_INCLUDE_DIR}")
else()
message(FATAL_ERROR "petsc4py could not be found.")
message(
FATAL_ERROR
"petsc4py could not be found. Possibly caused by running without '--no-build-isolation'."
)
endif()

# Check for mpi4py
Expand All @@ -84,7 +91,10 @@ execute_process(
if(NOT MPI4PY_INCLUDE_COMMAND_RESULT)
message(STATUS "Found mpi4py include directory at ${MPI4PY_INCLUDE_DIR}")
else()
message(FATAL_ERROR "mpi4py could not be found.")
message(
FATAL_ERROR
"mpi4py could not be found. Possibly caused by running without '--no-build-isolation'."
)
endif()

# Compile multiphenicsx C++ backend and nanobind wrappers
Expand Down
Loading