From 2f3535f2eb609b151719cc1545d82d41d16201f0 Mon Sep 17 00:00:00 2001 From: Pruthvi Madugundu Date: Thu, 7 May 2020 15:37:11 -0700 Subject: [PATCH] Adding lib symlink to top level rocm lib directory Signed-off-by: Pruthvi Madugundu Change-Id: Id00e501de7c3cbc814d18493b97449a5fcb96fd6 --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e8f74cc4..e552929e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ include(utils) set(ROCM_SMI "rocm_smi") set(ROCM_SMI_COMPONENT "lib${ROCM_SMI}") set(ROCM_SMI_TARGET "${ROCM_SMI}64") +set(ROCM_SMI_LIB_NAME "lib${ROCM_SMI_TARGET}") # The following default version values should be updated as appropriate for # ABI breaks (update MAJOR and MINOR), and ABI/API additions (update MINOR). @@ -168,6 +169,21 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL Release) POST_BUILD COMMAND ${CMAKE_STRIP} lib${ROCM_SMI_TARGET}.so) endif () +## Add symlinks from top level ROCm lib dir to rocm-smi lib so files +add_custom_target ( so-link ALL WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E create_symlink + ../${ROCM_SMI}/lib/${ROCM_SMI_LIB_NAME}.so so-link ) +add_custom_target ( so-major-link ALL WORKING_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${CMAKE_COMMAND} + -E create_symlink + ../${ROCM_SMI}/lib/${ROCM_SMI_LIB_NAME}.so.${VERSION_MAJOR} + so-major-link ) + +install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/so-link DESTINATION lib RENAME + ${ROCM_SMI_LIB_NAME}.so ) +install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/so-major-link DESTINATION lib + RENAME ${ROCM_SMI_LIB_NAME}.so.${VERSION_MAJOR} ) + ## Add the install directives for the runtime library. install(TARGETS ${ROCM_SMI_TARGET} LIBRARY DESTINATION ${ROCM_SMI}/lib COMPONENT ${ROCM_SMI_COMPONENT})