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"
|
git = "https://github.com/hypre-space/hypre.git"
|
||||||
tags = ["e4s", "radiuss"]
|
tags = ["e4s", "radiuss"]
|
||||||
|
|
||||||
maintainers("ulrikeyang", "osborn9", "balay")
|
maintainers("ulrikeyang", "osborn9", "victorapm", "balay")
|
||||||
|
|
||||||
test_requires_compiler = True
|
test_requires_compiler = True
|
||||||
|
|
||||||
@ -74,6 +74,7 @@ class Hypre(AutotoolsPackage, CudaPackage, ROCmPackage):
|
|||||||
variant(
|
variant(
|
||||||
"superlu-dist", default=False, description="Activates support for SuperLU_Dist library"
|
"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("int64", default=False, description="Use 64bit integers")
|
||||||
variant("mixedint", default=False, description="Use 64bit integers while reducing memory use")
|
variant("mixedint", default=False, description="Use 64bit integers while reducing memory use")
|
||||||
variant("complex", default=False, description="Use complex values")
|
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")
|
filter_file("\tmake", "\t$(MAKE)", "src/seq_mv/Makefile")
|
||||||
|
|
||||||
depends_on("mpi", when="+mpi")
|
depends_on("mpi", when="+mpi")
|
||||||
depends_on("blas")
|
depends_on("blas", when="+lapack")
|
||||||
depends_on("lapack")
|
depends_on("lapack", when="+lapack")
|
||||||
depends_on("magma", when="+magma")
|
depends_on("magma", when="+magma")
|
||||||
depends_on("superlu-dist", when="+superlu-dist+mpi")
|
depends_on("superlu-dist", when="+superlu-dist+mpi")
|
||||||
depends_on("rocsparse", when="+rocm")
|
depends_on("rocsparse", when="+rocm")
|
||||||
@ -198,17 +199,20 @@ def url_for_version(self, version):
|
|||||||
|
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
spec = self.spec
|
spec = self.spec
|
||||||
# Note: --with-(lapack|blas)_libs= needs space separated list of names
|
configure_args = [f"--prefix={prefix}"]
|
||||||
lapack = spec["lapack"].libs
|
|
||||||
blas = spec["blas"].libs
|
|
||||||
|
|
||||||
configure_args = [
|
# Note: --with-(lapack|blas)_libs= needs space separated list of names
|
||||||
"--prefix=%s" % prefix,
|
if spec.satisfies("+lapack"):
|
||||||
"--with-lapack-libs=%s" % " ".join(lapack.names),
|
configure_args.append("--with-lapack")
|
||||||
"--with-lapack-lib-dirs=%s" % " ".join(lapack.directories),
|
configure_args.append("--with-blas")
|
||||||
"--with-blas-libs=%s" % " ".join(blas.names),
|
configure_args.append("--with-lapack-libs=%s" % " ".join(spec["lapack"].libs.names))
|
||||||
"--with-blas-lib-dirs=%s" % " ".join(blas.directories),
|
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"):
|
if spec.satisfies("+mpi"):
|
||||||
os.environ["CC"] = spec["mpi"].mpicc
|
os.environ["CC"] = spec["mpi"].mpicc
|
||||||
@ -245,7 +249,9 @@ def configure_args(self):
|
|||||||
configure_args.append("--without-superlu")
|
configure_args.append("--without-superlu")
|
||||||
# MLI and FEI do not build without superlu on Linux
|
# MLI and FEI do not build without superlu on Linux
|
||||||
configure_args.append("--without-mli")
|
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"):
|
if spec.satisfies("+superlu-dist"):
|
||||||
configure_args.append(
|
configure_args.append(
|
||||||
|
@ -702,8 +702,10 @@ def find_optional_library(name, prefix):
|
|||||||
if "+mpi" in spec:
|
if "+mpi" in spec:
|
||||||
options += ["MPICXX=%s" % spec["mpi"].mpicxx]
|
options += ["MPICXX=%s" % spec["mpi"].mpicxx]
|
||||||
hypre = spec["hypre"]
|
hypre = spec["hypre"]
|
||||||
# The hypre package always links with 'blas' and 'lapack'.
|
all_hypre_libs = hypre.libs
|
||||||
all_hypre_libs = hypre.libs + hypre["lapack"].libs + hypre["blas"].libs
|
if "+lapack" in hypre:
|
||||||
|
all_hypre_libs += hypre["lapack"].libs + hypre["blas"].libs
|
||||||
|
|
||||||
hypre_gpu_libs = ""
|
hypre_gpu_libs = ""
|
||||||
if "+cuda" in hypre:
|
if "+cuda" in hypre:
|
||||||
hypre_gpu_libs = " -lcusparse -lcurand -lcublas"
|
hypre_gpu_libs = " -lcusparse -lcurand -lcublas"
|
||||||
|
Loading…
Reference in New Issue
Block a user