hip@5.2.0 onwards: set prefix properly (#33257)

* hip-set-prefix-rocm5.2.0-onwards

* Update var/spack/repos/builtin/packages/hip/package.py

Update description

Co-authored-by: Satish Balay <balay@mcs.anl.gov>
This commit is contained in:
eugeneswalker 2022-10-14 08:12:07 -07:00 committed by GitHub
parent 67bc90acb7
commit c44934a44d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -288,10 +288,12 @@ def get_paths(self):
if self.spec.external:
# For external packages we only assume the `hip` prefix is known,
# because spack does not set prefixes of dependencies of externals.
# We assume self.spec.prefix is /opt/rocm-x.y.z/hip and rocm has a
# default installation with everything installed under
# /opt/rocm-x.y.z
rocm_prefix = Prefix(os.path.dirname(self.spec.prefix))
# We assume self.spec.prefix is /opt/rocm-x.y.z for rocm-5.2.0 and newer
# and /opt/rocm-x.y.z/hip for older versions
if self.spec.satisfies("@5.2.0:"):
rocm_prefix = Prefix(self.spec.prefix)
else:
rocm_prefix = Prefix(os.path.dirname(self.spec.prefix))
if not os.path.isdir(rocm_prefix):
msg = "Could not determine prefix for other rocm components\n"