Skip to content
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
2 changes: 2 additions & 0 deletions cmake/therock_subproject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,8 @@ function(_therock_cmake_subproject_setup_toolchain
list(APPEND _compiler_toolchain_addl_depends "${_hip_stamp_dir}/stage.stamp")
string(APPEND _toolchain_contents "string(APPEND CMAKE_CXX_FLAGS_INIT \" --hip-path=@_hip_dist_dir@\")\n")
string(APPEND _toolchain_contents "string(APPEND CMAKE_CXX_FLAGS_INIT \" --hip-device-lib-path=@_amd_llvm_device_lib_path@\")\n")
string(APPEND _toolchain_contents "set(CMAKE_HIP_COMPILER \"\${CMAKE_CXX_COMPILER}\")\n")
string(APPEND _toolchain_contents "set(CMAKE_HIP_FLAGS_INIT \"\${CMAKE_CXX_FLAGS_INIT}\")\n")
Comment on lines +1604 to +1605
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If CMAKE_HIP_COMPILER is not set, sub-projects will incorrectly find /opt/rocm*/lib/llvm/bin/clang++.

Including these options here in TheRock is fine, but I suspect we should also fix this somehow in the rocm projects themselves. See #3976 for a description of the broader problem. Discovering a (likely different/mismatched) tool from somewhere on the system other than the current install could be more risky than just raising an exception and requiring setting it explicitly (like what this PR does).

Do you know where this CMAKE_HIP_COMPILER is falling back to /opt/rocm/ if unset?

if(THEROCK_VERBOSE)
message(STATUS "HIP_DIR = ${_hip_dist_dir}")
endif()
Expand Down
Loading