SWDEV-409575 - Append additional RPATH to libraries and binaries installed in /opt/rocm-ver/lib/rocprofiler

Append the rpath $ORIGIN/.. to component specific libraries
Binaries installed in /opt/rocm-ver/lib/rocprofiler had been appended with $ORIGIN/..
Binaries installed in /opt/rocm-ver/libexec/rocprofiler had been appended with $ORIGIN/../../lib
Used TARGET form for installation of rocprof-ctrl and librocprof-tool in runtime component

Change-Id: I53b7a283c6a8ddea97d4889db6010832389894bb
This commit is contained in:
Ranjith Ramakrishnan
2023-07-09 01:56:47 -07:00
parent 1c11700521
commit 5e4ac01cb1
8 changed files with 34 additions and 25 deletions
+4 -2
View File
@@ -16,7 +16,8 @@ set_target_properties(
rocprofiler_tool
PROPERTIES CXX_VISIBILITY_PRESET hidden
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/rocprofiler
LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/exportmap)
LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/exportmap
INSTALL_RPATH "${ROCM_APPEND_PRIVLIB_RPATH}")
target_include_directories(
rocprofiler_tool PRIVATE ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
@@ -70,7 +71,8 @@ add_subdirectory(rocprofv2)
add_executable(ctrl ctrl.cpp)
set_target_properties(ctrl PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_BINARY_DIR}/libexec/rocprofiler)
${CMAKE_BINARY_DIR}/libexec/rocprofiler
INSTALL_RPATH "$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}")
target_link_options(
rocprofiler_tool PRIVATE -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exportmap
-Wl,--no-undefined)