From: Daniel Arndt Date: Thu, 26 Jan 2023 22:25:13 +0000 (-0500) Subject: Strip "-x cuda" from Trilinos flags without configured Cuda support X-Git-Tag: v9.5.0-rc1~599^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08ff39419dbc12e255af74b946d9b2f4d3d060b9;p=dealii.git Strip "-x cuda" from Trilinos flags without configured Cuda support --- 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}