From 2dab80f166a95d4c662edfadd9dc5087979e3a7f Mon Sep 17 00:00:00 2001 From: Matthias Krack Date: Sat, 17 Jan 2026 13:38:41 +0100 Subject: [PATCH] Use the same libxsmm version with Spack as with the toolchain --- tools/spack/cp2k_deps_psmp.yaml | 2 +- tools/spack/cp2k_deps_ssmp.yaml | 2 +- .../cp2k_dev/packages/libxsmm/package.py | 20 +++++++++++++------ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/tools/spack/cp2k_deps_psmp.yaml b/tools/spack/cp2k_deps_psmp.yaml index 340f305034..dd48ce970a 100644 --- a/tools/spack/cp2k_deps_psmp.yaml +++ b/tools/spack/cp2k_deps_psmp.yaml @@ -179,7 +179,7 @@ spack: - libvdwxc@0.4.0 - libvori@220621 - libxc@7.0.0 - - libxsmm@1.17 + - libxsmm@1.17-cp2k - mimic-mcl@3.0.0 - mpich@4.3.2 - netlib-scalapack@2.2.2 diff --git a/tools/spack/cp2k_deps_ssmp.yaml b/tools/spack/cp2k_deps_ssmp.yaml index 8455605187..a768123a63 100644 --- a/tools/spack/cp2k_deps_ssmp.yaml +++ b/tools/spack/cp2k_deps_ssmp.yaml @@ -115,7 +115,7 @@ spack: - libint@2.11.1 - libvori@220621 - libxc@7.0.0 - - libxsmm@1.17 + - libxsmm@1.17-cp2k - openblas@0.3.30 - py-torch@2.9.0 - spglib@2.5.0 diff --git a/tools/spack/spack_repo/cp2k_dev/packages/libxsmm/package.py b/tools/spack/spack_repo/cp2k_dev/packages/libxsmm/package.py index 6d30b3edd9..69c744a7cd 100644 --- a/tools/spack/spack_repo/cp2k_dev/packages/libxsmm/package.py +++ b/tools/spack/spack_repo/cp2k_dev/packages/libxsmm/package.py @@ -28,7 +28,7 @@ class Libxsmm(MakefilePackage): # after 2.0 release. version("main-2023-11", commit="0d9be905527ba575c14ca5d3b4c9673916c868b2") version("main", branch="main") - version("1.17-cp2k", commit="6f883620f58afdeebab28039fc9cf580e76a5ec6") + version("1.17-cp2k", commit="e0c4a2389afba36c453233ad7de07bd92c715bec") version( "1.17", sha256="8b642127880e92e8a75400125307724635ecdf4020ca4481e5efe7640451bb92", @@ -87,6 +87,11 @@ class Libxsmm(MakefilePackage): when="@1.17:", description="Max. JIT buffer size increased to 256 KiB", ) + variant( + "wrap", + default="0", + description="Set WRAP to determines the kind of routine called for intercepted GEMMs", + ) depends_on("c", type="build") # generated depends_on("cxx", type="build") # generated @@ -101,7 +106,7 @@ class Libxsmm(MakefilePackage): # Version 2.0 supports both x86_64 and aarch64 requires("target=x86_64:", "target=aarch64:") - requires("target=x86_64:", when="@:1") + # requires("target=x86_64:", when="@:1") @property def libs(self): @@ -120,10 +125,10 @@ class Libxsmm(MakefilePackage): "FC={0}".format(spack_fc), "PREFIX=%s" % prefix, ] - if spec.target.family == "aarch64": - make_args += ["PLATFORM=1"] - else: - make_args += ["SYM=1"] + # if spec.target.family == "aarch64": + # make_args += ["PLATFORM=1"] + # else: + # make_args += ["SYM=1"] # JIT (AVX and later) makes MNK, M, N, or K spec. superfluous # make_args += ['MNK=1 4 5 6 8 9 13 16 17 22 23 24 26 32'] @@ -143,6 +148,9 @@ class Libxsmm(MakefilePackage): if spec.satisfies("+shared"): make(*(make_args + ["STATIC=0"])) + wrap_val = spec.variants["wrap"].value + make_args += ["WRAP={0}".format(wrap_val)] + # builds static libraries by default make(*make_args)