Skip to content

Commit

Permalink
[cmake] for cmake v3.28 set policy CMP0146 to OLD to satisfy BLT …
Browse files Browse the repository at this point in the history
…that still uses FindCUDA + use CUDA_TOOLKIT_ROOT_DIR to assist FindCUDA in finding CUDA toolkit

resolves #438
  • Loading branch information
evaleev committed Dec 25, 2023
1 parent 81bafdc commit 985ed8a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
9 changes: 9 additions & 0 deletions external/umpire.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 985ed8a

Please sign in to comment.