spla: add v1.6.0 (#44609)

This commit is contained in:
Simon Frasch 2024-06-11 13:06:50 +02:00 committed by GitHub
parent 0781615117
commit 82a932c078
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ class Spla(CMakePackage):
license("BSD-3-Clause") license("BSD-3-Clause")
version("1.6.0", sha256="917c24e2a768499967eba47b2cc2475df9fabee327b7821d24970b6a08055c09")
version("1.5.5", sha256="bc0c366e228344b1b2df55b9ce750d73c1165380e512da5a04d471db126d66ce") version("1.5.5", sha256="bc0c366e228344b1b2df55b9ce750d73c1165380e512da5a04d471db126d66ce")
version("1.5.4", sha256="de30e427d24c741e2e4fcae3d7668162056ac2574afed6522c0bb49d6f1d0f79") version("1.5.4", sha256="de30e427d24c741e2e4fcae3d7668162056ac2574afed6522c0bb49d6f1d0f79")
version("1.5.3", sha256="527c06e316ce46ec87309a16bfa4138b1abad23fd276fe789c78a2de84f05637") version("1.5.3", sha256="527c06e316ce46ec87309a16bfa4138b1abad23fd276fe789c78a2de84f05637")
@ -35,7 +36,7 @@ class Spla(CMakePackage):
version("develop", branch="develop") version("develop", branch="develop")
version("master", branch="master") version("master", branch="master")
variant("openmp", default=True, description="Build with OpenMP support") variant("openmp", default=True, when="@:1.5.5", description="Build with OpenMP support")
variant("static", default=False, description="Build as static library") variant("static", default=False, description="Build as static library")
variant("cuda", default=False, description="CUDA backend") variant("cuda", default=False, description="CUDA backend")
variant("rocm", default=False, description="ROCm backend") variant("rocm", default=False, description="ROCm backend")
@ -51,10 +52,14 @@ class Spla(CMakePackage):
depends_on("mpi") depends_on("mpi")
depends_on("blas") depends_on("blas")
depends_on("cmake@3.10:", type="build") depends_on("cmake@3.10:", type="build")
depends_on("cmake@3.18:", type="build", when="@1.6.0:")
depends_on("cuda", when="+cuda") depends_on("cuda", when="+cuda")
depends_on("rocblas", when="+rocm") depends_on("cuda@11:", when="@1.6.0: +cuda")
depends_on("hip", when="+rocm") depends_on("hip", when="+rocm")
depends_on("rocblas", when="+rocm")
conflicts("^rocblas@6.0.0:", when="@:1.5.5 +rocm")
# Propagate openmp to blas # Propagate openmp to blas
depends_on("openblas threads=openmp", when="+openmp ^[virtuals=blas] openblas") depends_on("openblas threads=openmp", when="+openmp ^[virtuals=blas] openblas")
@ -67,30 +72,36 @@ class Spla(CMakePackage):
patch("0001-amd_blis.patch", when="@1.3.0:1.4.0 ^amdblis") patch("0001-amd_blis.patch", when="@1.3.0:1.4.0 ^amdblis")
def cmake_args(self): def cmake_args(self):
spec = self.spec
args = [ args = [
self.define_from_variant("SPLA_OMP", "openmp"),
self.define_from_variant("SPLA_FORTRAN", "fortran"), self.define_from_variant("SPLA_FORTRAN", "fortran"),
self.define_from_variant("SPLA_STATIC", "static"), self.define_from_variant("SPLA_STATIC", "static"),
] ]
if "+cuda" in self.spec: if "+cuda" in spec:
args += ["-DSPLA_GPU_BACKEND=CUDA"] args += ["-DSPLA_GPU_BACKEND=CUDA"]
elif "+rocm" in self.spec: elif "+rocm" in spec:
args += ["-DSPLA_GPU_BACKEND=ROCM"] args += ["-DSPLA_GPU_BACKEND=ROCM"]
else: else:
args += ["-DSPLA_GPU_BACKEND=OFF"] args += ["-DSPLA_GPU_BACKEND=OFF"]
if self.spec["blas"].name == "openblas": # v1.6.0: No longer has custom BLAS detection and only uses the FindBLAS CMake module.
args += ["-DSPLA_HOST_BLAS=OPENBLAS"] if spec.satisfies("@:1.5.5"):
elif self.spec["blas"].name in ["amdblis", "blis"]: args += [self.define_from_variant("SPLA_OMP", "openmp")]
args += ["-DSPLA_HOST_BLAS=BLIS"] if spec["blas"].name == "openblas":
elif self.spec["blas"].name == "atlas": args += ["-DSPLA_HOST_BLAS=OPENBLAS"]
args += ["-DSPLA_HOST_BLAS=ATLAS"] elif spec["blas"].name in ["amdblis", "blis"]:
elif self.spec["blas"].name == "intel-mkl": args += ["-DSPLA_HOST_BLAS=BLIS"]
args += ["-DSPLA_HOST_BLAS=MKL"] elif spec["blas"].name == "atlas":
elif self.spec["blas"].name == "netlib-lapack": args += ["-DSPLA_HOST_BLAS=ATLAS"]
args += ["-DSPLA_HOST_BLAS=GENERIC"] elif spec["blas"].name == "intel-mkl":
elif self.spec["blas"].name == "cray-libsci": args += ["-DSPLA_HOST_BLAS=MKL"]
args += ["-DSPLA_HOST_BLAS=CRAY_LIBSCI"] elif spec["blas"].name == "netlib-lapack":
args += ["-DSPLA_HOST_BLAS=GENERIC"]
elif spec["blas"].name == "cray-libsci":
args += ["-DSPLA_HOST_BLAS=CRAY_LIBSCI"]
else:
args += [self.define("BLAS_LIBRARIES", spec["blas"].libs.joined(";"))]
return args return args