summaryrefslogtreecommitdiffstats
path: root/Tests/CudaOnly
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2023-05-12 14:00:32 (GMT)
committerRobert Maynard <rmaynard@nvidia.com>2023-05-22 19:37:35 (GMT)
commit4f10111e950de87106677d309a0f41356eff34af (patch)
tree85a04d08b3cee65e2663f8b6d770aa608a983f54 /Tests/CudaOnly
parent25eddc2ef3a5ced7851b1c3795a46ac3364c18f1 (diff)
downloadCMake-4f10111e950de87106677d309a0f41356eff34af.zip
CMake-4f10111e950de87106677d309a0f41356eff34af.tar.gz
CMake-4f10111e950de87106677d309a0f41356eff34af.tar.bz2
CUDA: Cuda* tests add rpath entry only for need cuda lib directory
Found when developing https://github.com/conda-forge/cuda-nvcc-feedstock/pull/13/ We previously added RPATH entries for all implicit directories and therefore started to load the incorrect pthread library.
Diffstat (limited to 'Tests/CudaOnly')
-rw-r--r--Tests/CudaOnly/SharedRuntimePlusToolkit/CMakeLists.txt3
-rw-r--r--Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt3
-rw-r--r--Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt3
3 files changed, 6 insertions, 3 deletions
diff --git a/Tests/CudaOnly/SharedRuntimePlusToolkit/CMakeLists.txt b/Tests/CudaOnly/SharedRuntimePlusToolkit/CMakeLists.txt
index 0b01085..7dc919f 100644
--- a/Tests/CudaOnly/SharedRuntimePlusToolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/SharedRuntimePlusToolkit/CMakeLists.txt
@@ -40,5 +40,6 @@ target_link_libraries(CudaOnlySharedRuntimePlusToolkit PRIVATE SharedToolkit
if(UNIX)
# Help the shared cuda runtime find libcudart as it is not located
# in a default system searched location
- set_property(TARGET CudaOnlySharedRuntimePlusToolkit PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+ find_package(CUDAToolkit REQUIRED)
+ set_property(TARGET CudaOnlySharedRuntimePlusToolkit PROPERTY BUILD_RPATH "${CUDAToolkit_LIBRARY_DIR}")
endif()
diff --git a/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt
index 24ff478..cf6eef2 100644
--- a/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt
+++ b/Tests/CudaOnly/SharedRuntimeViaCUDAFlags/CMakeLists.txt
@@ -11,5 +11,6 @@ add_executable(CudaOnlySharedRuntimeViaCUDAFlags main.cu)
if(UNIX)
# Help the shared cuda runtime find libcudart as it is not located
# in a default system searched location
- set_property(TARGET CudaOnlySharedRuntimeViaCUDAFlags PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+ find_package(CUDAToolkit REQUIRED)
+ set_property(TARGET CudaOnlySharedRuntimeViaCUDAFlags PROPERTY BUILD_RPATH "${CUDAToolkit_LIBRARY_DIR}")
endif()
diff --git a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt
index ae03b66..8149060 100644
--- a/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt
+++ b/Tests/CudaOnly/StaticRuntimePlusToolkit/CMakeLists.txt
@@ -39,5 +39,6 @@ target_link_libraries(CudaOnlyStaticRuntimePlusToolkit PRIVATE SharedToolkit
if(UNIX)
# Help the shared cuda runtime find libcurand and libnppif when they are not located
# in a default system searched location
- set_property(TARGET CudaOnlyStaticRuntimePlusToolkit PROPERTY BUILD_RPATH ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES})
+ find_package(CUDAToolkit REQUIRED)
+ set_property(TARGET CudaOnlyStaticRuntimePlusToolkit PROPERTY BUILD_RPATH "${CUDAToolkit_LIBRARY_DIR}")
endif()