Fix HPL build, convert to MakefilePackage (#3777)

* Fix HPL build, convert to MakefilePackage

* Flake8 fix

* Fix: spec -> self.spec

* Properly query for system libraries

* Update Intel-MKL as well

* Recurse in system libs, fix MKL path, fixes lapack_libs
This commit is contained in:
Adam J. Stewart
2017-04-21 12:11:29 -05:00
committed by GitHub
parent 41efada340
commit 5250e8ee89
4 changed files with 118 additions and 41 deletions

View File

@@ -47,6 +47,7 @@
'copy_mode',
'filter_file',
'find_libraries',
'find_system_libraries',
'fix_darwin_install_name',
'force_remove',
'force_symlink',
@@ -583,6 +584,54 @@ def __str__(self):
return self.joined()
def find_system_libraries(args, shared=True):
"""Searches the usual system library locations for the libraries
specified in args.
Search order is as follows:
1. /lib64
2. /lib
3. /usr/lib64
4. /usr/lib
5. /usr/local/lib64
6. /usr/local/lib
:param args: Library name(s) to search for
:type args: str or collections.Sequence
:param bool shared: if True searches for shared libraries,
:returns: The libraries that have been found
:rtype: LibraryList
"""
if isinstance(args, str):
args = [args]
elif not isinstance(args, collections.Sequence):
message = '{0} expects a string or sequence of strings as the '
message += 'first argument [got {1} instead]'
message = message.format(find_system_libraries.__name__, type(args))
raise TypeError(message)
libraries_found = []
search_locations = [
'/lib64',
'/lib',
'/usr/lib64',
'/usr/lib',
'/usr/local/lib64',
'/usr/local/lib',
]
for library in args:
for root in search_locations:
result = find_libraries(library, root, shared, recurse=True)
if result:
libraries_found += result
break
return libraries_found
def find_libraries(args, root, shared=True, recurse=False):
"""Returns an iterable object containing a list of full paths to
libraries if found.