summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorVeselin Dobrev <v-dobrev@users.noreply.github.com>2018-03-22 17:43:23 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2018-03-22 19:43:23 -0500
commit3858d4a3a354facf4bce66567c07d2d229f9d98a (patch)
tree36ee35086d620fccada57f3d4da80dfca925e1f2 /var
parent2e4378bcd035c9910a4565d791fcdbdab0afffd8 (diff)
downloadspack-3858d4a3a354facf4bce66567c07d2d229f9d98a.tar.gz
spack-3858d4a3a354facf4bce66567c07d2d229f9d98a.tar.bz2
spack-3858d4a3a354facf4bce66567c07d2d229f9d98a.tar.xz
spack-3858d4a3a354facf4bce66567c07d2d229f9d98a.zip
[hypre] add the 'headers' property (#7278)
* [hypre] Add the 'headers' property plus a small tweak in the 'libs' property. * [hypre] Add fallbacks for searching for '.libs' in 'prefix.lib64' and in all of 'prefix'. * [hypre] Fix style. * [hypre] Use find_headers instead of find + HeaderList.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hypre/package.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/hypre/package.py b/var/spack/repos/builtin/packages/hypre/package.py
index d17da61a1b..6f41e3840b 100644
--- a/var/spack/repos/builtin/packages/hypre/package.py
+++ b/var/spack/repos/builtin/packages/hypre/package.py
@@ -111,7 +111,25 @@ class Hypre(Package):
make("install")
@property
+ def headers(self):
+ """Export the main hypre header, HYPRE.h; all other headers can be found
+ in the same directory.
+ Sample usage: spec['hypre'].headers.cpp_flags
+ """
+ hdrs = find_headers('HYPRE', self.prefix.include, recursive=False)
+ return hdrs or None
+
+ @property
def libs(self):
- is_shared = self.spec.satisfies('+shared')
- return find_libraries('libHYPRE', root=self.prefix,
- shared=is_shared, recursive=True)
+ """Export the hypre library.
+ Sample usage: spec['hypre'].libs.ld_flags
+ """
+ search_paths = [[self.prefix.lib, False], [self.prefix.lib64, False],
+ [self.prefix, True]]
+ is_shared = '+shared' in self.spec
+ for path, recursive in search_paths:
+ libs = find_libraries('libHYPRE', root=path,
+ shared=is_shared, recursive=recursive)
+ if libs:
+ return libs
+ return None