Kokkos sanity checks (#44589)

* Kokkos: adding some sanity checks
   We can pretty much guarentee that if bin, include or lib directory
   is missing, something is wrong. Additionally KokkosCore_config.h
   and Kokkos_Core.hpp. I guess technically we could look for all
   public headers at least but that seems a bit overkill as well?
* Kokkos Kernels: adding sanity checks
* Remove check for lib directory since it might end up being lib64
* Also remove lib from kokkos-kernels sanity check
This commit is contained in:
Luc Berger 2024-09-30 17:10:20 -06:00 committed by GitHub
parent d7f5dbaf89
commit 394ed4f90d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -167,6 +167,10 @@ class KokkosKernels(CMakePackage, CudaPackage):
variant("shared", default=True, description="Build shared libraries")
# sanity check
sanity_check_is_file = [join_path("include", "KokkosKernels_config.h")]
sanity_check_is_dir = ["include"]
def cmake_args(self):
spec = self.spec
options = []

View File

@ -265,6 +265,13 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage):
"KokkosConfigCommon.cmake", relative_root=os.path.join("lib64", "cmake", "Kokkos")
)
# sanity check
sanity_check_is_file = [
join_path("include", "KokkosCore_config.h"),
join_path("include", "Kokkos_Core.hpp"),
]
sanity_check_is_dir = ["bin", "include"]
@classmethod
def get_microarch(cls, target):
"""Get the Kokkos microarch name for a Spack target (spec.target)."""