From 5cf590e44049669f7e0d66e8ce285b1a0bf00fe9 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Mon, 21 Sep 2020 09:37:31 -0400 Subject: [PATCH 1/4] [cmake] Set @PROJECT_NAME@_MODULE_DIR in config.cmake file when PythonSupport enabled --- share/cmake/app4triqs-config.cmake.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/cmake/app4triqs-config.cmake.in b/share/cmake/app4triqs-config.cmake.in index 940e75f6..f5a84276 100644 --- a/share/cmake/app4triqs-config.cmake.in +++ b/share/cmake/app4triqs-config.cmake.in @@ -33,5 +33,8 @@ set(@PROJECT_NAME@_WITH_DOCUMENTATION @Build_Documentation@ CACHE BOOL "Was @PRO # Was the Project built with PythonSupport? set(@PROJECT_NAME@_WITH_PYTHON_SUPPORT @PythonSupport@ CACHE BOOL "Was @PROJECT_NAME@ build with python support?") +if(@PythonSupport@) + set(@PROJECT_NAME@_MODULE_DIR @CMAKE_INSTALL_PREFIX@/@CPP2PY_PYTHON_LIB_DEST_ROOT@ CACHE BOOL "The @PROJECT_NAME@ python module directory") +endif() endif() From d76a28c80a4a7d021a1f53b0a1ebb8df4362a11a Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 23 Sep 2020 12:10:27 -0400 Subject: [PATCH 2/4] [cmake] Install app4triqsvars.sh into subdirectory of share only for non-system install prefix --- doc/install.rst | 2 +- share/CMakeLists.txt | 27 ++++++++++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/doc/install.rst b/doc/install.rst index d8668c58..12f1855f 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -25,7 +25,7 @@ Installation steps #. Ensure that your shell contains the TRIQS environment variables by sourcing the ``triqsvars.sh`` file from your TRIQS installation:: - $ source path_to_triqs/share/triqsvarsh.sh + $ source path_to_triqs/share/triqs/triqsvars.sh #. In the build directory call cmake, including any additional custom CMake options, see below:: diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index f6da5199..8d258a5f 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -1,6 +1,10 @@ add_subdirectory(cmake) -if(NOT CMAKE_INSTALL_PREFIX STREQUAL TRIQS_ROOT AND NOT IS_SUBPROJECT) +if(NOT IS_SUBPROJECT + AND NOT CMAKE_INSTALL_PREFIX STREQUAL TRIQS_ROOT + AND NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr" + AND NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr/local" +) if(PythonSupport) set(EXPORT_PYTHON_PATH "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${CPP2PY_PYTHON_LIB_DEST_ROOT}:$PYTHONPATH") @@ -14,15 +18,20 @@ if(NOT CMAKE_INSTALL_PREFIX STREQUAL TRIQS_ROOT AND NOT IS_SUBPROJECT) FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.modulefile ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}vars.sh - DESTINATION share + DESTINATION share/${PROJECT_NAME} ) - message(STATUS "***************************************************************") - message(STATUS "* Custom install Location. Use: ") - message(STATUS "* ") - message(STATUS "* source ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}vars.sh ") - message(STATUS "* ") - message(STATUS "* to set up the environment variables ") - message(STATUS "***************************************************************") + message(STATUS "*********************************************************************************") + message(STATUS "* Custom install Location. Use: ") + message(STATUS "* ") + message(STATUS "* source ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/${PROJECT_NAME}vars.sh ") + message(STATUS "* ") + message(STATUS "* to set up the environment variables ") + if(DEFINED ENV{MODULEPATH}) + message(STATUS "* ") + message(STATUS "* Consider copying ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.modulefile ") + message(STATUS "* into your environment module directories ") + endif() + message(STATUS "*********************************************************************************") endif() From 69c16ec2121f79cb5e36a747289d69c9f30f4ef1 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 30 Sep 2020 10:35:11 -0400 Subject: [PATCH 3/4] Fix location of triqsvars.sh in gh actions build workflow --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be6d6ae6..b790ad30 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,7 +79,7 @@ jobs: CXX: ${{ matrix.cxx }} LIBRARY_PATH: /usr/local/opt/llvm/lib run: | - source $HOME/install/share/triqsvars.sh + source $HOME/install/share/triqs/triqsvars.sh mkdir build && cmake -B build cmake --build build -j2 From f5ebef3af89f71152d2e26805be78eb27c8d6009 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 9 Oct 2020 09:25:37 -0400 Subject: [PATCH 4/4] Adjust triqsvars.sh location in github actions and conda build scripts --- .github/workflows/build.yml | 2 +- packaging/conda/build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b790ad30..a306add9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,6 +87,6 @@ jobs: env: DYLD_FALLBACK_LIBRARY_PATH: /usr/local/opt/llvm/lib run: | - source $HOME/install/share/triqsvars.sh + source $HOME/install/share/triqs/triqsvars.sh cd build ctest -j2 --output-on-failure diff --git a/packaging/conda/build.sh b/packaging/conda/build.sh index e3d1f540..740a84dd 100644 --- a/packaging/conda/build.sh +++ b/packaging/conda/build.sh @@ -10,7 +10,7 @@ export OMPI_MCA_rmaps_base_oversubscribe=yes export OMPI_MCA_btl_vader_single_copy_mechanism=none mpiexec="mpiexec --allow-run-as-root" -source $PREFIX/share/triqsvars.sh +source $PREFIX/share/triqs/triqsvars.sh cmake \ -DCMAKE_INSTALL_PREFIX=$PREFIX \