summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hypre/package.py28
1 files changed, 21 insertions, 7 deletions
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py
index 0f7f14dd89..242ee100d7 100644
--- a/var/spack/repos/builtin/packages/hypre/package.py
+++ b/var/spack/repos/builtin/packages/hypre/package.py
@@ -1,4 +1,5 @@
from spack import *
+import os
class Hypre(Package):
"""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"
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')
+ variant('shared', default=True, description="Build shared library version (disables static library)")
+
depends_on("mpi")
depends_on("blas")
depends_on("lapack")
@@ -17,16 +21,26 @@ class Hypre(Package):
def install(self, spec, prefix):
blas_dir = spec['blas'].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
# cd into it.
with working_dir("src"):
- configure(
- "--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")
+ configure(*configure_args)
+
make()
make("install")