summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreugeneswalker <38933153+eugeneswalker@users.noreply.github.com>2020-11-01 19:52:06 -0800
committerGitHub <noreply@github.com>2020-11-01 21:52:06 -0600
commitb2d6c634216a0ee2f0532372456ad389dd6fb427 (patch)
tree7e30cfb8fee7f12165e3ec9b001f3b199e40613f
parenta80d221bfa1c9be4b2b9eff9f057edf62c34e50b (diff)
downloadspack-b2d6c634216a0ee2f0532372456ad389dd6fb427.tar.gz
spack-b2d6c634216a0ee2f0532372456ad389dd6fb427.tar.bz2
spack-b2d6c634216a0ee2f0532372456ad389dd6fb427.tar.xz
spack-b2d6c634216a0ee2f0532372456ad389dd6fb427.zip
hip: setup run environments (#19637)
* hip: rocminfo is a runtime requirement * hip: +setup_run_environment, +setup_dependent_run_environment * hip: run environment: get lib dir using libs.directories[0], not prefix.lib Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/hip/package.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py
index 7b93dcfda2..0487ebd182 100644
--- a/var/spack/repos/builtin/packages/hip/package.py
+++ b/var/spack/repos/builtin/packages/hip/package.py
@@ -32,7 +32,7 @@ class Hip(CMakePackage):
depends_on('comgr@' + ver, type=('build', 'link', 'run'), when='@' + ver)
depends_on('llvm-amdgpu@' + ver, type='build', when='@' + ver)
depends_on('rocm-device-libs@' + ver, type=('build', 'link', 'run'), when='@' + ver)
- depends_on('rocminfo@' + ver, type='build', when='@' + ver)
+ depends_on('rocminfo@' + ver, type=('build', 'run'), when='@' + ver)
# Notice: most likely this will only be a hard dependency on 3.7.0
depends_on('numactl', when='@3.7.0:')
@@ -48,6 +48,19 @@ class Hip(CMakePackage):
# See https://github.com/ROCm-Developer-Tools/HIP/pull/2141
patch('0002-Fix-detection-of-HIP_CLANG_ROOT.patch', when='@3.5.0:')
+ def setup_run_environment(self, env):
+ env.set('ROCM_PATH', '')
+ env.set('HIP_COMPILER', 'clang')
+ env.set('HIP_PLATFORM', 'hcc')
+ env.set('HIP_CLANG_PATH', self.spec['llvm-amdgpu'].prefix.bin)
+ env.set('HSA_PATH', self.spec['hsa-rocr-dev'].prefix)
+ env.set('ROCMINFO_PATH', self.spec['rocminfo'].prefix)
+ env.set('DEVICE_LIB_PATH',
+ self.spec['rocm-device-libs'].libs.directories[0])
+
+ def setup_dependent_run_environment(self, env, dependent_spec):
+ self.setup_run_environment(env)
+
def get_rocm_prefix_info(self):
# External packages in Spack do not currently contain dependency
# information. External installations of hip therefore must compute