Skip to content

Commit

Permalink
Set CUDA_RUNTIME_LIBRARY for individual targets
Browse files Browse the repository at this point in the history
  • Loading branch information
hcho3 committed Aug 2, 2023
1 parent ecf73f8 commit f2e8b29
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions recipe/0002-Use-static-cudart.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake
index f28c1f27..57752b03 100644
--- a/cmake/Utils.cmake
+++ b/cmake/Utils.cmake
@@ -182,12 +182,14 @@ 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)
else ()
set_target_properties(${target} PROPERTIES
CUDA_STANDARD 14
CUDA_STANDARD_REQUIRED ON
- CUDA_SEPARABLE_COMPILATION OFF)
+ CUDA_SEPARABLE_COMPILATION OFF
+ CUDA_RUNTIME_LIBRARY Static)
endif (PLUGIN_RMM)
endfunction(xgboost_set_cuda_flags)

1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ source:
# xgboost patches
- 0001-conda-Unbundle-libxgboost.-dll-dylib-so.patch
- 0001-Force-endian-flag-in-cross-compilation-mode.patch # [arm64 or aarch64 or ppc64le]
- 0002-Use-static-cudart.patch

build:
number: {{ build_number }}
Expand Down

0 comments on commit f2e8b29

Please sign in to comment.