]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Call find_package(Kokkos) if PETSc is compiled with Kokkos support
authorBruno Turcksin <bruno.turcksin@gmail.com>
Mon, 28 Oct 2024 21:10:54 +0000 (17:10 -0400)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Mon, 28 Oct 2024 21:10:54 +0000 (17:10 -0400)
cmake/modules/FindDEAL_II_PETSC.cmake

index f304cb83cc91007f8ed92c122711008f62c0b49a..445490aed57a3e6b0918d50dc265c40239962108 100644 (file)
@@ -193,6 +193,17 @@ if(NOT PETSC_PETSCVARIABLES MATCHES "-NOTFOUND")
 
     endif()
   endforeach()
+
+  # PETSc does not expose Kokkos version, so we need to search for Kokkos
+  # ourselves.
+  if(PETSC_WITH_KOKKOS)
+    file(STRINGS "${PETSC_PETSCVARIABLES}" KOKKOS_INCLUDE
+      REGEX "^KOKKOS_INCLUDE =.*")
+    string(REGEX REPLACE "^KOKKOS_INCLUDE = -I" "" KOKKOS_INCLUDE "${KOKKOS_INCLUDE}")
+    find_package(Kokkos 3.7.0 QUIET
+      HINTS ${KOKKOS_INCLUDE}/..
+      )
+  endif()
 endif()
 
 if(PETSC_WITH_MPIUNI)

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.