[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.
This commit is contained in:
Veselin Dobrev 2018-03-22 17:43:23 -07:00 committed by Adam J. Stewart
parent 2e4378bcd0
commit 3858d4a3a3

View File

@ -110,8 +110,26 @@ def install(self, spec, prefix):
'-rhsone') '-rhsone')
make("install") 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 @property
def libs(self): def libs(self):
is_shared = self.spec.satisfies('+shared') """Export the hypre library.
return find_libraries('libHYPRE', root=self.prefix, Sample usage: spec['hypre'].libs.ld_flags
shared=is_shared, recursive=True) """
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