Skip to content

Commit

Permalink
cmake: Let CUDA_RUNTIME_LIBRARY be overridden
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckatkins committed Oct 16, 2023
1 parent 3b109b4 commit 34b36fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ option(PLUGIN_FEDERATED "Build with Federated Learning" OFF)
option(PLUGIN_UPDATER_ONEAPI "DPC++ updater" OFF)
option(ADD_PKGCONFIG "Add xgboost.pc into system." ON)

# Allow the CUDA Runtime library to be overridden
set(CMAKE_CUDA_RUNTIME_LIBRARY "Static" CACHE STRING "Select the Shared or Static CUDA runtime library to link to")
set_property(CACHE CMAKE_CUDA_RUNTIME_LIBRARY PROPERTY STRINGS "Static;Shared;None")
mark_as_advanced(CMAKE_CUDA_RUNTIME_LIBRARY)

#-- Checks for building XGBoost
if(USE_DEBUG_OUTPUT AND (NOT (CMAKE_BUILD_TYPE MATCHES Debug)))
message(SEND_ERROR "Do not enable `USE_DEBUG_OUTPUT' with release build.")
Expand Down
3 changes: 1 addition & 2 deletions cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ function(xgboost_set_cuda_flags target)

set_target_properties(${target} PROPERTIES
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
CUDA_RUNTIME_LIBRARY Static)
CUDA_STANDARD_REQUIRED ON)

# CUDA device LTO also requires separable compilation to be enabled
if(USE_CUDA_LTO)
Expand Down

0 comments on commit 34b36fd

Please sign in to comment.