diff --git a/base/rocm-kpack b/base/rocm-kpack index fe9dd03a73..93eb7be7ec 160000 --- a/base/rocm-kpack +++ b/base/rocm-kpack @@ -1 +1 @@ -Subproject commit fe9dd03a738e6810b2876635de093b2dde1ce243 +Subproject commit 93eb7be7ec16adc30acadd59d623da9c46cec2cf diff --git a/cmake/therock_subproject.cmake b/cmake/therock_subproject.cmake index be6eb0523a..e835640617 100644 --- a/cmake/therock_subproject.cmake +++ b/cmake/therock_subproject.cmake @@ -564,6 +564,21 @@ get_property(existing_packages GLOBAL PROPERTY THEROCK_ALL_PROVIDED_PACKAGES) endif() endfunction() +# therock_cmake_subproject_require_program +# Requires that find_program finds a named program at super-project configure time. +# This is to avoid downstream errors that would otherwise only show up at build time. +# Only to be used by programs that must exist on the host in order to build. Programs +# that are built as part of the project are resolved internally. +function(therock_cmake_subproject_require_host_program target_name) + _therock_assert_is_cmake_subproject("${target_name}") + foreach(prog IN LISTS ARGN) + find_program(found "${prog}" OPTIONAL) + if(NOT found) + message(FATAL_ERROR "Building sub-project ${target_name} requires program '${prog}' on the system path but it is not found") + endif() + endforeach() +endfunction() + # therock_cmake_subproject_activate # If using multi-step setup (i.e. without 'ACTIVATE' on the declare), then this # must be called once all configuration is complete. diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 5aacac2a2e..0ef7650549 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -113,6 +113,14 @@ if(THEROCK_ENABLE_HIP_RUNTIME) ) endif() + # Conditional rocm-kpack support for kpack split artifacts + set(_hip_clr_kpack_runtime_deps) + set(_hip_clr_kpack_cmake_args) + if(THEROCK_KPACK_SPLIT_ARTIFACTS) + list(APPEND _hip_clr_kpack_runtime_deps rocm-kpack) + list(APPEND _hip_clr_kpack_cmake_args "-DROCM_KPACK_ENABLED=ON") + endif() + therock_cmake_subproject_declare(hip-clr USE_DIST_AMDGPU_TARGETS EXTERNAL_SOURCE_DIR "${THEROCK_ROCM_SYSTEMS_SOURCE_DIR}/projects/clr" @@ -130,6 +138,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME) # and can use local machine tools. "-DHIPCC_BIN_DIR=" ${HIP_CLR_CMAKE_ARGS} + ${_hip_clr_kpack_cmake_args} BUILD_DEPS rocm-cmake therock-simde @@ -139,6 +148,7 @@ if(THEROCK_ENABLE_HIP_RUNTIME) hipcc # For hipconfig rocm-core ${HIP_CLR_RUNTIME_DEPS} + ${_hip_clr_kpack_runtime_deps} INTERFACE_LINK_DIRS "lib" INTERFACE_INSTALL_RPATH_DIRS diff --git a/math-libs/CMakeLists.txt b/math-libs/CMakeLists.txt index 31c1b59782..ff85c0620e 100644 --- a/math-libs/CMakeLists.txt +++ b/math-libs/CMakeLists.txt @@ -361,6 +361,7 @@ if(THEROCK_ENABLE_LIBHIPCXX) SUBDIRS . ) + therock_cmake_subproject_require_host_program(libhipcxx lit) therock_cmake_subproject_activate(libhipcxx) therock_provide_artifact(libhipcxx