From 985ed8ade8b5fb8b4f6f345df0c3a87248e4364a Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Sun, 24 Dec 2023 16:44:28 -0500 Subject: [PATCH] [cmake] for cmake v3.28 set policy `CMP0146` to `OLD` to satisfy BLT that still uses FindCUDA + use CUDA_TOOLKIT_ROOT_DIR to assist FindCUDA in finding CUDA toolkit resolves #438 --- .gitlab-ci.yml | 1 + external/umpire.cmake | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd9c49aefa..264b42f0bb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,7 @@ variables: TA_UT_CTEST_TIMEOUT=3000 ${TA_PYTHON} ${ENABLE_CUDA} + CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda ${BLA_VENDOR} ${BLA_THREADS} ${ENABLE_SCALAPACK} diff --git a/external/umpire.cmake b/external/umpire.cmake index e61fe832e5..aa98f27b1e 100644 --- a/external/umpire.cmake +++ b/external/umpire.cmake @@ -109,6 +109,15 @@ else() if (DEFINED CMAKE_CUDA_ARCHITECTURES) list(APPEND UMPIRE_CMAKE_ARGS "-DCMAKE_CUDA_ARCHITECTURES=${CMAKE_CUDA_ARCHITECTURES}") endif(DEFINED CMAKE_CUDA_ARCHITECTURES) + # BLT will need FindCUDA until https://github.com/LLNL/blt/pull/585 is merged + # with CMake 3.28.1 needs to set CMP0146 to OLD + if (POLICY CMP0146) + list(APPEND UMPIRE_CMAKE_ARGS -DCMAKE_POLICY_DEFAULT_CMP0146=OLD) + endif() + # as of CMake 3.28+ FindCUDA seems to require CUDA_TOOLKIT_ROOT_DIR to be defined + if (DEFINED CUDA_TOOLKIT_ROOT_DIR) + list(APPEND UMPIRE_CMAKE_ARGS "-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR}") + endif() endif(ENABLE_CUDA) if (ENABLE_HIP) list(APPEND UMPIRE_CMAKE_ARGS