@@ -16,16 +16,11 @@ cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR)
1616
1717include (../../cmake/rapids_config.cmake )
1818
19- option (CUML_CPU "Build only cuML CPU Python components." OFF )
2019set (language_list "CXX" )
2120
22- if (NOT CUML_CPU)
23- # We always need CUDA for cuML GPU because the raft dependency brings in a
24- # header-only cuco dependency that enables CUDA unconditionally.
25- include (rapids-cuda )
26- rapids_cuda_init_architectures (cuml-python )
27- list (APPEND language_list "CUDA" )
28- endif ()
21+ include (rapids-cuda )
22+ rapids_cuda_init_architectures (cuml-python )
23+ list (APPEND language_list "CUDA" )
2924
3025project (
3126 cuml-python
@@ -41,7 +36,6 @@ option(USE_LIBCUML_WHEEL "Use libcuml wheel to provide some dependencies" OFF)
4136
4237# todo: use CMAKE_MESSAGE_CONTEXT for prefix for logging.
4338# https://github.com/rapidsai/cuml/issues/4843
44- message (VERBOSE "CUML_PY: Build only cuML CPU Python components.: ${CUML_CPU} " )
4539message (VERBOSE "CUML_PY: Disabling all mnmg components and comms libraries: ${SINGLEGPU} " )
4640
4741set (CUML_ALGORITHMS "ALL" CACHE STRING "Choose which algorithms are built cuML. Can specify individual algorithms or groups in a semicolon-separated list." )
@@ -52,70 +46,39 @@ set(CUML_CPP_SRC "../../cpp")
5246################################################################################
5347# - Process User Options ------------------------------------------------------
5448
55- if (CUML_CPU)
56- set (CUML_UNIVERSAL OFF )
57- set (SINGLEGPU ON )
58-
59- # only a subset of algorithms are supported in CPU-only cuML
60- set (CUML_ALGORITHMS "linearregression" )
61- list (APPEND CUML_ALGORITHMS "pca" )
62- list (APPEND CUML_ALGORITHMS "tsvd" )
63- list (APPEND CUML_ALGORITHMS "elasticnet" )
64- list (APPEND CUML_ALGORITHMS "logisticregression" )
65- list (APPEND CUML_ALGORITHMS "ridge" )
66- list (APPEND CUML_ALGORITHMS "lasso" )
67- list (APPEND CUML_ALGORITHMS "umap" )
68- list (APPEND CUML_ALGORITHMS "knn" )
69- list (APPEND CUML_ALGORITHMS "hdbscan" )
70- list (APPEND CUML_ALGORITHMS "dbscan" )
71- list (APPEND CUML_ALGORITHMS "kmeans" )
72-
73- # this won't be needed when we add CPU libcuml++ (FIL)
74- set (cuml_sg_libraries "" )
75-
76- list (APPEND CYTHON_FLAGS
77- "--compile-time-env GPUBUILD=0" )
78-
79- # cuml-cpu does not need libcuml++.so
80- else ()
81-
82- include (rapids-cpm )
83- include (rapids-export )
84- rapids_cpm_init ()
85-
86- # --- treelite --- #
87- # Need to call get_treelite explicitly because we need the correct
88- # ${TREELITE_LIBS} definition for RF.
89- #
90- # And because cuml Cython code needs the headers to satisfy calls like
91- # 'cdef extern from "treelite/c_api.h"'
92-
93- # wheel builds use a static treelite, because the 'libtreelite.so' in 'treelite' wheels
94- # isn't intended for dynamic linking by third-party projects (e.g. hides its symbols)
95- if (USE_LIBCUML_WHEEL)
96- set (CUML_PYTHON_TREELITE_TARGET treelite::treelite_static)
97- set (CUML_USE_TREELITE_STATIC ON )
98- else ()
99- set (CUML_PYTHON_TREELITE_TARGET treelite::treelite)
100- set (CUML_USE_TREELITE_STATIC OFF )
101- endif ()
49+ include (rapids-cpm )
50+ include (rapids-export )
51+ rapids_cpm_init ()
10252
103- set (CUML_EXCLUDE_TREELITE_FROM_ALL ON )
53+ # --- treelite --- #
54+ # Need to call get_treelite explicitly because we need the correct
55+ # ${TREELITE_LIBS} definition for RF.
56+ #
57+ # And because cuml Cython code needs the headers to satisfy calls like
58+ # 'cdef extern from "treelite/c_api.h"'
59+
60+ # wheel builds use a static treelite, because the 'libtreelite.so' in 'treelite' wheels
61+ # isn't intended for dynamic linking by third-party projects (e.g. hides its symbols)
62+ if (USE_LIBCUML_WHEEL)
63+ set (CUML_PYTHON_TREELITE_TARGET treelite::treelite_static)
64+ set (CUML_USE_TREELITE_STATIC ON )
65+ else ()
66+ set (CUML_PYTHON_TREELITE_TARGET treelite::treelite)
67+ set (CUML_USE_TREELITE_STATIC OFF )
68+ endif ()
10469
105- include ( ${CUML_CPP_SRC} /cmake/thirdparty/get_treelite.cmake )
70+ set (CUML_EXCLUDE_TREELITE_FROM_ALL ON )
10671
107- # --- libcuml --- #
108- find_package (cuml "${RAPIDS_VERSION} " REQUIRED )
72+ include (${CUML_CPP_SRC} /cmake/thirdparty/get_treelite.cmake )
10973
110- set (cuml_sg_libraries cuml:: ${CUML_CPP_TARGET} )
111- set (cuml_mg_libraries cuml:: ${CUML_CPP_TARGET} )
74+ # --- libcuml --- #
75+ find_package ( cuml " ${RAPIDS_VERSION} " REQUIRED )
11276
113- if (NOT SINGLEGPU)
114- list (APPEND cuml_mg_libraries cumlprims_mg::cumlprims_mg)
115- endif ()
77+ set (cuml_sg_libraries cuml::${CUML_CPP_TARGET} )
78+ set (cuml_mg_libraries cuml::${CUML_CPP_TARGET} )
11679
117- list ( APPEND CYTHON_FLAGS
118- "--compile-time-env GPUBUILD=1" )
80+ if ( NOT SINGLEGPU)
81+ list ( APPEND cuml_mg_libraries cumlprims_mg::cumlprims_mg )
11982endif ()
12083
12184 ################################################################################
@@ -124,12 +87,6 @@ endif()
12487include ("${CUML_CPP_SRC} /cmake/modules/ConfigureAlgorithms.cmake" )
12588include (cmake/ConfigureCythonAlgorithms.cmake )
12689
127- if (CUML_CPU)
128- # libcuml requires metrics built if HDSCAN is built, which is not the case
129- # for cuml-cpu
130- unset (metrics_algo)
131- endif ()
132-
13390message (VERBOSE "CUML_PY: Building cuML with algorithms: '${CUML_ALGORITHMS} '." )
13491
13592include (rapids-cython-core )
0 commit comments