Skip to content

Commit

Permalink
Adding lib symlink to top level rocm lib directory
Browse files Browse the repository at this point in the history
Signed-off-by: Pruthvi Madugundu <pruthvi.madugundu@amd.com>
Change-Id: Id00e501de7c3cbc814d18493b97449a5fcb96fd6
  • Loading branch information
pruthvistony-amd committed May 11, 2020
1 parent 741f9c3 commit 2f3535f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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})
Expand Down

0 comments on commit 2f3535f

Please sign in to comment.