hwloc: added support to find external (#28348)

This commit is contained in:
Brian Van Essen 2022-01-15 15:44:13 -08:00 committed by GitHub
parent 415d662ec0
commit b8d159c62d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
import sys
@ -28,6 +29,7 @@ class Hwloc(AutotoolsPackage):
git = 'https://github.com/open-mpi/hwloc.git'
maintainers = ['bgoglin']
executables = ['^hwloc-bind$']
version('master', branch='master')
version('2.7.0', sha256='d9b23e9b0d17247e8b50254810427ca8a9857dc868e2e3a049f958d7c66af374')
@ -122,6 +124,13 @@ class Hwloc(AutotoolsPackage):
# variant of llvm-amdgpu depends on hwloc.
depends_on('llvm-amdgpu~openmp', when='+opencl')
@classmethod
def determine_version(cls, exe):
output = Executable(exe)('--version', output=str, error=str)
match = re.search(r'hwloc-bind (\S+)',
output)
return match.group(1) if match else None
def url_for_version(self, version):
return "http://www.open-mpi.org/software/hwloc/v%s/downloads/hwloc-%s.tar.gz" % (version.up_to(2), version)