diff options
author | Victor A. P. Magri <50467563+victorapm@users.noreply.github.com> | 2024-11-28 01:15:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-28 10:15:12 +0100 |
commit | 69fb5946997417514030f310e99d8e36bdaa5e6f (patch) | |
tree | 5617a158150ccd8b93c04c95337261146c0a1f7a /var | |
parent | d28614151fe83e35638b37ffa4232893b522f4ae (diff) | |
download | spack-69fb5946997417514030f310e99d8e36bdaa5e6f.tar.gz spack-69fb5946997417514030f310e99d8e36bdaa5e6f.tar.bz2 spack-69fb5946997417514030f310e99d8e36bdaa5e6f.tar.xz spack-69fb5946997417514030f310e99d8e36bdaa5e6f.zip |
hypre: add a variant to allow using internal lapack functions (#47780)
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/hypre/package.py | 34 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/mfem/package.py | 6 |
2 files changed, 24 insertions, 16 deletions
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py index 8d3c262c67..078221ba64 100644 --- a/var/spack/repos/builtin/packages/hypre/package.py +++ b/var/spack/repos/builtin/packages/hypre/package.py @@ -19,7 +19,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): git = "https://github.com/hypre-space/hypre.git" tags = ["e4s", "radiuss"] - maintainers("ulrikeyang", "osborn9", "balay") + maintainers("ulrikeyang", "osborn9", "victorapm", "balay") test_requires_compiler = True @@ -74,6 +74,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): variant( "superlu-dist", default=False, description="Activates support for SuperLU_Dist library" ) + variant("lapack", default=True, description="Use external blas/lapack") variant("int64", default=False, description="Use 64bit integers") variant("mixedint", default=False, description="Use 64bit integers while reducing memory use") variant("complex", default=False, description="Use complex values") @@ -123,8 +124,8 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): filter_file("\tmake", "\t$(MAKE)", "src/seq_mv/Makefile") depends_on("mpi", when="+mpi") - depends_on("blas") - depends_on("lapack") + depends_on("blas", when="+lapack") + depends_on("lapack", when="+lapack") depends_on("magma", when="+magma") depends_on("superlu-dist", when="+superlu-dist+mpi") depends_on("rocsparse", when="+rocm") @@ -198,17 +199,20 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): def configure_args(self): spec = self.spec - # Note: --with-(lapack|blas)_libs= needs space separated list of names - lapack = spec["lapack"].libs - blas = spec["blas"].libs + configure_args = [f"--prefix={prefix}"] - configure_args = [ - "--prefix=%s" % prefix, - "--with-lapack-libs=%s" % " ".join(lapack.names), - "--with-lapack-lib-dirs=%s" % " ".join(lapack.directories), - "--with-blas-libs=%s" % " ".join(blas.names), - "--with-blas-lib-dirs=%s" % " ".join(blas.directories), - ] + # Note: --with-(lapack|blas)_libs= needs space separated list of names + if spec.satisfies("+lapack"): + configure_args.append("--with-lapack") + configure_args.append("--with-blas") + configure_args.append("--with-lapack-libs=%s" % " ".join(spec["lapack"].libs.names)) + configure_args.append("--with-blas-libs=%s" % " ".join(spec["blas"].libs.names)) + configure_args.append( + "--with-lapack-lib-dirs=%s" % " ".join(spec["lapack"].libs.directories) + ) + configure_args.append( + "--with-blas-lib-dirs=%s" % " ".join(spec["blas"].libs.directories) + ) if spec.satisfies("+mpi"): os.environ["CC"] = spec["mpi"].mpicc @@ -245,7 +249,9 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage): configure_args.append("--without-superlu") # MLI and FEI do not build without superlu on Linux configure_args.append("--without-mli") - configure_args.append("--without-fei") + # FEI option was removed in hypre 2.17 + if self.version < Version("2.17.0"): + configure_args.append("--without-fei") if spec.satisfies("+superlu-dist"): configure_args.append( diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index f5d564854f..93692ef580 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -702,8 +702,10 @@ class Mfem(Package, CudaPackage, ROCmPackage): if "+mpi" in spec: options += ["MPICXX=%s" % spec["mpi"].mpicxx] hypre = spec["hypre"] - # The hypre package always links with 'blas' and 'lapack'. - all_hypre_libs = hypre.libs + hypre["lapack"].libs + hypre["blas"].libs + all_hypre_libs = hypre.libs + if "+lapack" in hypre: + all_hypre_libs += hypre["lapack"].libs + hypre["blas"].libs + hypre_gpu_libs = "" if "+cuda" in hypre: hypre_gpu_libs = " -lcusparse -lcurand -lcublas" |