Skip to content
Merged
Changes from 1 commit
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
31 changes: 22 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,28 @@ if(CMAKE_CXX_VISIBILITY_PRESET)
list(APPEND DEFAULT_CMAKE_ARGS ${CMAKE_CXX_VISIBILITY_PRESET})
endif()

################################################################################
# patchelf / install_name_tool
# Building with bundled sysdep or rocGDB requires patchelf on Linux and
# install_name_tool on macOS to set RPATH.
################################################################################

if(THEROCK_BUNDLE_SYSDEPS OR THEROCK_ENABLE_ROCGDB)
Comment thread
lumachad marked this conversation as resolved.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_program(PATCHELF patchelf)
if(NOT PATCHELF)
message(FATAL_ERROR "Building with THEROCK_BUNDLE_SYSDEPS=ON or THEROCK_ENABLE_ROCGDB=ON on Linux requires `patchelf`")
endif()
message(FATAL_ERROR "!/!")

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.

Stray debug log?
https://github.com/ROCm/TheRock/actions/runs/22241260424/job/64345172580?pr=3543#step:9:98

-- Disabled features:
--   * IREE_COMPILER (-DTHEROCK_ENABLE_IREE_COMPILER=OFF)
--   * FUSILLI_PLUGIN (-DTHEROCK_ENABLE_FUSILLI_PLUGIN=OFF)
CMake Error at CMakeLists.txt:345 (message):
  !/!


-- Configured AMDGPU Targets:
--   * gfx942 : MI300A/MI300X CDNA
--   * Dist bundle: gfx94X-dcgpu
-- Configuring incomplete, errors occurred!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Indeed. That shouldn't go in here. Thanks for the catch.

elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS uses install_name_tool (from Xcode) instead of patchelf
find_program(INSTALL_NAME_TOOL install_name_tool)
if(NOT INSTALL_NAME_TOOL)
message(FATAL_ERROR "Building with THEROCK_BUNDLE_SYSDEPS=ON or THEROCK_ENABLE_ROCGDB=ON on macOS requires `install_name_tool` (install Xcode Command Line Tools)")
Comment thread
lumachad marked this conversation as resolved.
endif()
endif()
endif()

################################################################################
# Sysdep bundling
# Each available bundled sysdep is made available with a global variable like
Expand Down Expand Up @@ -362,10 +384,6 @@ set(THEROCK_BUNDLED_AMDMESA)
if(THEROCK_BUNDLE_SYSDEPS)
message(STATUS "Building with bundled system dependencies enabled")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_program(PATCHELF patchelf)
if(NOT PATCHELF)
message(FATAL_ERROR "Building with THEROCK_BUNDLE_SYSDEPS=ON on Linux requires `patchelf`")
endif()
find_program(MESON_BUILD meson)
if(NOT MESON_BUILD)
message(FATAL_ERROR "Building with THEROCK_BUNDLE_SYSDEPS=ON on Linux requires (easiest: `pip install meson`)")
Expand All @@ -389,11 +407,6 @@ if(THEROCK_BUNDLE_SYSDEPS)
set(THEROCK_BUNDLED_AMDMESA therock-amd-mesa)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
# macOS uses install_name_tool (from Xcode) instead of patchelf
find_program(INSTALL_NAME_TOOL install_name_tool)
if(NOT INSTALL_NAME_TOOL)
message(FATAL_ERROR "Building with THEROCK_BUNDLE_SYSDEPS=ON on macOS requires `install_name_tool` (install Xcode Command Line Tools)")
endif()
find_program(MESON_BUILD meson)
if(NOT MESON_BUILD)
message(FATAL_ERROR "Building with THEROCK_BUNDLE_SYSDEPS=ON on macOS requires `meson` (easiest: `pip install meson`)")
Expand Down
Loading