Explicitly specify libcudart_static in CMake config (#9436)
This commit is contained in:
parent
7fc57f3974
commit
5bd163aa25
@ -232,6 +232,15 @@ add_subdirectory(${xgboost_SOURCE_DIR}/plugin)
|
||||
|
||||
if (PLUGIN_RMM)
|
||||
find_package(rmm REQUIRED)
|
||||
|
||||
# Patch the rmm targets so they reference the static cudart
|
||||
# Remove this patch once RMM stops specifying cudart requirement
|
||||
# (since RMM is a header-only library, it should not specify cudart in its CMake config)
|
||||
get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES)
|
||||
list(REMOVE_ITEM rmm_link_libs CUDA::cudart)
|
||||
list(APPEND rmm_link_libs CUDA::cudart_static)
|
||||
set_target_properties(rmm::rmm PROPERTIES INTERFACE_LINK_LIBRARIES "${rmm_link_libs}")
|
||||
get_target_property(rmm_link_libs rmm::rmm INTERFACE_LINK_LIBRARIES)
|
||||
endif (PLUGIN_RMM)
|
||||
|
||||
#-- library
|
||||
|
||||
@ -177,7 +177,8 @@ function(xgboost_set_cuda_flags target)
|
||||
set_target_properties(${target} PROPERTIES
|
||||
CUDA_STANDARD 17
|
||||
CUDA_STANDARD_REQUIRED ON
|
||||
CUDA_SEPARABLE_COMPILATION OFF)
|
||||
CUDA_SEPARABLE_COMPILATION OFF
|
||||
CUDA_RUNTIME_LIBRARY Static)
|
||||
endfunction(xgboost_set_cuda_flags)
|
||||
|
||||
macro(xgboost_link_nccl target)
|
||||
@ -279,6 +280,7 @@ macro(xgboost_target_link_libraries target)
|
||||
|
||||
if (USE_CUDA)
|
||||
xgboost_set_cuda_flags(${target})
|
||||
target_link_libraries(${target} PUBLIC CUDA::cudart_static)
|
||||
endif (USE_CUDA)
|
||||
|
||||
if (PLUGIN_RMM)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user