From c9e46a29132c412c78f52d871f6c2e2edb9031d3 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 12 Sep 2017 05:47:05 +0200 Subject: [PATCH] dealii: explicitly specify bzip2 libs (#5337) * dealii: explicitly specify bzip2 libs * bzip2: add libs() property --- var/spack/repos/builtin/packages/bzip2/package.py | 8 ++++++++ var/spack/repos/builtin/packages/dealii/package.py | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/bzip2/package.py b/var/spack/repos/builtin/packages/bzip2/package.py index d42f7c2bb6..6394aaccb2 100644 --- a/var/spack/repos/builtin/packages/bzip2/package.py +++ b/var/spack/repos/builtin/packages/bzip2/package.py @@ -40,6 +40,14 @@ class Bzip2(Package): variant('shared', default=True, description='Enables the build of shared libraries.') + # override default implementation + @property + def libs(self): + shared = '+shared' in self.spec + return find_libraries( + 'libbz2', root=self.prefix, shared=shared, recurse=True + ) + def patch(self): # bzip2 comes with two separate Makefiles for static and dynamic builds # Tell both to use Spack's compiler wrapper instead of GCC diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 2441796bf5..60d82528af 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -166,7 +166,10 @@ def cmake_args(self): '-DDEAL_II_COMPONENT_EXAMPLES=ON', '-DDEAL_II_WITH_THREADS:BOOL=ON', '-DBOOST_DIR=%s' % spec['boost'].prefix, - '-DBZIP2_DIR=%s' % spec['bzip2'].prefix, + # Cmake may still pick up system's bzip2, fix this: + '-DBZIP2_FOUND=true', + '-DBZIP2_INCLUDE_DIRS=%s' % spec['bzip2'].prefix.include, + '-DBZIP2_LIBRARIES=%s' % spec['bzip2'].libs.joined(';'), # CMake's FindBlas/Lapack may pickup system's blas/lapack instead # of Spack's. Be more specific to avoid this. # Note that both lapack and blas are provided in -DLAPACK_XYZ.