spack/var/spack/repos/builtin/packages/hypre/package.py

53 lines
1.9 KiB
Python
Raw Normal View History

2015-05-28 08:39:17 +08:00
from spack import *
import os, sys
2015-05-28 08:39:17 +08:00
class Hypre(Package):
2015-06-07 08:20:33 +08:00
"""Hypre is a library of high performance preconditioners that
features parallel multigrid methods for both structured and
unstructured grid problems."""
2015-05-28 08:39:17 +08:00
2015-11-24 05:00:10 +08:00
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"
2015-05-28 08:39:17 +08:00
version('2.10.1', 'dc048c4cabb3cd549af72591474ad674')
2015-05-28 08:39:17 +08:00
version('2.10.0b', '768be38793a35bb5d055905b271f5b8e')
# hypre does not know how to build shared libraries on Darwin
variant('shared', default=sys.platform!='darwin', description="Build shared library version (disables static library)")
# SuperluDist have conflicting headers with those in Hypre
variant('internal-superlu', default=True, description="Use internal Superlu routines")
2015-06-07 08:20:33 +08:00
depends_on("mpi")
2015-05-28 08:39:17 +08:00
depends_on("blas")
depends_on("lapack")
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")
2015-05-28 08:39:17 +08:00
if '~internal-superlu' in self.spec:
configure_args.append("--without-superlu")
2015-06-07 08:20:33 +08:00
# Hypre's source is staged under ./src so we'll have to manually
2015-05-28 08:39:17 +08:00
# cd into it.
2015-06-07 08:20:33 +08:00
with working_dir("src"):
configure(*configure_args)
2015-06-07 08:20:33 +08:00
make()
make("install")