summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorElizabeth F <rpf2116@columbia.edu>2016-03-09 00:18:20 -0500
committerElizabeth F <rpf2116@columbia.edu>2016-03-09 00:27:25 -0500
commit5b22873b3dce37c0d7bad418bf6e0b73d381d19e (patch)
treeda180e9bc5d34796b6e937b92b9d356b60e35c59 /var
parent21181075b40367b3fa9891c51930c7aedcfab4bf (diff)
downloadspack-5b22873b3dce37c0d7bad418bf6e0b73d381d19e.tar.gz
spack-5b22873b3dce37c0d7bad418bf6e0b73d381d19e.tar.bz2
spack-5b22873b3dce37c0d7bad418bf6e0b73d381d19e.tar.xz
spack-5b22873b3dce37c0d7bad418bf6e0b73d381d19e.zip
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.
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")