From 3d554db1989e8bbff983821ec0ae7b61216dbfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Bederi=C3=A1n?= <4043375+zzzoom@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:04:49 -0300 Subject: [PATCH] hpl: build v2.3 with timers (#48206) Co-authored-by: zzzoom Co-authored-by: Massimiliano Culpo --- .../repos/builtin/packages/hpl/package.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/hpl/package.py b/var/spack/repos/builtin/packages/hpl/package.py index d992cea1269..882a25024b1 100644 --- a/var/spack/repos/builtin/packages/hpl/package.py +++ b/var/spack/repos/builtin/packages/hpl/package.py @@ -37,6 +37,24 @@ class Hpl(AutotoolsPackage): arch = "{0}-{1}".format(platform.system(), platform.processor()) build_targets = ["arch={0}".format(arch)] + with when("@=2.3"): + depends_on("autoconf-archive", type="build") # AX_PROG_CC_MPI + depends_on("autoconf", type="build") + depends_on("automake", type="build") + depends_on("m4", type="build") + depends_on("libtool", type="build") + + @property + def force_autoreconf(self): + return self.version == Version("2.3") + + @run_before("autoreconf", when="@=2.3") + def add_timer_to_libhpl(self): + # Add HPL_timer_walltime to libhpl.a + filter_file( + r"(pgesv/HPL_perm.c)$", r"\1 ../testing/timer/HPL_timer_walltime.c", "src/Makefile.am" + ) + @when("@:2.2") def autoreconf(self, spec, prefix): # Prevent sanity check from killing the build @@ -104,7 +122,7 @@ def configure(self, spec, prefix): def configure_args(self): filter_file(r"^libs10=.*", "libs10=%s" % self.spec["blas"].libs.ld_flags, "configure") - cflags, ldflags = ["-O3"], [] + cflags, ldflags = ["-O3", "-DHPL_PROGRESS_REPORT", "-DHPL_DETAILED_TIMING"], [] if self.spec.satisfies("+openmp"): cflags.append(self.compiler.openmp_flag)