From 08ff39419dbc12e255af74b946d9b2f4d3d060b9 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 26 Jan 2023 17:25:13 -0500 Subject: [PATCH] Strip "-x cuda" from Trilinos flags without configured Cuda support --- cmake/modules/FindDEAL_II_TRILINOS.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindDEAL_II_TRILINOS.cmake b/cmake/modules/FindDEAL_II_TRILINOS.cmake index a8648c87f8..8a7c9af0f2 100644 --- a/cmake/modules/FindDEAL_II_TRILINOS.cmake +++ b/cmake/modules/FindDEAL_II_TRILINOS.cmake @@ -147,6 +147,13 @@ if(TARGET Kokkos::kokkos) add_flags(_kokkos_openmp_flags "${_entry}") endif() endforeach() + + # Some Kokkos versions included in Trilinos before 13.2.0 add "-x cuda" when + # using clang++ as compiler even if Kokkos has not been configured with Cuda + # support. Simply strip that flag from what we are using in that case. + if(NOT Kokkos_ENABLE_CUDA) + string(REPLACE "-x cuda" "" KOKKOS_COMPILE_FLAGS "${KOKKOS_COMPILE_FLAGS}") + endif() endif() # @@ -169,7 +176,6 @@ foreach(_library ${Trilinos_LIBRARIES}) ) endforeach() - process_feature(TRILINOS LIBRARIES REQUIRED ${_libraries} -- 2.39.5