hypre: add a variant to allow using internal lapack functions (#47780)
This commit is contained in:
parent
d28614151f
commit
69fb594699
@ -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 @@ def patch(self): # fix sequential compilation in 'src/seq_mv'
|
||||
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 @@ def url_for_version(self, version):
|
||||
|
||||
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 @@ def configure_args(self):
|
||||
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(
|
||||
|
@ -702,8 +702,10 @@ def find_optional_library(name, prefix):
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user