-
Notifications
You must be signed in to change notification settings - Fork 20
/
ConfigureCUML.cmake
83 lines (74 loc) · 3.8 KB
/
ConfigureCUML.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
include_guard(GLOBAL)
function(find_and_configure_cuml)
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/get_cpm.cmake)
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/get_nccl.cmake)
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/get_version.cmake)
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/ConfigureCUMLPRIMS.cmake)
_get_rapidsai_module_version(cuml VERSION)
_clean_build_dirs_if_not_fully_built(cuml libcuml++)
_set_thrust_dir_if_exists()
_set_package_dir_if_exists(cuml cuml)
_set_package_dir_if_exists(raft raft)
_set_package_dir_if_exists(faiss faiss)
_set_package_dir_if_exists(Treelite cuml)
_set_package_dir_if_exists(GPUTreeShap cuml)
_set_package_dir_if_exists(cumlprims_mg cumlprims_mg)
if(NOT TARGET cuml::cuml)
_get_major_minor_version(${VERSION} MAJOR_AND_MINOR)
_get_update_disconnected_state(cuml ${VERSION} UPDATE_DISCONNECTED)
CPMFindPackage(NAME cuml
VERSION ${VERSION}
# EXCLUDE_FROM_ALL TRUE
GIT_REPOSITORY https://github.com/rapidsai/cuml.git
GIT_TAG branch-${MAJOR_AND_MINOR}
GIT_SHALLOW TRUE
${UPDATE_DISCONNECTED}
SOURCE_SUBDIR cpp
OPTIONS "WITH_UCX ON"
"SINGLEGPU OFF"
"CUDA_STATIC_RUNTIME ON"
"BUILD_TESTS OFF"
"BUILD_BENCHMARKS OFF"
"DISABLE_OPENMP OFF"
"DETECT_CONDA_ENV OFF"
"ENABLE_CUMLPRIMS_MG ON"
"BUILD_SHARED_LIBS OFF"
"BUILD_CUML_MG_TESTS OFF"
"BUILD_CUML_MG_BENCH OFF"
"BUILD_CUML_STD_COMMS ON"
"BUILD_CUML_MPI_COMMS ON"
"BUILD_CUML_TESTS OFF"
"BUILD_CUML_BENCH OFF"
"BUILD_PRIMS_TESTS OFF"
"BUILD_CUML_EXAMPLES OFF"
"BUILD_CUML_C_LIBRARY OFF"
"BUILD_CUML_CPP_LIBRARY ON"
"BUILD_CUML_PRIMS_BENCH OFF"
"RAFT_USE_FAISS_STATIC ON"
"CUML_USE_FAISS_STATIC ON"
"CUML_USE_TREELITE_STATIC ON"
"CUML_EXPORT_TREELITE_LINKAGE ON"
"CUML_USE_CUMLPRIMS_MG_STATIC ON"
PATCH_COMMAND patch --reject-file=- -p1 -N < ${CMAKE_CURRENT_LIST_DIR}/../patches/cuml.patch || true
)
endif()
include(${CMAKE_CURRENT_FUNCTION_LIST_DIR}/link_utils.cmake)
_statically_link_cuda_toolkit_libs(cuml::cuml++)
set(cuml_VERSION "${cuml_VERSION}" PARENT_SCOPE)
endfunction()
find_and_configure_cuml()