summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-07-18 03:06:37 -0700
committerGitHub <noreply@github.com>2016-07-18 03:06:37 -0700
commitb3789a469317ccb0fbbe73d6ab1f883be41a35ab (patch)
treeddbdeacfad43d51e1a8439d0de21784c2a038009 /var
parent4030f8d7c39214b0539dfe4961f24993bb338fa7 (diff)
parent9ea4f80f154f264986dcadf9de4dd192b8dce037 (diff)
downloadspack-b3789a469317ccb0fbbe73d6ab1f883be41a35ab.tar.gz
spack-b3789a469317ccb0fbbe73d6ab1f883be41a35ab.tar.bz2
spack-b3789a469317ccb0fbbe73d6ab1f883be41a35ab.tar.xz
spack-b3789a469317ccb0fbbe73d6ab1f883be41a35ab.zip
Merge pull request #1269 from davydden/pkg/hypre_trilinos_blas
Pkg/hypre trilinos blas
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hypre/package.py45
-rw-r--r--var/spack/repos/builtin/packages/trilinos/package.py7
2 files changed, 35 insertions, 17 deletions
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py
index f87dae9f4e..65fef57559 100644
--- a/var/spack/repos/builtin/packages/hypre/package.py
+++ b/var/spack/repos/builtin/packages/hypre/package.py
@@ -23,7 +23,9 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
from spack import *
-import os, sys
+import os
+import sys
+
class Hypre(Package):
"""Hypre is a library of high performance preconditioners that
@@ -37,7 +39,7 @@ class Hypre(Package):
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)")
+ 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")
@@ -46,21 +48,26 @@ class Hypre(Package):
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')
-
+ os.environ['CC'] = spec['mpi'].mpicc
+ os.environ['CXX'] = spec['mpi'].mpicxx
+ os.environ['F77'] = spec['mpi'].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 = [
- "--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]
+ '--prefix=%s' % prefix,
+ '--with-lapack-libs=%s' % to_lib_name(
+ spec['lapack'].lapack_shared_lib),
+ '--with-lapack-lib-dirs=%s/lib' % spec['lapack'].prefix,
+ '--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:
configure_args.append("--enable-shared")
@@ -76,4 +83,12 @@ class Hypre(Package):
configure(*configure_args)
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")
diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py
index 56499af8d9..77589bb8f9 100644
--- a/var/spack/repos/builtin/packages/trilinos/package.py
+++ b/var/spack/repos/builtin/packages/trilinos/package.py
@@ -118,6 +118,7 @@ class Trilinos(Package):
options.extend(std_cmake_args)
mpi_bin = spec['mpi'].prefix.bin
+ # Note: -DXYZ_LIBRARY_NAMES= needs semicolon separated list of names
options.extend([
'-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON',
'-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON',
@@ -131,10 +132,12 @@ class Trilinos(Package):
'-DTPL_ENABLE_MPI:BOOL=ON',
'-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix,
'-DTPL_ENABLE_BLAS=ON',
- '-DBLAS_LIBRARY_NAMES=blas', # FIXME: don't hardcode names
+ '-DBLAS_LIBRARY_NAMES=%s' % to_lib_name(
+ spec['blas'].blas_shared_lib),
'-DBLAS_LIBRARY_DIRS=%s' % spec['blas'].prefix.lib,
'-DTPL_ENABLE_LAPACK=ON',
- '-DLAPACK_LIBRARY_NAMES=lapack',
+ '-DLAPACK_LIBRARY_NAMES=%s' % to_lib_name(
+ spec['lapack'].lapack_shared_lib),
'-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix,
'-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON',
'-DTrilinos_ENABLE_CXX11:BOOL=ON',