Skip to content

Commit

Permalink
build: guard against changes in cuda library name (#1068)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlpinDale authored Jan 3, 2025
1 parent ca7028d commit 7dd001e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,14 @@ function (define_gpu_extension_target GPU_MOD_NAME)
target_include_directories(${GPU_MOD_NAME} PRIVATE kernels
${GPU_INCLUDE_DIRECTORIES})

target_link_libraries(${GPU_MOD_NAME} PRIVATE torch ${torch_python_LIBRARY}
${GPU_LIBRARIES})
target_link_libraries(${GPU_MOD_NAME} PRIVATE torch ${GPU_LIBRARIES})

# Don't use `TORCH_LIBRARIES` for CUDA since it pulls in a bunch of
# dependencies that are not necessary and may not be installed.
if (GPU_LANGUAGE STREQUAL "CUDA")
if ("${CUDA_CUDA_LIB}" STREQUAL "")
set(CUDA_CUDA_LIB "${CUDA_CUDA_LIBRARY}")
endif()
target_link_libraries(${GPU_MOD_NAME} PRIVATE ${CUDA_CUDA_LIB}
${CUDA_LIBRARIES})
else()
Expand Down

0 comments on commit 7dd001e

Please sign in to comment.