Skip to content

Commit

Permalink
Export CMAKE_PREFIX_PATH in helper installation scripts (#2887)
Browse files Browse the repository at this point in the history
* Export CMAKE_PREFIX_PATH in helper installation scripts

* Also add to docker file

* Add if

* Fix capitalization
  • Loading branch information
francesco-ballarin authored Nov 15, 2023
1 parent 509a397 commit a7fa17b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions cpp/cmake/templates/dolfinx.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions docker/Dockerfile.end-user
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docker/dolfinx-complex-mode
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions docker/dolfinx-real-mode
Original file line number Diff line number Diff line change
@@ -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
8 changes: 6 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,19 @@ execute_process(
ERROR_VARIABLE BASIX_ERROR_OUT OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_package(Basix REQUIRED CONFIG HINTS ${BASIX_PY_DIR})
if (Basix_FOUND)
message(STATUS "Found Basix at ${Basix_DIR}")
endif()
find_package(DOLFINX REQUIRED CONFIG)
if (DOLFINX_FOUND)
message(STATUS "Found DOLFINx at ${DOLFINX_DIR}")
endif()

# 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
Expand Down

0 comments on commit a7fa17b

Please sign in to comment.