Fixing cmake_install_prefix search to include /opt/rocm-xxxx (#462)

[ROCm/rccl commit: 2f87073514]
Αυτή η υποβολή περιλαμβάνεται σε:
Stanley Tsang authored and GitHub committed 2021-11-06 07:58:26 -07:00
1 γονέας 680660fcf7
υποβολή bd30ea0dae
1 file changed
+1 -1
@@ -81,7 +81,7 @@ 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 STREQUAL "/opt/rocm")
if (CMAKE_INSTALL_PREFIX MATCHES "/opt/rocm*")
# 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)