Merge branch 'efischer/160309-HypreFix' of git://github.com/citibeth/spack into citibeth-efischer/160309-HypreFix
This commit is contained in:
		@@ -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")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user