Fixed issues with hypre:
1. --with-lapack-lib was wrong. 2. --with-MPI was wrong; set env vars for MPI wrappers instead. 3. Added version 2.10.1 4. Added shared library variant (True by default). Hypre can build shared or static libraries, but not both in the same build.
This commit is contained in:
parent
21181075b4
commit
5b22873b3d
@ -1,4 +1,5 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
import os
|
||||||
|
|
||||||
class Hypre(Package):
|
class Hypre(Package):
|
||||||
"""Hypre is a library of high performance preconditioners that
|
"""Hypre is a library of high performance preconditioners that
|
||||||
@ -8,8 +9,11 @@ class Hypre(Package):
|
|||||||
homepage = "http://computation.llnl.gov/project/linear_solvers/software.php"
|
homepage = "http://computation.llnl.gov/project/linear_solvers/software.php"
|
||||||
url = "http://computation.llnl.gov/project/linear_solvers/download/hypre-2.10.0b.tar.gz"
|
url = "http://computation.llnl.gov/project/linear_solvers/download/hypre-2.10.0b.tar.gz"
|
||||||
|
|
||||||
|
version('2.10.1', 'dc048c4cabb3cd549af72591474ad674')
|
||||||
version('2.10.0b', '768be38793a35bb5d055905b271f5b8e')
|
version('2.10.0b', '768be38793a35bb5d055905b271f5b8e')
|
||||||
|
|
||||||
|
variant('shared', default=True, description="Build shared library version (disables static library)")
|
||||||
|
|
||||||
depends_on("mpi")
|
depends_on("mpi")
|
||||||
depends_on("blas")
|
depends_on("blas")
|
||||||
depends_on("lapack")
|
depends_on("lapack")
|
||||||
@ -17,16 +21,26 @@ class Hypre(Package):
|
|||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
blas_dir = spec['blas'].prefix
|
blas_dir = spec['blas'].prefix
|
||||||
lapack_dir = spec['lapack'].prefix
|
lapack_dir = spec['lapack'].prefix
|
||||||
|
mpi_dir = spec['mpi'].prefix
|
||||||
|
|
||||||
|
os.environ['CC'] = os.path.join(mpi_dir, 'bin', 'mpicc')
|
||||||
|
os.environ['CXX'] = os.path.join(mpi_dir, 'bin', 'mpicxx')
|
||||||
|
os.environ['F77'] = os.path.join(mpi_dir, 'bin', 'mpif77')
|
||||||
|
|
||||||
|
|
||||||
|
configure_args = [
|
||||||
|
"--prefix=%s" % prefix,
|
||||||
|
"--with-lapack-libs=lapack",
|
||||||
|
"--with-lapack-lib-dirs=%s/lib" % lapack_dir,
|
||||||
|
"--with-blas-libs=blas",
|
||||||
|
"--with-blas-lib-dirs=%s/lib" % blas_dir]
|
||||||
|
if '+shared' in self.spec:
|
||||||
|
configure_args.append("--enable-shared")
|
||||||
|
|
||||||
# Hypre's source is staged under ./src so we'll have to manually
|
# Hypre's source is staged under ./src so we'll have to manually
|
||||||
# cd into it.
|
# cd into it.
|
||||||
with working_dir("src"):
|
with working_dir("src"):
|
||||||
configure(
|
configure(*configure_args)
|
||||||
"--prefix=%s" % prefix,
|
|
||||||
"--with-blas-libs=blas",
|
|
||||||
"--with-blas-lib-dirs=%s/lib" % blas_dir,
|
|
||||||
"--with-lapack-libs=\"lapack blas\"",
|
|
||||||
"--with-lapack-lib-dirs=%s/lib" % lapack_dir,
|
|
||||||
"--with-MPI")
|
|
||||||
make()
|
make()
|
||||||
make("install")
|
make("install")
|
||||||
|
Loading…
Reference in New Issue
Block a user