Files
TheRock/cmake/custom_install_amdgpu_runtime.cmake
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

67 lines
2.3 KiB
CMake

# Copyright Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
# Script run to install the amdgpu_hip_runtime component.
# This runs at install time and has access to the staging tree files.
message(STATUS "Custom installing amdgpu-runtime to: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Staging install dir: ${STAGING_INSTALL_DIR}")
if(NOT IS_DIRECTORY "${STAGING_INSTALL_DIR}")
message(FATAL_ERROR "Did not get STAGING_INSTALL_DIR from super-project")
endif()
set(LIB_PREFIX "lib")
set(SO_SUFFIX ".so")
set(LLVM_STAGING_DIR "${STAGING_INSTALL_DIR}/llvm")
################################################################################
# Dynamic runtime files
################################################################################
# Assemble runtime dynamic file lists.
file(
GLOB_RECURSE LIB_FILES
LIST_DIRECTORIES FALSE
RELATIVE ${STAGING_INSTALL_DIR}
${STAGING_INSTALL_DIR}/lib/*${SO_SUFFIX}
${STAGING_INSTALL_DIR}/lib/*${SO_SUFFIX}.*
)
list(REMOVE_ITEM LIB_FILES
# TODO: Get the hip team to not install old version downloaded files.
lib/libamdhip64.so.5
)
foreach(_relpath ${LIB_FILES})
cmake_path(GET _relpath PARENT_PATH _parent_rel_path)
file(
INSTALL ${STAGING_INSTALL_DIR}/${_relpath}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_parent_rel_path}
USE_SOURCE_PERMISSIONS
)
endforeach()
################################################################################
# LLVM runtime files
################################################################################
# NOTE: This assumes that we have linked amd_comgr statically (i.e. not
# depending on libLLVM). This makes sense for a standalone runtime. However,
# if optimizing for a full compiler+runtime, it would make sense to link against
# libLLVM and include it here.
# We collapse the comgr libraries into the runtime lib dir. The RPATHS are
# setup to make this work.
file(GLOB_RECURSE LLVM_LIB_FILES
LIST_DIRECTORIES FALSE
RELATIVE ${LLVM_STAGING_DIR}
${LLVM_STAGING_DIR}/lib/${LIB_PREFIX}amd_comgr${SO_SUFFIX}
${LLVM_STAGING_DIR}/lib/${LIB_PREFIX}amd_comgr${SO_SUFFIX}.*
)
foreach(_relpath ${LLVM_LIB_FILES})
cmake_path(GET _relpath PARENT_PATH _parent_rel_path)
file(
INSTALL ${STAGING_INSTALL_DIR}/llvm/${_relpath}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_parent_rel_path}
USE_SOURCE_PERMISSIONS
)
endforeach()