summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuc Berger <lberge@sandia.gov>2024-09-30 17:10:20 -0600
committerGitHub <noreply@github.com>2024-09-30 16:10:20 -0700
commit394ed4f90d042aab8135312602c3377e67bf37ae (patch)
tree6a72a46647e0c6dc3fc295d72e71a8967f396d15
parentd7f5dbaf8911387d6c38035f0d508702ee71b03a (diff)
downloadspack-394ed4f90d042aab8135312602c3377e67bf37ae.tar.gz
spack-394ed4f90d042aab8135312602c3377e67bf37ae.tar.bz2
spack-394ed4f90d042aab8135312602c3377e67bf37ae.tar.xz
spack-394ed4f90d042aab8135312602c3377e67bf37ae.zip
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
-rw-r--r--var/spack/repos/builtin/packages/kokkos-kernels/package.py4
-rw-r--r--var/spack/repos/builtin/packages/kokkos/package.py7
2 files changed, 11 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/kokkos-kernels/package.py b/var/spack/repos/builtin/packages/kokkos-kernels/package.py
index e28ad8be82..0187de16b9 100644
--- a/var/spack/repos/builtin/packages/kokkos-kernels/package.py
+++ b/var/spack/repos/builtin/packages/kokkos-kernels/package.py
@@ -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 = []
diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py
index 20d6c94474..ed95535469 100644
--- a/var/spack/repos/builtin/packages/kokkos/package.py
+++ b/var/spack/repos/builtin/packages/kokkos/package.py
@@ -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)."""