diff options
author | Mark W. Krentel <krentel@rice.edu> | 2022-03-14 05:30:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 04:30:55 -0600 |
commit | 4635c813e07c88836ef5109cd4bb84208ec05fb2 (patch) | |
tree | 7c850ce759d7540d68114fcbea28ea78597ae646 | |
parent | a4f9d4fa4a9e3c2635d56f6564b4731747b3dab1 (diff) | |
download | spack-4635c813e07c88836ef5109cd4bb84208ec05fb2.tar.gz spack-4635c813e07c88836ef5109cd4bb84208ec05fb2.tar.bz2 spack-4635c813e07c88836ef5109cd4bb84208ec05fb2.tar.xz spack-4635c813e07c88836ef5109cd4bb84208ec05fb2.zip |
hsa-rocr-dev, llvm-amdgpu: change dependency libelf to elf (#29408)
* hsa-rocr-dev, llvm-amdgpu: change dependency libelf to elf
Change the libelf dependency to the virtual elf for two rocm packages.
This allows other packages (hpctoolkit) to combine rocm and dyninst
(with elfutils) while still being able to build rocm with libelf when
needed, eg darwin.
* add comment describing include path for libelf vs elfutils
-rw-r--r-- | var/spack/repos/builtin/packages/hsa-rocr-dev/package.py | 10 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/llvm-amdgpu/package.py | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py b/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py index 115956502e..4e39ab274b 100644 --- a/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py +++ b/var/spack/repos/builtin/packages/hsa-rocr-dev/package.py @@ -4,6 +4,8 @@ # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + from spack import * @@ -43,7 +45,7 @@ class HsaRocrDev(CMakePackage): # Note, technically only necessary when='@3.7: +image', but added to all # to work around https://github.com/spack/spack/issues/23951 depends_on('xxd', when='+image', type='build') - depends_on('libelf@0.8:', type='link') + depends_on('elf', type='link') for ver in ['3.5.0', '3.7.0', '3.8.0', '3.9.0', '3.10.0', '4.0.0', '4.1.0', '4.2.0', '4.3.0', '4.3.1', '4.5.0', '4.5.2', 'master']: @@ -61,7 +63,11 @@ class HsaRocrDev(CMakePackage): def cmake_args(self): spec = self.spec - libelf_include = spec['libelf'].prefix.include.libelf + # hsa-rocr-dev wants the directory containing the header files, but + # libelf adds an extra path (include/libelf) compared to elfutils + libelf_include = os.path.dirname( + find_headers('libelf', spec['elf'].prefix.include, recursive=True)[0]) + args = [ self.define('LIBELF_INCLUDE_DIRS', libelf_include), self.define_from_variant('BUILD_SHARED_LIBS', 'shared') diff --git a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py index ab329bd23b..7da6846adc 100644 --- a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py +++ b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py @@ -63,7 +63,7 @@ class LlvmAmdgpu(CMakePackage): # openmp dependencies depends_on("perl-data-dumper", type=("build"), when='+openmp') depends_on("hwloc", when='+openmp') - depends_on('libelf', type='link', when='+openmp') + depends_on('elf', type='link', when='+openmp') # Will likely only be fixed in LLVM 12 upstream patch('fix-system-zlib-ncurses.patch', when='@3.5.0:3.8.0') |