Fail gracefully detecting hdf5 if pkg-config is not available.
@@ -33,6 +33,7 @@ class HDF5Dependency(ExternalDependency):
# 1. pkg-config
pkgconfig_files = ['hdf5', 'hdf5-serial']
# some distros put hdf5-1.2.3.pc with version number in .pc filename.
+ try:
ret = subprocess.run(['pkg-config', '--list-all'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
universal_newlines=True)
if ret.returncode == 0:
@@ -40,7 +41,9 @@ class HDF5Dependency(ExternalDependency):
if pkg.startswith(('hdf5')):
pkgconfig_files.append(pkg.split(' ', 1)[0])
pkgconfig_files = list(set(pkgconfig_files)) # dedupe
-
+ except FileNotFoundError:
+ # pkg-config was not available
+ pass
if language not in ('c', 'cpp', 'fortran'):
raise DependencyException('Language {} is not supported with HDF5.'.format(language))
