From d740da04881793cd9919c2c9b35016ba5a31342f Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Wed, 29 Jan 2025 11:49:20 +0100 Subject: [PATCH 1/2] Use dolfinx get_include to retrieve include path --- multiphenicsx/cpp/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/multiphenicsx/cpp/CMakeLists.txt b/multiphenicsx/cpp/CMakeLists.txt index a1b9ee8..aff0e9f 100644 --- a/multiphenicsx/cpp/CMakeLists.txt +++ b/multiphenicsx/cpp/CMakeLists.txt @@ -41,9 +41,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 From deb34496dc444c3de91d3963e529a3893b419b02 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Wed, 29 Jan 2025 11:51:43 +0100 Subject: [PATCH 2/2] Add warning info about possible absence of '--no-build-isolation' --- multiphenicsx/cpp/CMakeLists.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/multiphenicsx/cpp/CMakeLists.txt b/multiphenicsx/cpp/CMakeLists.txt index aff0e9f..de86042 100644 --- a/multiphenicsx/cpp/CMakeLists.txt +++ b/multiphenicsx/cpp/CMakeLists.txt @@ -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 @@ -51,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 @@ -67,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 @@ -82,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