forked from rapidsai/cuml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use CPMFindPackage to retrieve
cumlprims_mg
(rapidsai#4649)
Depends on rapidsai/raft#583 and rapidsai/cumlprims_mg#86 This PR includes a few fixes to support source-only builds: 1. Use `CPMFindPackage` to get `cumlprims_mg` a. This enables building against a local `cumlprims_mg` build (`-D cumlprims_mg_ROOT=/cumlprims_mg/cpp/build`) 2. Explicitly call `find_package(Threads)` to be more resilient to RAFT changes Authors: - Paul Taylor (https://github.com/trxcllnt) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) - Robert Maynard (https://github.com/robertmaynard) URL: rapidsai#4649
- Loading branch information
Showing
18 changed files
with
85 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#============================================================================= | ||
# Copyright (c) 2021, NVIDIA CORPORATION. | ||
# Copyright (c) 2021-2022, NVIDIA CORPORATION. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
|
@@ -14,20 +14,45 @@ | |
# limitations under the License. | ||
#============================================================================= | ||
|
||
set(CUML_MIN_VERSION_cumlprims_mg "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}.00") | ||
set(CUML_BRANCH_VERSION_cumlprims_mg "${CUML_VERSION_MAJOR}.${CUML_VERSION_MINOR}") | ||
|
||
function(find_and_configure_cumlprims_mg) | ||
|
||
if(TARGET cumlprims_mg::cumlprims_mg) | ||
return() | ||
set(oneValueArgs VERSION FORK PINNED_TAG CLONE_ON_PIN) | ||
cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN} ) | ||
|
||
if(PKG_CLONE_ON_PIN AND NOT PKG_PINNED_TAG STREQUAL "branch-${CUML_BRANCH_VERSION_cumlprims_mg}") | ||
message("Pinned tag found: ${PKG_PINNED_TAG}. Cloning cumlprims locally.") | ||
set(CPM_DOWNLOAD_cumlprims_mg ON) | ||
endif() | ||
|
||
rapids_find_generate_module(cumlprims_mg | ||
HEADER_NAMES cumlprims.hpp | ||
LIBRARY_NAMES cumlprims | ||
INCLUDE_SUFFIXES cumlprims | ||
rapids_cpm_find(cumlprims_mg ${PKG_VERSION} | ||
GLOBAL_TARGETS cumlprims_mg::cumlprims_mg | ||
BUILD_EXPORT_SET cuml-exports | ||
INSTALL_EXPORT_SET cuml-exports | ||
CPM_ARGS | ||
GIT_REPOSITORY [email protected]:${PKG_FORK}/cumlprims_mg.git | ||
GIT_TAG ${PKG_PINNED_TAG} | ||
) | ||
|
||
rapids_find_package(cumlprims_mg REQUIRED) | ||
|
||
endfunction() | ||
|
||
find_and_configure_cumlprims_mg() | ||
### | ||
# Change pinned tag and fork here to test a commit in CI | ||
# | ||
# To use a locally-built cumlprims_mg package, set the CMake variable | ||
# `-D cumlprims_mg_ROOT=/path/to/cumlprims_mg/build` | ||
# | ||
# To use a local clone of cumlprims_mg source and allow CMake to build | ||
# cumlprims_mg as part of building cuml itself, set the CMake variable | ||
# `-D CPM_cumlprims_mg_SOURCE=/path/to/cumlprims_mg` | ||
### | ||
find_and_configure_cumlprims_mg(VERSION ${CUML_MIN_VERSION_cumlprims_mg} | ||
FORK rapidsai | ||
PINNED_TAG branch-${CUML_BRANCH_VERSION_cumlprims_mg} | ||
# When PINNED_TAG above doesn't match cuml, | ||
# force local cumlprims_mg clone in build directory | ||
# even if it's already installed. | ||
CLONE_ON_PIN ON | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters