Working Hypre, PARPACK.

This commit is contained in:
Todd Gamblin 2015-06-06 17:20:33 -07:00
parent 5294e2b9b9
commit d266bf0184
3 changed files with 48 additions and 30 deletions

View File

@ -30,10 +30,12 @@ def patch(self):
makefile.filter('^LAPACKdir.*', 'LAPACKdir = %s' % self.spec['lapack'].prefix)
# build the library in our own prefix.
makefile.filter('^ARPACKLIB.*', 'ARPACKLIB = %s/lib/libarpack.a' % self.prefix)
makefile.filter('^ARPACKLIB.*', 'ARPACKLIB = %s/libarpack.a' % os.getcwd())
def install(self, spec, prefix):
mkdirp(self.prefix.lib)
with working_dir('SRC'):
make('all')
mkdirp(prefix.lib)
install('libarpack.a', prefix.lib)

View File

@ -1,15 +1,16 @@
from spack import *
class Hypre(Package):
"""Hypre is a library of high performance preconditioners that features parallel multigrid
methods for both structured and unstructured grid problems."""
"""Hypre is a library of high performance preconditioners that
features parallel multigrid methods for both structured and
unstructured grid problems."""
homepage = "https://computation.llnl.gov/project/linear_solvers/software.php"
url = "https://computation.llnl.gov/project/linear_solvers/download/hypre-2.10.0b.tar.gz"
version('2.10.0b', '768be38793a35bb5d055905b271f5b8e')
depends_on("openmpi")
depends_on("mpi")
depends_on("blas")
depends_on("lapack")
@ -19,8 +20,7 @@ def install(self, spec, prefix):
# Hypre's source is staged under ./src so we'll have to manually
# cd into it.
cd("./src")
with working_dir("src"):
configure(
"--prefix=%s" % prefix,
"--with-blas-libs=blas",
@ -28,6 +28,5 @@ def install(self, spec, prefix):
"--with-lapack-libs=\"lapack blas\"",
"--with-lapack-lib-dirs=%s/lib" % lapack_dir,
"--with-MPI")
make()
make("install")

View File

@ -1,4 +1,6 @@
from spack import *
import os
import shutil
class Parpack(Package):
"""ARPACK is a collection of Fortran77 subroutines designed to solve large
@ -9,18 +11,33 @@ class Parpack(Package):
version('96', 'a175f70ff71837a33ff7e4b0b6054f43')
depends_on('mpi')
depends_on('blas')
depends_on('lapack')
def patch(self):
# Filter the CJ makefile to make a spack one.
shutil.move('ARMAKES/ARmake.CJ', 'ARmake.inc')
mf = FileFilter('ARmake.inc')
# Be sure to use Spack F77 wrapper
mf.filter('^FC.*', 'FC = f77')
mf.filter('^FFLAGS.*', 'FFLAGS = -O2 -g')
# Set up some variables.
mf.filter('^PLAT.*', 'PLAT = ')
mf.filter('^home.*', 'home = %s' % os.getcwd())
mf.filter('^BLASdir.*', 'BLASdir = %s' % self.spec['blas'].prefix)
mf.filter('^LAPACKdir.*', 'LAPACKdir = %s' % self.spec['lapack'].prefix)
mf.filter('^MAKE.*', 'MAKE = make')
# build the library in our own prefix.
mf.filter('^ARPACKLIB.*', 'PARPACKLIB = %s/libparpack.a' % os.getcwd())
def install(self, spec, prefix):
move("./ARMAKES/ARmake.CJ", "./ARmake.inc");
filter_file('home = /home1/Netlib/ARPACK', 'home = %s' % pwd(), './ARmake.inc', string=True)
filter_file('PLAT = CJ', 'PLAT = ', './ARmake.inc', string=True)
filter_file('LAPACKdir = $(home)/LAPACK', 'LAPACKLIB = %s' % spec['lapack'].prefix, './ARmake.inc', string=True)
filter_file('BLASdir = $(home)/BLAS', 'BLASLIB = %s' % spec['blas'].prefix, './ARmake.inc', string=True)
filter_file('ARPACKLIB = $(home)/libarpack_$(PLAT).a', 'ARPACKLIB = %s/libarpack.a' % prefix, './ARmake.inc', string=True)
filter_file('MAKE = /bin/make', 'MAKE = make', './ARmake.inc', string=True)
filter_file('FFLAGS', '#FFLAGS', './ARmake.inc', string=True)
filter_file('FC = f77', 'FC = gfortran', './ARmake.inc', string=True)
cd('./PARPACK/SRC/MPI')
with working_dir('PARPACK/SRC/MPI'):
make('all')
mkdirp(prefix.lib)
install('libparpack.a', prefix.lib)