From c82fdeab8d23727703bf7e539b2d61e621270edf Mon Sep 17 00:00:00 2001 From: Ranjith Ramakrishnan Date: Fri, 19 May 2023 00:17:06 -0700 Subject: [PATCH] SWDEV-310152 - Removed the RUNPATH setting in source code Use the RUNPATH provided by build scripts Change-Id: Ib5b3f689dc20aeecf6974281625865fe650bfa72 --- CMakeLists.txt | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4b9046f75..24635a97c7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,55 +76,6 @@ include(GNUInstallDirs) # in sub-projects. Override with -DROCM_DIR= set(ROCM_DIR "/opt/rocm" CACHE STRING "ROCm directory.") -# Only populate RUNPATH if ROCM_RPATH env variable is set -# Mostly makes sense in ROCm build scripts context -# -# Best attempt at finding libraries without modifying LD_LIBRARY_PATH -# -# Reasons for some $ORIGIN paths: -# $ORIGIN -# - rocm/lib/librdc.so needs rocm/lib/librocm_smi64.so -# $ORIGIN/.. -# - rocm/lib/rdc/librdc_rocp.so needs rocm/lib/rdc/../librdc_bootstrap.so -# $ORIGIN/../lib -# - rocm/bin/rdci needs rocm/lib/../lib/librdc_bootstrap.so.0 -# - rocm/bin/rdcd needs rocm/lib/../lib/librdc_bootstrap.so.0 -# $ORIGIN/../lib/rdc/grpc/lib -# - 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/../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") - set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) - set(CMAKE_SKIP_BUILD_RPATH TRUE) -endif() - set(COMMON_DIR "${CMAKE_CURRENT_SOURCE_DIR}/common") set(GRPC_ROOT_DEFAULT "/usr")