Fixed a bug where the external HIP library is found in a nested directory, even on newer releases of ROCm. (#33772)

This commit is contained in:
Brian Van Essen 2022-11-10 23:32:55 -08:00 committed by GitHub
parent d25375da55
commit 3437926cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -291,8 +291,13 @@ def get_paths(self):
hip_libs_at_top = os.path.basename(self.spec.prefix) != "hip"
# 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
# However, depending on how an external is found it can be at either level
# of the installation path
if self.spec.satisfies("@5.2.0:"):
rocm_prefix = Prefix(self.spec.prefix)
if hip_libs_at_top:
rocm_prefix = Prefix(self.spec.prefix)
else:
rocm_prefix = Prefix(os.path.dirname(self.spec.prefix))
else:
# We assume self.spec.prefix is /opt/rocm-x.y.z/hip and rocm has a
# default installation with everything installed under