spack/var/spack/repos/builtin/packages/hipcc/0014-remove-compiler-rt-linkage-for-host.6.0.patch
afzpatel b9cbd15674
hipcc: new package for HIP (#43245)
* initial commit to add hipcc package
* restore setup_dependent_package
2024-03-27 21:05:50 -05:00

32 lines
1.3 KiB
Diff

diff --git a/bin/hipcc.pl b/bin/hipcc.pl
index 513a427..cd2d6ac 100755
--- a/bin/hipcc.pl
+++ b/bin/hipcc.pl
@@ -160,11 +160,14 @@ if ($HIP_PLATFORM eq "amd") {
if($isWindows) {
$execExtension = ".exe";
}
- $HIPCC=get_normalized_path("$HIP_CLANG_PATH/clang++" . $execExtension);
+ # llvm_path is set inside the hip recipe
+ $LLVM_PATH= $ENV{'LLVM_PATH'};
+ $HIPCC="${LLVM_PATH}/bin/clang++" . $execExtension;
# If $HIPCC clang++ is not compiled, use clang instead
if ( ! -e $HIPCC ) {
- $HIPCC=get_normalized_path("$HIP_CLANG_PATH/clang" . $execExtension);
+ $LLVM_PATH= $ENV{'LLVM_PATH'};
+ $HIPCC="${LLVM_PATH}/bin/clang" . $execExtension;
$HIPLDFLAGS = "--driver-mode=g++";
}
# to avoid using dk linker or MSVC linker
@@ -484,7 +487,8 @@ if($HIP_PLATFORM eq "amd"){
$targetsStr = $ENV{HCC_AMDGPU_TARGET};
} elsif (not $isWindows) {
# Else try using rocm_agent_enumerator
- $ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
+ $ROCMINFO_PATH = $ENV{'ROCMINFO_PATH'} // $ROCMINFO_PATH;
+ $ROCM_AGENT_ENUM = "${ROCMINFO_PATH}/bin/rocm_agent_enumerator";
$targetsStr = `${ROCM_AGENT_ENUM} -t GPU`;
$targetsStr =~ s/\n/,/g;
}