hypre: don't hardcode blas/lapack/mpi; optionally run tests
This commit is contained in:
parent
992250ddea
commit
514c61b8fe
@ -46,21 +46,26 @@ class Hypre(Package):
|
|||||||
depends_on("lapack")
|
depends_on("lapack")
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
blas_dir = spec['blas'].prefix
|
os.environ['CC'] = spec['mpi'].mpicc
|
||||||
lapack_dir = spec['lapack'].prefix
|
os.environ['CXX'] = spec['mpi'].mpicxx
|
||||||
mpi_dir = spec['mpi'].prefix
|
os.environ['F77'] = spec['mpi'].mpif77
|
||||||
|
|
||||||
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')
|
|
||||||
|
|
||||||
|
|
||||||
|
# Since +shared does not build on macOS and also Atlas does not have
|
||||||
|
# a single static lib to build against, link against shared libs with
|
||||||
|
# a hope that --whole-archive linker option (or alike) was used
|
||||||
|
# to command the linker to include whole static libs' content into the
|
||||||
|
# shared lib
|
||||||
|
# Note: --with-(lapack|blas)_libs= needs space separated list of names
|
||||||
configure_args = [
|
configure_args = [
|
||||||
"--prefix=%s" % prefix,
|
'--prefix=%s' % prefix,
|
||||||
"--with-lapack-libs=lapack",
|
'--with-lapack-libs=%s' % to_lib_name(
|
||||||
"--with-lapack-lib-dirs=%s/lib" % lapack_dir,
|
spec['lapack'].lapack_shared_lib),
|
||||||
"--with-blas-libs=blas",
|
'--with-lapack-lib-dirs=%s/lib' % spec['lapack'].prefix,
|
||||||
"--with-blas-lib-dirs=%s/lib" % blas_dir]
|
'--with-blas-libs=%s' % to_lib_name(
|
||||||
|
spec['blas'].blas_shared_lib),
|
||||||
|
'--with-blas-lib-dirs=%s/lib' % spec['blas'].prefix
|
||||||
|
]
|
||||||
|
|
||||||
if '+shared' in self.spec:
|
if '+shared' in self.spec:
|
||||||
configure_args.append("--enable-shared")
|
configure_args.append("--enable-shared")
|
||||||
|
|
||||||
@ -76,4 +81,12 @@ def install(self, spec, prefix):
|
|||||||
configure(*configure_args)
|
configure(*configure_args)
|
||||||
|
|
||||||
make()
|
make()
|
||||||
|
if self.run_tests:
|
||||||
|
make("check")
|
||||||
|
make("test")
|
||||||
|
Executable(join_path('test', 'ij'))()
|
||||||
|
sstruct = Executable(join_path('test', 'struct'))
|
||||||
|
sstruct()
|
||||||
|
sstruct('-in', 'test/sstruct.in.default', '-solver', '40',
|
||||||
|
'-rhsone')
|
||||||
make("install")
|
make("install")
|
||||||
|
Loading…
Reference in New Issue
Block a user