]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Strip "-x cuda" from Trilinos flags without configured Cuda support 14739/head
authorDaniel Arndt <arndtd@ornl.gov>
Thu, 26 Jan 2023 22:25:13 +0000 (17:25 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Thu, 26 Jan 2023 23:14:11 +0000 (18:14 -0500)
cmake/modules/FindDEAL_II_TRILINOS.cmake

index a8648c87f856c903441ae0eae6db66f167ff1482..8a7c9af0f2a3bbadc4aebdf3715e2e1ca734c822 100644 (file)
@@ -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}

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.