From 98907a460c3dfd0f98e0d1d1d099b350756cfa5e Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Mon, 13 Nov 2023 14:19:13 +0100 Subject: [PATCH 1/4] Export CMAKE_PREFIX_PATH in helper installation scripts --- cpp/cmake/templates/dolfinx.conf.in | 1 + docker/dolfinx-complex-mode | 1 + docker/dolfinx-real-mode | 1 + python/CMakeLists.txt | 4 ++-- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cpp/cmake/templates/dolfinx.conf.in b/cpp/cmake/templates/dolfinx.conf.in index 40f3869d2c5..02bd8e4f826 100644 --- a/cpp/cmake/templates/dolfinx.conf.in +++ b/cpp/cmake/templates/dolfinx.conf.in @@ -4,6 +4,7 @@ export @OS_LIBRARY_PATH_NAME@=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@:$@OS_LIBRARY_PATH_NAME@ export PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@:$PATH export PKG_CONFIG_PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig:$PKG_CONFIG_PATH +export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/cmake:$CMAKE_PREFIX_PATH # Special macOS variables export DYLD_FRAMEWORK_PATH=/opt/local/Library/Frameworks:$DYLD_FRAMEWORK_PATH diff --git a/docker/dolfinx-complex-mode b/docker/dolfinx-complex-mode index ea11b53598a..0cc581c18e6 100755 --- a/docker/dolfinx-complex-mode +++ b/docker/dolfinx-complex-mode @@ -1,6 +1,7 @@ #!/bin/bash PYV=`python3 -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)";` export PKG_CONFIG_PATH=/usr/local/dolfinx-complex/lib/pkgconfig:$PKG_CONFIG_PATH +export CMAKE_PREFIX_PATH=/usr/local/dolfinx-complex/lib/cmake:$CMAKE_PREFIX_PATH export PETSC_ARCH=linux-gnu-complex128-32 export PYTHONPATH=/usr/local/dolfinx-complex/lib/python$PYV/dist-packages:$PYTHONPATH export LD_LIBRARY_PATH=/usr/local/dolfinx-complex/lib:$LD_LIBRARY_PATH diff --git a/docker/dolfinx-real-mode b/docker/dolfinx-real-mode index 18601387058..21e09309dda 100755 --- a/docker/dolfinx-real-mode +++ b/docker/dolfinx-real-mode @@ -1,6 +1,7 @@ #!/bin/bash PYV=`python3 -c "import sys;t='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(t)";` export PKG_CONFIG_PATH=/usr/local/dolfinx-real/lib/pkgconfig:$PKG_CONFIG_PATH +export CMAKE_PREFIX_PATH=/usr/local/dolfinx-real/lib/cmake:$CMAKE_PREFIX_PATH export PETSC_ARCH=linux-gnu-real64-32 export PYTHONPATH=/usr/local/dolfinx-real/lib/python$PYV/dist-packages:$PYTHONPATH export LD_LIBRARY_PATH=/usr/local/dolfinx-real/lib:$LD_LIBRARY_PATH diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 51debb5be16..ed5f3d5b7a3 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -29,15 +29,15 @@ execute_process( ERROR_VARIABLE BASIX_ERROR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE ) find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) +message(STATUS "Found Basix at ${BASIX_DIR}") find_package(DOLFINX REQUIRED CONFIG) +message(STATUS "Found DOLFINx at ${DOLFINX_DIR}") # Create the binding library nanobind handles its own calls to # target_link_libraries nanobind_add_module( cpp MODULE - - # NB_SHARED dolfinx/wrappers/dolfinx.cpp dolfinx/wrappers/assemble.cpp dolfinx/wrappers/common.cpp From c36c3dd0485a49be901dc4988b0d0586952df0aa Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Mon, 13 Nov 2023 15:24:35 +0100 Subject: [PATCH 2/4] Also add to docker file --- docker/Dockerfile.end-user | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index aa59ad9ffba..68e076aba95 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -107,6 +107,7 @@ ONBUILD RUN cd dolfinx && \ # Real by default. ONBUILD ENV PKG_CONFIG_PATH=/usr/local/dolfinx-real/lib/pkgconfig:$PKG_CONFIG_PATH \ + CMAKE_PREFIX_PATH=/usr/local/dolfinx-real/lib/cmake:$CMAKE_PREFIX_PATH \ PETSC_ARCH=linux-gnu-real64-32 \ PYTHONPATH=/usr/local/dolfinx-real/lib/python${PYTHON_VERSION}/dist-packages:$PYTHONPATH \ LD_LIBRARY_PATH=/usr/local/dolfinx-real/lib:$LD_LIBRARY_PATH From 378b1afa465e0ca5dee86ad28f8d5913c6d0ac91 Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Wed, 15 Nov 2023 15:09:46 +0100 Subject: [PATCH 3/4] Add if --- python/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index ed5f3d5b7a3..c74f49f8cce 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -29,9 +29,13 @@ execute_process( ERROR_VARIABLE BASIX_ERROR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE ) find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) -message(STATUS "Found Basix at ${BASIX_DIR}") +if (Basix_FOUND) + message(STATUS "Found Basix at ${BASIX_DIR}") +endif() find_package(DOLFINX REQUIRED CONFIG) -message(STATUS "Found DOLFINx at ${DOLFINX_DIR}") +if (DOLFINX_FOUND) + message(STATUS "Found DOLFINx at ${DOLFINX_DIR}") +endif() # Create the binding library nanobind handles its own calls to # target_link_libraries From 154493de01adef6d222a51de506294695de89cbb Mon Sep 17 00:00:00 2001 From: Francesco Ballarin Date: Wed, 15 Nov 2023 15:34:05 +0100 Subject: [PATCH 4/4] Fix capitalization --- python/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index c74f49f8cce..0a909545185 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -30,7 +30,7 @@ execute_process( ) find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR}) if (Basix_FOUND) - message(STATUS "Found Basix at ${BASIX_DIR}") + message(STATUS "Found Basix at ${Basix_DIR}") endif() find_package(DOLFINX REQUIRED CONFIG) if (DOLFINX_FOUND)