From 8f275f52d7268896850550498715da748f11c0a0 Mon Sep 17 00:00:00 2001 From: William Hicks Date: Fri, 24 Jun 2022 18:16:45 -0400 Subject: [PATCH] Revert "Enable building static libs (#4673)" This reverts commit 61524d79d1c8cdd6a2ba1991ca0bbc7b040e35e2. --- cpp/CMakeLists.txt | 11 ++---- cpp/cmake/thirdparty/get_gputreeshap.cmake | 39 +--------------------- cpp/include/cuml/manifold/common.hpp | 7 ++-- 3 files changed, 5 insertions(+), 52 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 24d0374ba7..3091557c73 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -48,7 +48,6 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) ############################################################################## # - User Options ------------------------------------------------------------ -option(BUILD_SHARED_LIBS "Build cuML shared libraries" ON) option(BUILD_CUML_C_LIBRARY "Build libcuml_c shared library. Contains the cuML C API" ON) option(BUILD_CUML_CPP_LIBRARY "Build libcuml shared library" ON) option(BUILD_CUML_TESTS "Build cuML algorithm tests" ON) @@ -206,11 +205,6 @@ endif() if(all_algo OR treeshap_algo) include(cmake/thirdparty/get_gputreeshap.cmake) - # Workaround until https://github.com/rapidsai/rapids-cmake/issues/176 is resolved - if(NOT BUILD_SHARED_LIBS) - rapids_export_package(BUILD GPUTreeShap cuml-exports) - rapids_export_package(INSTALL GPUTreeShap cuml-exports) - endif() endif() if(NOT SINGLEGPU) @@ -248,7 +242,7 @@ if(BUILD_CUML_CPP_LIBRARY) # single GPU components # common components - add_library(${CUML_CPP_TARGET} + add_library(${CUML_CPP_TARGET} SHARED src/common/logger.cpp) if(all_algo OR arima_algo) @@ -486,7 +480,6 @@ if(BUILD_CUML_CPP_LIBRARY) CXX_STANDARD_REQUIRED ON CUDA_STANDARD 17 CUDA_STANDARD_REQUIRED ON - POSITION_INDEPENDENT_CODE ON INTERFACE_POSITION_INDEPENDENT_CODE ON ) @@ -544,7 +537,7 @@ endif() # - build libcuml C shared library ------------------------------------------- if(BUILD_CUML_C_LIBRARY) - add_library(${CUML_C_TARGET} + add_library(${CUML_C_TARGET} SHARED src/common/cumlHandle.cpp src/common/cuml_api.cpp src/dbscan/dbscan_api.cpp diff --git a/cpp/cmake/thirdparty/get_gputreeshap.cmake b/cpp/cmake/thirdparty/get_gputreeshap.cmake index 271b183a7f..f32ecf90e1 100644 --- a/cpp/cmake/thirdparty/get_gputreeshap.cmake +++ b/cpp/cmake/thirdparty/get_gputreeshap.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021-2022, NVIDIA CORPORATION. +# Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,43 +27,6 @@ function(find_and_configure_gputreeshap) GIT_TAG ${PKG_PINNED_TAG} ) - if (GPUTreeShap_ADDED) - include(GNUInstallDirs) - install(TARGETS GPUTreeShap - EXPORT gputreeshap-exports) - - # clear out incorrect INTERFACE_SOURCES - set_target_properties(GPUTreeShap PROPERTIES INTERFACE_SOURCES "") - get_target_property(all_includes GPUTreeShap INTERFACE_INCLUDE_DIRECTORIES) - # clear out incorrect INTERFACE_INCLUDE_DIRECTORIES - set_target_properties(GPUTreeShap PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "") - # set INTERFACE_INCLUDE_DIRECTORIES appropriately - target_include_directories(GPUTreeShap INTERFACE - $ - $) - - # generate gputreeshap-targets.cmake for install dir - rapids_export(INSTALL GPUTreeShap - EXPORT_SET gputreeshap-exports - GLOBAL_TARGETS GPUTreeShap - NAMESPACE GPUTreeShap::) - - # generate gputreeshap-targets.cmake for binary dir - rapids_export(BUILD GPUTreeShap - EXPORT_SET gputreeshap-exports - GLOBAL_TARGETS GPUTreeShap - NAMESPACE GPUTreeShap::) - - endif() - - # do `find_dependency(GPUTreeShap) in build and install` - rapids_export_package(BUILD GPUTreeShap cuml-exports) - rapids_export_package(INSTALL GPUTreeShap cuml-exports) - - # Tell cmake where it can find the generated gputreeshap-config.cmake we wrote. - include("${rapids-cmake-dir}/export/find_package_root.cmake") - rapids_export_find_package_root(BUILD GPUTreeShap [=[${CMAKE_CURRENT_LIST_DIR}]=] cuml-exports) - set(GPUTreeShap_ADDED ${GPUTreeShap_ADDED} PARENT_SCOPE) endfunction() diff --git a/cpp/include/cuml/manifold/common.hpp b/cpp/include/cuml/manifold/common.hpp index 78d69987fc..53f2e47be1 100644 --- a/cpp/include/cuml/manifold/common.hpp +++ b/cpp/include/cuml/manifold/common.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020-2022, NVIDIA CORPORATION. + * Copyright (c) 2020-2021, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,10 +30,7 @@ typedef int knn_indices_sparse_t; */ template struct knn_graph { - knn_graph(value_idx n_rows_, int n_neighbors_) - : n_rows(n_rows_), n_neighbors(n_neighbors_), knn_indices{nullptr}, knn_dists{nullptr} - { - } + knn_graph(value_idx n_rows_, int n_neighbors_) : n_rows(n_rows_), n_neighbors(n_neighbors_) {} knn_graph(value_idx n_rows_, int n_neighbors_, value_idx* knn_indices_, value_t* knn_dists_) : n_rows(n_rows_), n_neighbors(n_neighbors_), knn_indices(knn_indices_), knn_dists(knn_dists_)