hip: Set --gcc-toolchain to ensure external HIP installs pick up correct GCC (#46573)
This commit is contained in:
parent
f3a3e85bb9
commit
9346306b79
@ -475,6 +475,19 @@ def set_variables(self, env):
|
||||
env.set("HIP_PATH", self.spec.prefix)
|
||||
env.set("HIP_PLATFORM", "nvidia")
|
||||
|
||||
# Set up hipcc/hip-clang to use the specific GCC toolchain that is
|
||||
# being used to compile. This is only important for external ROCm
|
||||
# installations, which may otherwise pick up the wrong GCC toolchain.
|
||||
if self.spec.external and self.spec.satisfies("%gcc"):
|
||||
# This is picked up by hipcc.
|
||||
env.append_path(
|
||||
"HIPCC_COMPILE_FLAGS_APPEND",
|
||||
f"--gcc-toolchain={self.compiler.prefix}",
|
||||
separator=" ",
|
||||
)
|
||||
# This is picked up by CMake when using HIP as a CMake language.
|
||||
env.append_path("HIPFLAGS", f"--gcc-toolchain={self.compiler.prefix}", separator=" ")
|
||||
|
||||
def setup_build_environment(self, env):
|
||||
self.set_variables(env)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user