mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-27 05:35:28 -04:00
Drop local spack recipe for HDF5; switch to newer spack-packages version
This commit is contained in:
parent
0fa5d6463e
commit
74799fca7c
6 changed files with 3 additions and 376 deletions
|
|
@ -168,7 +168,7 @@ spack:
|
|||
|
||||
repos:
|
||||
builtin:
|
||||
commit: a716421dc600672926fb420ede4e9a45bdd0948e # 2026-03-19
|
||||
commit: 0567610dc47bf39bbbc7ddc2520c34bea7819a50 # 2026-03-24
|
||||
|
||||
specs:
|
||||
# Build tools
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ spack:
|
|||
|
||||
repos:
|
||||
builtin:
|
||||
commit: a716421dc600672926fb420ede4e9a45bdd0948e # 2026-03-19
|
||||
commit: 0567610dc47bf39bbbc7ddc2520c34bea7819a50 # 2026-03-24
|
||||
|
||||
specs:
|
||||
# Build tools
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ spack:
|
|||
|
||||
repos:
|
||||
builtin:
|
||||
commit: a716421dc600672926fb420ede4e9a45bdd0948e # 2026-03-19
|
||||
commit: 0567610dc47bf39bbbc7ddc2520c34bea7819a50 # 2026-03-24
|
||||
|
||||
specs:
|
||||
# Build tools
|
||||
|
|
|
|||
|
|
@ -1,65 +0,0 @@
|
|||
From 8bda2149e4398bb6e6b66e601151966c91f9ec78 Mon Sep 17 00:00:00 2001
|
||||
From: m-shunji <m.shunji@fujitsu.com>
|
||||
Date: Wed, 13 Sep 2023 17:58:26 +0900
|
||||
Subject: [PATCH] Fix compile error in disabling openmp
|
||||
|
||||
---
|
||||
src/elpa_impl_math_template.F90 | 6 +++---
|
||||
test/Fortran/test_autotune.F90 | 4 ++--
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/elpa_impl_math_template.F90 b/src/elpa_impl_math_template.F90
|
||||
index f87a0ad..b41c0c3 100644
|
||||
--- a/src/elpa_impl_math_template.F90
|
||||
+++ b/src/elpa_impl_math_template.F90
|
||||
@@ -888,10 +888,10 @@
|
||||
#endif
|
||||
#ifdef COMPLEXCASE
|
||||
#ifdef DOUBLE_PRECISION_COMPLEX
|
||||
- & !bind(C, name="elpa_solve_tridiagonal_dc")
|
||||
+ bind(C, name="elpa_solve_tridiagonal_dc")
|
||||
#endif
|
||||
#ifdef SINGLE_PRECISION_COMPLEX
|
||||
- & !bind(C, name="elpa_solve_tridiagonal_fc")
|
||||
+ bind(C, name="elpa_solve_tridiagonal_fc")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -913,4 +913,4 @@
|
||||
&ELPA_IMPL_SUFFIX&
|
||||
& (self, d, e, q, error)
|
||||
end subroutine
|
||||
-
|
||||
\ No newline at end of file
|
||||
+
|
||||
diff --git a/test/Fortran/test_autotune.F90 b/test/Fortran/test_autotune.F90
|
||||
index 4662564..5355ab3 100644
|
||||
--- a/test/Fortran/test_autotune.F90
|
||||
+++ b/test/Fortran/test_autotune.F90
|
||||
@@ -312,8 +312,8 @@ program test
|
||||
status = check_correctness_analytic(na, nev, ev, z, nblk, myid, np_rows, np_cols, my_prow, my_pcol, &
|
||||
.true., .true., print_times=.false.)
|
||||
a(:,:) = as(:,:)
|
||||
- call e%autotune_print_state(tune_state)
|
||||
- call e%autotune_save_state(tune_state, "saved_state_"//trim(iter_string)//".txt")
|
||||
+ call e%autotune_print_state(tune_state, error_elpa)
|
||||
+ call e%autotune_save_state(tune_state, "saved_state_"//trim(iter_string)//".txt", error_elpa)
|
||||
end do
|
||||
|
||||
!! set and print the autotuned-settings
|
||||
--
|
||||
1.8.3.1
|
||||
diff --git a/manual_cpp b/manual_cpp
|
||||
index 6f74a79..dbdfc65 100755
|
||||
--- a/manual_cpp
|
||||
+++ b/manual_cpp
|
||||
@@ -46,7 +46,7 @@ elif len(files) == 0:
|
||||
elif len(files) == 1:
|
||||
file, = files
|
||||
|
||||
-tmp_filename = "manually_preprocessed_" + file.replace("/", "_")
|
||||
+tmp_filename = "manually_preprocessed_" + file.replace("/", "_").replace("-", "_")
|
||||
|
||||
try:
|
||||
output = args.index("-o")
|
||||
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
diff --git a/hipcc_wrap b/hipcc_wrap
|
||||
index 9c843ace84..344e7247e9 100755
|
||||
--- a/hipcc_wrap
|
||||
+++ b/hipcc_wrap
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/sh
|
||||
+#!/bin/bash
|
||||
|
||||
ARGS=()
|
||||
for arg in "$@"; do
|
||||
diff --git a/test/shared/GPU/ROCm/test_rocmFunctions.hip b/test/shared/GPU/ROCm/test_rocmFunctions.hip
|
||||
index ddb5956950..b04368d71a 100644
|
||||
--- a/test/shared/GPU/ROCm/test_rocmFunctions.hip
|
||||
+++ b/test/shared/GPU/ROCm/test_rocmFunctions.hip
|
||||
@@ -331,7 +331,7 @@
|
||||
#else /* HIPBLAS */
|
||||
#include "rocblas/rocblas.h"
|
||||
#ifdef WITH_AMD_ROCSOLVER
|
||||
-#include <rocsolver.h>
|
||||
+#include <rocsolver/rocsolver.h>
|
||||
#endif
|
||||
#endif /* HIPBLAS */
|
||||
#include "hip/hip_runtime_api.h"
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
# Copyright Spack Project Developers. See COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
||||
import os
|
||||
|
||||
from spack_repo.builtin.build_systems.autotools import AutotoolsPackage
|
||||
from spack_repo.builtin.build_systems.cuda import CudaPackage
|
||||
from spack_repo.builtin.build_systems.rocm import ROCmPackage
|
||||
|
||||
from spack.package import *
|
||||
|
||||
#
|
||||
# Please note that you can open issues on the github page of ELPA:
|
||||
# https://github.com/marekandreas/elpa/issues
|
||||
#
|
||||
|
||||
|
||||
class Elpa(AutotoolsPackage, CudaPackage, ROCmPackage):
|
||||
"""Eigenvalue solvers for Petaflop-Applications (ELPA)"""
|
||||
|
||||
homepage = "https://elpa.mpcdf.mpg.de/"
|
||||
url = "https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2015.11.001/elpa-2015.11.001.tar.gz"
|
||||
git = "https://gitlab.mpcdf.mpg.de/elpa/elpa.git"
|
||||
|
||||
license("LGPL-3.0-only")
|
||||
|
||||
version("master", branch="master")
|
||||
|
||||
version(
|
||||
"2026.02.001", sha256="a379f27f4dbd27b2ee45017afec656d064301e97150c874649bdfd64957b75ed"
|
||||
)
|
||||
version(
|
||||
"2025.06.001", sha256="feeb1fea1ab4a8670b8d3240765ef0ada828062ef7ec9b735eecba2848515c94"
|
||||
)
|
||||
version(
|
||||
"2025.01.002", sha256="8febe408c590ba9b44bd8bce04605fd1b7da964afcd8fd5f1ce9edecb3d0b65d"
|
||||
)
|
||||
version(
|
||||
"2025.01.001", sha256="3ef0c6aed9a3e05db6efafe6e14d66eb88b2a1354d61e765b7cde0d3d5f3951e"
|
||||
)
|
||||
version(
|
||||
"2024.05.001", sha256="9caf41a3e600e2f6f4ce1931bd54185179dade9c171556d0c9b41bbc6940f2f6"
|
||||
)
|
||||
version(
|
||||
"2024.03.001", sha256="41c6cbf56d2dac26443faaba8a77307d261bf511682a64b96e24def77c813622"
|
||||
)
|
||||
version(
|
||||
"2023.11.001-patched",
|
||||
sha256="62ee109afc06539507f459c08b958dc4db65b757dbd77f927678c77f7687415e",
|
||||
url="https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/2023.11.001/elpa-2023.11.001-patched.tar.gz",
|
||||
)
|
||||
version(
|
||||
"2023.05.001", sha256="ec64be5d6522810d601a3b8e6a31720e3c3eb4af33a434d8a64570d76e6462b6"
|
||||
)
|
||||
version(
|
||||
"2022.11.001", sha256="75db3ac146f9a6a1598e3418ddcab2be2f40a30ef9ec4c00a3b5d3808c99c430"
|
||||
)
|
||||
version(
|
||||
"2021.11.001", sha256="fb361da6c59946661b73e51538d419028f763d7cb9dacf9d8cd5c9cd3fb7802f"
|
||||
)
|
||||
version(
|
||||
"2021.05.002_bugfix",
|
||||
sha256="deabc48de5b9e4b2f073d749d335c8f354a7ce4245b643a23b7951cd6c90224b",
|
||||
)
|
||||
version(
|
||||
"2021.05.001", sha256="a4f1a4e3964f2473a5f8177f2091a9da5c6b5ef9280b8272dfefcbc3aad44d41"
|
||||
)
|
||||
|
||||
variant("openmp", default=True, description="Activates OpenMP support")
|
||||
variant("mpi", default=True, description="Activates MPI support")
|
||||
|
||||
with when("@2021.11.001:"):
|
||||
variant(
|
||||
"autotune", default=False, description="Enables autotuning for matrix restribution"
|
||||
)
|
||||
variant(
|
||||
"gpu_streams", default=True, when="+cuda", description="Activates GPU streams support"
|
||||
)
|
||||
variant(
|
||||
"gpu_streams", default=True, when="+rocm", description="Activates GPU streams support"
|
||||
)
|
||||
|
||||
patch("fujitsu.patch", when="%fj")
|
||||
# wrong filename handling in elpa's custom preprocessor
|
||||
patch(
|
||||
"https://gitlab.mpcdf.mpg.de/elpa/elpa/-/commit/5a821b79dd2905c691fc0973c9f3044904ac2653.diff",
|
||||
sha256="90f18c84e740a35d726e44078a111fac3b6278a0e750ce1f3ea154ee78e93298",
|
||||
when="@:2025.01.001",
|
||||
)
|
||||
patch("hipcc.patch", when="+rocm @2025.01.001:2025.06.001")
|
||||
|
||||
depends_on("c", type="build") # generated
|
||||
depends_on("cxx", type="build") # generated
|
||||
depends_on("fortran", type="build") # generated
|
||||
|
||||
depends_on("autoconf@2.71:", type="build", when="@master")
|
||||
depends_on("automake", type="build", when="@master")
|
||||
|
||||
depends_on("blas")
|
||||
depends_on("lapack")
|
||||
depends_on("mpi", when="+mpi")
|
||||
depends_on("scalapack", when="+mpi")
|
||||
depends_on("rocblas", when="+rocm")
|
||||
# elpa 2024.05.001 enables rocsolver by default
|
||||
# https://github.com/marekandreas/elpa/commit/de90ce3d634be468e71c2827d788de52ceb606bf#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810R2635-R2638
|
||||
depends_on("rocsolver", when="+rocm @2024.05.001:")
|
||||
depends_on("libtool", type="build")
|
||||
depends_on("python@3:", type="build")
|
||||
depends_on("scalapack", when="+autotune")
|
||||
|
||||
# Force openmp propagation on some providers of blas/lapack, as adviced by docs
|
||||
# https://gitlab.mpcdf.mpg.de/elpa/elpa/-/blob/master/documentation/PERFORMANCE_TUNING.md?ref_type=heads#builds-with-openmp-enabled
|
||||
with when("+openmp"):
|
||||
requires("^openblas threads=openmp", when="^[virtuals=blas,lapack] openblas")
|
||||
requires(
|
||||
"^intel-oneapi-mkl threads=openmp", when="^[virtuals=blas,lapack] intel-oneapi-mkl"
|
||||
)
|
||||
|
||||
# fails to build due to broken type-bound procedures in OMP parallel regions
|
||||
conflicts(
|
||||
"+openmp",
|
||||
when="@2021.05.001: %gcc@:7",
|
||||
msg="ELPA-2021.05.001+ requires GCC-8+ for OpenMP support",
|
||||
)
|
||||
conflicts("+mpi", when="+rocm @:2024", msg="ROCm support and MPI are not yet compatible")
|
||||
conflicts(
|
||||
"+gpu_streams",
|
||||
when="@:2023.11.001-patched +openmp",
|
||||
msg="GPU streams currently not supported in combination with OpenMP",
|
||||
)
|
||||
|
||||
def url_for_version(self, version):
|
||||
return "https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/{0}/elpa-{0}.tar.gz".format(
|
||||
str(version)
|
||||
)
|
||||
|
||||
# override default implementation which returns static lib
|
||||
@property
|
||||
def libs(self):
|
||||
libname = "libelpa_openmp" if "+openmp" in self.spec else "libelpa"
|
||||
return find_libraries(libname, root=self.prefix, shared=True, recursive=True)
|
||||
|
||||
@property
|
||||
def headers(self):
|
||||
suffix = "_openmp" if self.spec.satisfies("+openmp") else ""
|
||||
|
||||
# upstream sometimes adds tarball suffixes not part of the internal version
|
||||
elpa_version = str(self.spec.version)
|
||||
for vsuffix in ("_bugfix", "-patched"):
|
||||
if elpa_version.endswith(vsuffix): # implementation of py3.9 removesuffix
|
||||
elpa_version = elpa_version[: -len(vsuffix)]
|
||||
|
||||
incdir = os.path.join(
|
||||
self.spec.prefix.include,
|
||||
"elpa{suffix}-{version}".format(suffix=suffix, version=elpa_version),
|
||||
)
|
||||
|
||||
hlist = find_all_headers(incdir)
|
||||
hlist.directories = [incdir]
|
||||
return hlist
|
||||
|
||||
build_directory = "spack-build"
|
||||
# parallel = False
|
||||
|
||||
def flag_handler(self, name, flags):
|
||||
spec = self.spec
|
||||
if name == "cflags":
|
||||
if spec.satisfies("^[virtuals=c] gcc") or spec.satisfies("^[virtuals=c] aocc"):
|
||||
flags.append("-O3")
|
||||
if name == "fflags":
|
||||
if spec.satisfies("^[virtuals=fortran] aocc"):
|
||||
flags.append("-O3")
|
||||
elif spec.satisfies("^[virtuals=fortran] gcc"):
|
||||
flags.append("-O3 -ffree-line-length-none")
|
||||
if spec.satisfies("+autotune"):
|
||||
flags.append("-fallow-argument-mismatch")
|
||||
elif spec.satisfies("^[virtuals=fortran] fj") and spec.satisfies("+openmp"):
|
||||
flags.append("-Kparallel")
|
||||
if name == "ldflags":
|
||||
flags += [spec["blas"].libs.search_flags, spec["lapack"].libs.search_flags, "-lstdc++"]
|
||||
flags += [spec["lapack"].libs.link_flags, spec["blas"].libs.link_flags]
|
||||
if self.spec.satisfies("@2024.05.001,2025.01.001 %aocc"):
|
||||
# fix an issue where main library and test suite containing duplicate symbols
|
||||
flags.append("-Wl,--allow-multiple-definition")
|
||||
|
||||
return (flags, None, None)
|
||||
|
||||
def configure_args(self):
|
||||
spec = self.spec
|
||||
options = []
|
||||
|
||||
options += self.with_or_without("mpi")
|
||||
|
||||
# New options use the "-kernels" suffix
|
||||
kernels = "-kernels" if spec.satisfies("@2023.11:") else ""
|
||||
|
||||
# TODO: --disable-sse-assembly, --enable-sparc64, --enable-neon-arch64
|
||||
# Don't include vsx; as of 2022.05 it fails (reported upstream).
|
||||
# Altivec SSE intrinsics are used anyway.
|
||||
simd_features = ["sse", "avx", "avx2", "avx512", "sve128", "sve256", "sve512"]
|
||||
|
||||
for feature in simd_features:
|
||||
msg = "--enable-{0}" if feature in spec.target else "--disable-{0}"
|
||||
options.append(msg.format(feature + kernels))
|
||||
|
||||
if spec.target.family != "x86_64":
|
||||
options.append("--disable-sse-assembly")
|
||||
|
||||
if spec.satisfies("%aocc") or spec.satisfies("%fj"):
|
||||
options.append("--disable-shared")
|
||||
options.append("--enable-static")
|
||||
|
||||
# If no features are found, enable the generic ones
|
||||
if not any(f in spec.target for f in simd_features):
|
||||
options.append("--enable-generic" + kernels)
|
||||
|
||||
if spec.satisfies("%fj"):
|
||||
options.append("--disable-Fortran2008-features")
|
||||
options.append("--enable-FUGAKU")
|
||||
|
||||
cuda_flag = "nvidia-gpu"
|
||||
if spec.satisfies("+cuda"):
|
||||
prefix = spec["cuda"].prefix
|
||||
# Can't yet be changed to the new option --enable-nvidia-gpu-kernels
|
||||
# https://github.com/marekandreas/elpa/issues/55
|
||||
options.append(f"--enable-{cuda_flag}")
|
||||
options.append("--with-cuda-path={0}".format(prefix))
|
||||
options.append("--with-cuda-sdk-path={0}".format(prefix))
|
||||
|
||||
if spec.satisfies("+gpu_streams"):
|
||||
options.append("--enable-gpu-streams=nvidia")
|
||||
|
||||
cuda_arch = spec.variants["cuda_arch"].value[0]
|
||||
|
||||
if cuda_arch != "none":
|
||||
options.append(
|
||||
"--with-{0}-compute-capability=sm_{1}".format(cuda_flag.upper(), cuda_arch)
|
||||
)
|
||||
else:
|
||||
options.append(f"--disable-{cuda_flag}" + kernels)
|
||||
|
||||
if spec.satisfies("+rocm"):
|
||||
# Can't yet be changed to the new option --enable-amd-gpu-kernels
|
||||
# https://github.com/marekandreas/elpa/issues/55
|
||||
options.append("--enable-amd-gpu")
|
||||
if spec.satisfies("@2025.01.001:"):
|
||||
options.append(
|
||||
"HIPCC={0} {1} {2}".format(
|
||||
spec["hip"].hipcc,
|
||||
spec["rocblas"].headers.include_flags,
|
||||
spec["rocsolver"].headers.include_flags,
|
||||
)
|
||||
)
|
||||
else:
|
||||
options.append("CXX={0}".format(spec["hip"].hipcc))
|
||||
|
||||
if spec.satisfies("+gpu_streams"):
|
||||
options.append("--enable-gpu-streams=amd")
|
||||
|
||||
elif self.spec.satisfies("@2021.05.001:"):
|
||||
options.append("--disable-amd-gpu" + kernels)
|
||||
|
||||
options += self.enable_or_disable("openmp")
|
||||
|
||||
if self.spec.satisfies("+mpi"):
|
||||
options += [
|
||||
"CC={0}".format(spec["mpi"].mpicc),
|
||||
"CXX={0}".format(spec["mpi"].mpicxx),
|
||||
"FC={0}".format(spec["mpi"].mpifc),
|
||||
"SCALAPACK_LDFLAGS={0}".format(spec["scalapack"].libs.joined()),
|
||||
]
|
||||
|
||||
if self.spec.satisfies("+autotune"):
|
||||
options.append("--enable-autotune-redistribute-matrix")
|
||||
# --enable-autotune-redistribute-matrix requires --enable-scalapack-tests as well
|
||||
options.append("--enable-scalapack-tests")
|
||||
|
||||
options.append("--disable-silent-rules")
|
||||
options.append("--without-threading-support-check-during-build")
|
||||
options.append("--disable-c-tests")
|
||||
options.append("--disable-cpp-tests")
|
||||
options.append("--disable-Fortran-tests")
|
||||
|
||||
return options
|
||||
Loading…
Add table
Add a link
Reference in a new issue