mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Set RUNPATH on CUDA and XPU tests (#144305)
#136627 has almost fixed the issue that test binaries' runpath has not been set correctly, with few cases left. This PR fixes the rest. The binaries are found by `auditwheel repair` a wheel built with `BUILD_TEST=1`. @malfet Pull Request resolved: https://github.com/pytorch/pytorch/pull/144305 Approved by: https://github.com/malfet
This commit is contained in:
parent
c4523999a1
commit
ed015143ef
|
|
@ -18,6 +18,7 @@ if(BUILD_TEST)
|
||||||
target_link_libraries(${test_name} ${C10_CUDA_LIB} ${C10_LIB} gtest_main)
|
target_link_libraries(${test_name} ${C10_CUDA_LIB} ${C10_LIB} gtest_main)
|
||||||
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
|
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
|
||||||
if(INSTALL_TEST)
|
if(INSTALL_TEST)
|
||||||
|
set_target_properties(${test_name} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${_rpath_portable_origin}/../lib")
|
||||||
install(TARGETS ${test_name} DESTINATION test)
|
install(TARGETS ${test_name} DESTINATION test)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ if(BUILD_TEST)
|
||||||
target_link_libraries(${test_name} ${C10_XPU_LIB} gtest_main)
|
target_link_libraries(${test_name} ${C10_XPU_LIB} gtest_main)
|
||||||
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
|
add_test(NAME ${test_name} COMMAND $<TARGET_FILE:${test_name}>)
|
||||||
if(INSTALL_TEST)
|
if(INSTALL_TEST)
|
||||||
|
set_target_properties(${test_name} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${_rpath_portable_origin}/../lib")
|
||||||
install(TARGETS ${test_name} DESTINATION test)
|
install(TARGETS ${test_name} DESTINATION test)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user