From 56852fbb508f05004e9603c81442caffa5dd469b Mon Sep 17 00:00:00 2001 From: Rob Armstrong Date: Fri, 7 Feb 2025 15:43:17 -0500 Subject: [PATCH] Add explicit system libraries needed on some Linux distributions --- Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt | 4 ++++ .../2_Concepts_and_Techniques/threadMigration/CMakeLists.txt | 4 ++++ Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt b/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt index 868bfa40..8f8dbf60 100644 --- a/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt +++ b/Samples/0_Introduction/matrixMulDynlinkJIT/CMakeLists.txt @@ -34,3 +34,7 @@ target_link_libraries(matrixMulDynlinkJIT PUBLIC CUDA::cudart CUDA::cuda_driver ) + +if(UNIX) + target_link_libraries(matrixMulDynlinkJIT PUBLIC dl) +endif() diff --git a/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt b/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt index b2cbb6ca..f3f986d5 100644 --- a/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt +++ b/Samples/2_Concepts_and_Techniques/threadMigration/CMakeLists.txt @@ -35,6 +35,10 @@ target_link_libraries(threadMigration PUBLIC CUDA::cuda_driver ) +if(UNIX) + target_link_libraries(threadMigration PUBLIC pthread) +endif() + set(CUDA_FATBIN_FILE "${CMAKE_CURRENT_BINARY_DIR}/threadMigration_kernel64.fatbin") set(CUDA_KERNEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/threadMigration_kernel.cu") diff --git a/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt b/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt index 58ce5ec4..5fa8f832 100644 --- a/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt +++ b/Samples/3_CUDA_Features/memMapIPCDrv/CMakeLists.txt @@ -35,6 +35,10 @@ target_link_libraries(memMapIPCDrv PUBLIC CUDA::cuda_driver ) +if(UNIX) + target_link_libraries(memMapIPCDrv PUBLIC rt) +endif() + set(CUDA_PTX_FILE "${CMAKE_CURRENT_BINARY_DIR}/memMapIpc_kernel64.ptx") set(CUDA_KERNEL_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/memMapIpc_kernel.cu")