summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-07-19 09:18:42 -0700
committerGitHub <noreply@github.com>2016-07-19 09:18:42 -0700
commit4ad29b6c9bde4ed8fdb7d932c199763edc78a16f (patch)
tree78dbcdcbf79ec7be55485d0a213c6cb6a4854119
parent7e16a4edd797c4913fce63dceb8ca093073fac9e (diff)
parent96e9dbca0828e0664c4c20d6223b94d8040fc1a6 (diff)
downloadspack-4ad29b6c9bde4ed8fdb7d932c199763edc78a16f.tar.gz
spack-4ad29b6c9bde4ed8fdb7d932c199763edc78a16f.tar.bz2
spack-4ad29b6c9bde4ed8fdb7d932c199763edc78a16f.tar.xz
spack-4ad29b6c9bde4ed8fdb7d932c199763edc78a16f.zip
Merge pull request #1262 from davydden/pkg/suite_sparse_fix_blas
suite-sparse: enable TBB and fix Blas/Lapack libs
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/package.py29
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch13
2 files changed, 29 insertions, 13 deletions
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
index 2cc89b843f..a71bfd8bd4 100644
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -32,21 +32,20 @@ class SuiteSparse(Package):
homepage = 'http://faculty.cse.tamu.edu/davis/suitesparse.html'
url = 'http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.1.tar.gz'
- version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319')
version('4.5.3', '8ec57324585df3c6483ad7f556afccbd')
+ version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319')
- # FIXME: (see below)
- # variant('tbb', default=True, description='Build with Intel TBB')
+ variant('tbb', default=True, description='Build with Intel TBB')
depends_on('blas')
depends_on('lapack')
depends_on('metis@5.1.0', when='@4.5.1:')
- # FIXME:
# in @4.5.1. TBB support in SPQR seems to be broken as TBB-related linkng
# flags does not seem to be used, which leads to linking errors on Linux.
- # Try re-enabling in future versions.
- # depends_on('tbb', when='+tbb')
+ depends_on('tbb', when='@4.5.3:+tbb')
+
+ patch('tbb_453.patch', when='@4.5.3')
def install(self, spec, prefix):
# The build system of SuiteSparse is quite old-fashioned.
@@ -73,20 +72,24 @@ class SuiteSparse(Package):
])
# Intel TBB in SuiteSparseQR
- if '+tbb' in spec:
+ if 'tbb' in spec:
make_args.extend([
'SPQR_CONFIG=-DHAVE_TBB',
'TBB=-L%s -ltbb' % spec['tbb'].prefix.lib,
])
- # BLAS arguments require path to libraries
- # FIXME: (blas/lapack always provide libblas and liblapack as aliases)
+ # Make sure Spack's Blas/Lapack is used. Otherwise System's
+ # Blas/Lapack might be picked up.
+ blas = to_link_flags(spec['blas'].blas_shared_lib)
+ lapack = to_link_flags(spec['lapack'].lapack_shared_lib)
if '@4.5.1' in spec:
# adding -lstdc++ is clearly an ugly way to do this, but it follows
# with the TCOV path of SparseSuite 4.5.1's Suitesparse_config.mk
- make_args.extend([
- 'BLAS=-lblas -lstdc++',
- 'LAPACK=-llapack'
- ])
+ blas += ' -lstdc++'
+
+ make_args.extend([
+ 'BLAS=%s' % blas,
+ 'LAPACK=%s' % lapack
+ ])
make('install', *make_args)
diff --git a/var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch b/var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch
new file mode 100644
index 0000000000..70241ed017
--- /dev/null
+++ b/var/spack/repos/builtin/packages/suite-sparse/tbb_453.patch
@@ -0,0 +1,13 @@
+diff --git a/SPQR/Lib/Makefile b/SPQR/Lib/Makefile
+index eaade58..d0de852 100644
+--- a/SPQR/Lib/Makefile
++++ b/SPQR/Lib/Makefile
+@@ -13,7 +13,7 @@ ccode: all
+ include ../../SuiteSparse_config/SuiteSparse_config.mk
+
+ # SPQR depends on CHOLMOD, AMD, COLAMD, LAPACK, the BLAS and SuiteSparse_config
+-LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(LAPACK) $(BLAS)
++LDLIBS += -lamd -lcolamd -lcholmod -lsuitesparseconfig $(TBB) $(LAPACK) $(BLAS)
+
+ # compile and install in SuiteSparse/lib
+ library: