Skip to content

Commit

Permalink
Make alpaka follow CMAKE_CUDA_RUNTIME_LIBRARY
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard authored and psychocoderHPC committed Aug 5, 2024
1 parent 2d652dd commit 2c386dc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmake/alpakaCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,19 @@ if(alpaka_ACC_GPU_CUDA_ENABLE)
endif()

# Link the CUDA Runtime library
target_link_libraries(alpaka INTERFACE CUDA::cudart)
if(CMAKE_CUDA_RUNTIME_LIBRARY STREQUAL "Shared")
target_link_libraries(alpaka INTERFACE CUDA::cudart)
else()
target_link_libraries(alpaka INTERFACE CUDA::cudart_static)
endif()

if(NOT alpaka_DISABLE_VENDOR_RNG)
# Use cuRAND random number generators
target_link_libraries(alpaka INTERFACE CUDA::curand)
if(CMAKE_CUDA_RUNTIME_LIBRARY STREQUAL "Shared")
target_link_libraries(alpaka INTERFACE CUDA::curand)
else()
target_link_libraries(alpaka INTERFACE CUDA::curand_static)
endif()
endif()
else()
message(FATAL_ERROR "Optional alpaka dependency CUDA could not be found!")
Expand Down

0 comments on commit 2c386dc

Please sign in to comment.