summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbecker33 <becker33@llnl.gov>2016-08-02 11:50:42 -0700
committerGitHub <noreply@github.com>2016-08-02 11:50:42 -0700
commit4ff4eab4764a74645ee7112a0c13c3f0498efc01 (patch)
tree3d2c206c470f77c0888bbb31c9a179487bf228a9
parent13d9eed85bd84f41250562f82054d35346015aae (diff)
parentf90692cf812ba9313c66dee405dee7d0e47535d3 (diff)
downloadspack-4ff4eab4764a74645ee7112a0c13c3f0498efc01.tar.gz
spack-4ff4eab4764a74645ee7112a0c13c3f0498efc01.tar.bz2
spack-4ff4eab4764a74645ee7112a0c13c3f0498efc01.tar.xz
spack-4ff4eab4764a74645ee7112a0c13c3f0498efc01.zip
Merge pull request #1236 from davydden/pkg/arpack-ng_blas
arpack-ng: fix blas/lapack libraries
-rw-r--r--var/spack/repos/builtin/packages/arpack-ng/package.py39
1 files changed, 30 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py
index d5dc703c06..2874930cdd 100644
--- a/var/spack/repos/builtin/packages/arpack-ng/package.py
+++ b/var/spack/repos/builtin/packages/arpack-ng/package.py
@@ -86,10 +86,19 @@ class ArpackNg(Package):
options.extend(std_cmake_args)
options.append('-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix)
- # TODO:
- # Arpack calls directly find_package(BLAS REQUIRED) and
- # find_package(LAPACK REQUIRED). Make sure correct Blas/Lapack are
- # picked up.
+ # Make sure we use Spack's blas/lapack:
+ options.extend([
+ '-DLAPACK_FOUND=true',
+ '-DLAPACK_INCLUDE_DIRS=%s' % spec['lapack'].prefix.include,
+ '-DLAPACK_LIBRARIES=%s' % (
+ spec['lapack'].lapack_shared_lib if '+shared' in spec else
+ spec['lapack'].lapack_static_lib),
+ '-DBLAS_FOUND=true',
+ '-DBLAS_INCLUDE_DIRS=%s' % spec['blas'].prefix.include,
+ '-DBLAS_LIBRARIES=%s' % (
+ spec['blas'].blas_shared_lib if '+shared' in spec else
+ spec['blas'].blas_static_lib)
+ ])
if '+mpi' in spec:
options.append('-DMPI=ON')
@@ -101,9 +110,8 @@ class ArpackNg(Package):
cmake('.', *options)
make()
- # TODO: make test does not work
- # make('test')
-
+ if self.run_tests:
+ make('test')
make('install')
@when('@3.3.0')
@@ -120,10 +128,23 @@ class ArpackNg(Package):
'F77=%s' % spec['mpi'].mpif77
])
- if '~shared' in spec:
- options.append('--enable-shared=no')
+ if '+shared' in spec:
+ options.extend([
+ '--with-blas=%s' % to_link_flags(
+ spec['blas'].blas_shared_lib),
+ '--with-lapack=%s' % to_link_flags(
+ spec['lapack'].lapack_shared_lib)
+ ])
+ else:
+ options.extend([
+ '--with-blas=%s' % spec['blas'].blas_static_lib,
+ '--with-lapack=%s' % spec['lapack'].lapack_static_lib,
+ '--enable-shared=no'
+ ])
bootstrap()
configure(*options)
make()
+ if self.run_tests:
+ make('check')
make('install')