Skip to content

HACK: Handle ROCM installation layout of lib/llvm/bin/clang++. #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: amd-staging
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion clang/lib/Driver/ToolChains/AMDGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,17 @@ RocmInstallationDetector::getInstallationPathCandidates() {

// Some versions of the rocm llvm package install to /opt/rocm/llvm/bin
// Some versions of the aomp package install to /opt/rocm/aomp/bin
if (ParentName == "llvm" || ParentName.starts_with("aomp"))
if (ParentName == "llvm" || ParentName.starts_with("aomp")) {
ParentDir = llvm::sys::path::parent_path(ParentDir);
ParentName = llvm::sys::path::filename(ParentDir);

// Some versions of the rocm llvm package install to
// /opt/rocm/lib/llvm/bin, so also back up if within the lib dir still.
if (ParentName == "lib") {
ParentDir = llvm::sys::path::parent_path(ParentDir);
}
}

// Some versions of the aomp package install to /opt/rocm/aomp/bin
// and it seems ParentDir is already pointing to correct place.
return Candidate(ParentDir.str(), /*StrictChecking=*/true);
Expand Down
Loading