SWDEV-376779 - Fix linking for rdctst
Ieb198ad96e26e89b09cb85986214a5b1451b17a6 broke linking for rdctst and rdcd by removing "../lib/rdc" path. This change adds it back and makes the paths more visible. - Link librdc_ras and librdc_rocp to rdctst - Add longer RUNPATH for rdctst to link rdc libraries Change-Id: Id4f128c217a6de8bb67df6750ecafdb96545811b Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>
Dieser Commit ist enthalten in:
committet von
Dmitrii Galantsev
Ursprung
2787767bf0
Commit
fc097d44ff
+31
-5
@@ -93,10 +93,31 @@ set(ROCM_DIR "/opt/rocm" CACHE STRING "ROCm directory.")
|
||||
# - rocm/lib/librdc_client.so needs rocm/lib/../lib/rdc/grpc/lib/libgrpc++.so
|
||||
# All other versions are for inconsistencies between systems and custom installation paths
|
||||
if(DEFINED ENV{ROCM_RPATH})
|
||||
set(RDC_RUNPATH "\$ORIGIN:\$ORIGIN/..:\$ORIGIN/../lib:\$ORIGIN/../lib64")
|
||||
set(GRPC_RUNPATH "\$ORIGIN/grpc/lib:\$ORIGIN/../grpc/lib:\$ORIGIN/../lib/grpc/lib:\$ORIGIN/../lib/rdc/grpc/lib:\$ORIGIN/../lib64/rdc/grpc/lib")
|
||||
set(GRPC_RUNPATH64 "\$ORIGIN/grpc/lib64:\$ORIGIN/../grpc/lib64:\$ORIGIN/../lib/grpc/lib64:\$ORIGIN/../lib/rdc/grpc/lib64:\$ORIGIN/../lib64/rdc/grpc/lib64")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${RDC_RUNPATH}:${GRPC_RUNPATH}:${GRPC_RUNPATH64}")
|
||||
set(RDC_RUNPATH
|
||||
"\$ORIGIN"
|
||||
"\$ORIGIN/.."
|
||||
"\$ORIGIN/../lib"
|
||||
"\$ORIGIN/../lib/rdc")
|
||||
# replace lib with lib64
|
||||
list(TRANSFORM RDC_RUNPATH REPLACE "lib" "lib64" OUTPUT_VARIABLE RDC_RUNPATH64)
|
||||
|
||||
set(GRPC_RUNPATH
|
||||
"\$ORIGIN/grpc/lib"
|
||||
"\$ORIGIN/../grpc/lib"
|
||||
"\$ORIGIN/../lib/grpc/lib"
|
||||
"\$ORIGIN/../lib/rdc/grpc/lib"
|
||||
"\$ORIGIN/../lib64/rdc/grpc/lib")
|
||||
# replace /grpc/lib with /grpc/lib64
|
||||
list(TRANSFORM GRPC_RUNPATH REPLACE "/grpc/lib" "/grpc/lib64" OUTPUT_VARIABLE GRPC_RUNPATH64)
|
||||
|
||||
# combine lists
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
${CMAKE_INSTALL_RPATH}
|
||||
${RDC_RUNPATH}
|
||||
${RDC_RUNPATH64}
|
||||
${GRPC_RUNPATH}
|
||||
${GRPC_RUNPATH64})
|
||||
list(REMOVE_DUPLICATES CMAKE_INSTALL_RPATH)
|
||||
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-new-dtags -Wl,--no-as-needed -Wl,-z,origin")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--enable-new-dtags -Wl,--no-as-needed -Wl,-z,origin")
|
||||
@@ -318,6 +339,11 @@ if(BUILD_RASLIB)
|
||||
message("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
|
||||
|
||||
add_subdirectory("raslib")
|
||||
else()
|
||||
add_library(rdc_ras INTERFACE
|
||||
${PROJECT_SOURCE_DIR}/ras_prebuild/librdc_ras.so)
|
||||
# needed for copying the pre-built library
|
||||
get_target_property(RAS_SOURCES rdc_ras SOURCES)
|
||||
endif()
|
||||
|
||||
# Folders for both standalone and embedded
|
||||
@@ -364,7 +390,7 @@ install(DIRECTORY ${PROJECT_SOURCE_DIR}/example
|
||||
COMPONENT dev)
|
||||
|
||||
# Prebuild packages to install
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/ras_prebuild/librdc_ras.so
|
||||
install(FILES ${RAS_SOURCES}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/${RDC}
|
||||
COMPONENT ${CLIENT_COMPONENT})
|
||||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/ras_prebuild/config
|
||||
|
||||
Normale Datei → Ausführbare Datei
@@ -10,6 +10,19 @@ endif()
|
||||
# Required Defines first:
|
||||
option(INSTALL_GTEST "Install GTest (only useful if GTest is not already installed)" OFF)
|
||||
|
||||
# Hack to find libraries after installation
|
||||
# /opt/rocm/share/rdc/rdctst_tests/../../../ = /opt/rocm
|
||||
set(RDCTST_RPATH
|
||||
"\$ORIGIN/../../../lib"
|
||||
"\$ORIGIN/../../../lib/rdc")
|
||||
# replace lib with lib64
|
||||
list(TRANSFORM RDCTST_RPATH REPLACE "lib" "lib64" OUTPUT_VARIABLE RDCTST_RPATH64)
|
||||
# combine lists
|
||||
set(CMAKE_INSTALL_RPATH
|
||||
${CMAKE_INSTALL_RPATH}
|
||||
${RDCTST_RPATH}
|
||||
${RDCTST_RPATH64})
|
||||
|
||||
#
|
||||
# Print out the build configuration being used:
|
||||
#
|
||||
@@ -69,11 +82,12 @@ target_include_directories(
|
||||
PUBLIC ${RSMI_INC_DIR}
|
||||
PUBLIC ${SRC_DIR}/..)
|
||||
|
||||
# TODO: figure out if this properly does runtime linking
|
||||
target_link_libraries(${RDCTST}
|
||||
PUBLIC GTest::gtest_main
|
||||
PUBLIC rdc_bootstrap
|
||||
PUBLIC rdc
|
||||
PUBLIC rdc_ras
|
||||
PUBLIC rdc_rocp
|
||||
PUBLIC c
|
||||
PUBLIC stdc++
|
||||
PUBLIC pthread)
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren