From 9b49576875d099ba46d6e21c4f64e64482c24b71 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Mon, 8 Jul 2024 01:25:09 -0600 Subject: [PATCH] legion: bugfix for +cuda+cuda_unsupported_compiler (#45036) When using a newer Clang for Kokkos than supported by a given CUDA version, the CUDA compiler detection in Legion's CMake still needs to be passed CMAKE_CUDA_FLAGS to pass the compiler check. --- var/spack/repos/builtin/packages/legion/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/var/spack/repos/builtin/packages/legion/package.py b/var/spack/repos/builtin/packages/legion/package.py index a9393b0f0f0..54e21952c04 100644 --- a/var/spack/repos/builtin/packages/legion/package.py +++ b/var/spack/repos/builtin/packages/legion/package.py @@ -394,6 +394,11 @@ def cmake_args(self): # default is off. options.append("-DLegion_USE_Kokkos=ON") os.environ["KOKKOS_CXX_COMPILER"] = spec["kokkos"].kokkos_cxx + if spec.satisfies("+cuda+cuda_unsupported_compiler ^kokkos%clang +cuda"): + # Keep CMake CUDA compiler detection happy + options.append( + self.define("CMAKE_CUDA_FLAGS", "--allow-unsupported-compiler -std=c++17") + ) if spec.satisfies("+libdl"): # default is on.