From: Bruno Turcksin Date: Mon, 28 Oct 2024 21:10:54 +0000 (-0400) Subject: Call find_package(Kokkos) if PETSc is compiled with Kokkos support X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=75f64e6b71400a3b726dddf09119ac9563bedc45;p=dealii.git Call find_package(Kokkos) if PETSc is compiled with Kokkos support --- diff --git a/cmake/modules/FindDEAL_II_PETSC.cmake b/cmake/modules/FindDEAL_II_PETSC.cmake index f304cb83cc..445490aed5 100644 --- a/cmake/modules/FindDEAL_II_PETSC.cmake +++ b/cmake/modules/FindDEAL_II_PETSC.cmake @@ -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)