Remove hardcoded references to /opt/rocm when using chrpath (#469)
* Fixing cmake_install_prefix search to include /opt/rocm-xxxx * Removing all hard references to /opt/rocm with ROCM_PATH
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -81,13 +81,13 @@ if(BUILD_TESTS)
|
||||
# HIPCC adds /opt/rocm/lib as RPATH, even though the install process is supposed to
|
||||
# remove RPATH. It also occurs before any user-specified rpath, which effectively overrides the user rpath.
|
||||
# As a work-around, set the correct RPATH for the unit test executable as a post-install step
|
||||
if (CMAKE_INSTALL_PREFIX MATCHES "/opt/rocm*")
|
||||
if (CMAKE_INSTALL_PREFIX MATCHES "${ROCM_PATH}")
|
||||
# install_prefix/CMAKE_INSTALL_PREFIX was not explicitly specified, so look in build/release
|
||||
add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:/opt/rocm/lib ${CMAKE_BINARY_DIR}/test/UnitTests)
|
||||
add_custom_command( TARGET UnitTestsMultiProcess POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:/opt/rocm/lib ${CMAKE_BINARY_DIR}/test/UnitTestsMultiProcess)
|
||||
add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTests)
|
||||
add_custom_command( TARGET UnitTestsMultiProcess POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTestsMultiProcess)
|
||||
else()
|
||||
add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:/opt/rocm/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTests)
|
||||
add_custom_command( TARGET UnitTestsMultiProcess POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:/opt/rocm/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTestsMultiProcess)
|
||||
add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTests)
|
||||
add_custom_command( TARGET UnitTestsMultiProcess POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTestsMultiProcess)
|
||||
endif()
|
||||
else()
|
||||
message("Not building unit tests")
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user