forked from rapidsai/cugraph
-
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.
Update cugraph python build (rapidsai#2378)
This PR updates cugraph python build to use scikit-build instead of setuptools. Scikit-build leverages cmake to build the python extension closes rapidsai#2333 Authors: - Joseph Nke (https://github.com/jnke2016) - Chuck Hastings (https://github.com/ChuckHastings) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Brad Rees (https://github.com/BradReesWork) - Sevag H (https://github.com/sevagh) - Rick Ratzel (https://github.com/rlratzel) - Vyas Ramasubramani (https://github.com/vyasr) URL: rapidsai#2378
- Loading branch information
Showing
45 changed files
with
901 additions
and
198 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,8 @@ cxx_compiler_version: | |
cuda_compiler: | ||
- nvcc | ||
|
||
cmake_version: | ||
- ">=3.20.1,!=3.23.0" | ||
|
||
sysroot_version: | ||
- "2.17" |
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 |
---|---|---|
|
@@ -7,5 +7,8 @@ cxx_compiler_version: | |
cuda_compiler: | ||
- nvcc | ||
|
||
cmake_version: | ||
- ">=3.20.1,!=3.23.0" | ||
|
||
sysroot_version: | ||
- "2.17" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.08/RAPIDS.cmake | ||
${CMAKE_BINARY_DIR}/RAPIDS.cmake | ||
) | ||
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) |
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
|
||
cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR) | ||
|
||
set(cugraph_version 22.08.00) | ||
|
||
include(../../fetch_rapids.cmake) | ||
|
||
project( | ||
cugraph-python | ||
VERSION ${cugraph_version} | ||
LANGUAGES # TODO: Building Python extension modules via the python_extension_module requires the C | ||
# language to be enabled here. The test project that is built in scikit-build to verify | ||
# various linking options for the python library is hardcoded to build with C, so until | ||
# that is fixed we need to keep C. | ||
C CXX | ||
) | ||
|
||
################################################################################ | ||
# - User Options -------------------------------------------------------------- | ||
option(FIND_CUGRAPH_CPP "Search for existing CUGRAPH C++ installations before defaulting to local files" | ||
OFF | ||
) | ||
|
||
# If the user requested it, we attempt to find CUGRAPH. | ||
if(FIND_CUGRAPH_CPP) | ||
find_package(cugraph ${cugraph_version} REQUIRED) | ||
else() | ||
set(cugraph_FOUND OFF) | ||
endif() | ||
|
||
if(NOT cugraph_FOUND) | ||
# TODO: This will not be necessary once we upgrade to CMake 3.22, which will pull in the required | ||
# languages for the C++ project even if this project does not require those languges. | ||
include(rapids-cuda) | ||
rapids_cuda_init_architectures(CUGRAPH) | ||
enable_language(CUDA) | ||
|
||
# Since cugraph only enables CUDA optionally, we need to manually include the file that | ||
# rapids_cuda_init_architectures relies on `project` including. | ||
|
||
include("${CMAKE_PROJECT_cugraph-python_INCLUDE}") | ||
|
||
add_subdirectory(../../cpp cugraph-cpp) | ||
|
||
install(TARGETS cugraph DESTINATION cugraph/library) | ||
endif() | ||
|
||
|
||
include(rapids-cython) | ||
rapids_cython_init() | ||
|
||
add_subdirectory(cugraph/centrality) | ||
add_subdirectory(cugraph/community) | ||
add_subdirectory(cugraph/components) | ||
add_subdirectory(cugraph/cores) | ||
add_subdirectory(cugraph/dask/centrality) | ||
add_subdirectory(cugraph/dask/comms) | ||
add_subdirectory(cugraph/dask/community) | ||
add_subdirectory(cugraph/dask/components) | ||
add_subdirectory(cugraph/dask/link_analysis) | ||
add_subdirectory(cugraph/dask/structure) | ||
add_subdirectory(cugraph/generators) | ||
add_subdirectory(cugraph/internals) | ||
add_subdirectory(cugraph/layout) | ||
add_subdirectory(cugraph/linear_assignment) | ||
add_subdirectory(cugraph/link_analysis) | ||
add_subdirectory(cugraph/link_prediction) | ||
add_subdirectory(cugraph/sampling) | ||
add_subdirectory(cugraph/structure) | ||
add_subdirectory(cugraph/tree) | ||
add_subdirectory(cugraph/utilities) |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
|
||
set(cython_sources | ||
betweenness_centrality_wrapper.pyx | ||
edge_betweenness_centrality_wrapper.pyx | ||
) | ||
set(linked_libraries cugraph::cugraph) | ||
|
||
rapids_cython_create_modules( | ||
CXX | ||
SOURCE_FILES "${cython_sources}" | ||
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX centrality_ | ||
) | ||
|
||
foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) | ||
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library") | ||
endforeach() |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
|
||
set(cython_sources | ||
ecg_wrapper.pyx egonet_wrapper.pyx | ||
ktruss_subgraph_wrapper.pyx | ||
leiden_wrapper.pyx | ||
louvain_wrapper.pyx | ||
spectral_clustering_wrapper.pyx | ||
subgraph_extraction_wrapper.pyx | ||
triangle_count_wrapper.pyx | ||
) | ||
|
||
set(linked_libraries cugraph::cugraph) | ||
rapids_cython_create_modules( | ||
CXX | ||
SOURCE_FILES "${cython_sources}" | ||
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX community_ | ||
) | ||
|
||
foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) | ||
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library") | ||
endforeach() |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
|
||
set(cython_sources connectivity_wrapper.pyx) | ||
set(linked_libraries cugraph::cugraph) | ||
rapids_cython_create_modules( | ||
CXX | ||
SOURCE_FILES "${cython_sources}" | ||
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX components_ | ||
) | ||
|
||
foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) | ||
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library") | ||
endforeach() |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
|
||
set(cython_sources k_core_wrapper.pyx) | ||
set(linked_libraries cugraph::cugraph) | ||
rapids_cython_create_modules( | ||
CXX | ||
SOURCE_FILES "${cython_sources}" | ||
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX cores_ | ||
) | ||
|
||
foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) | ||
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../library") | ||
endforeach() |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ============================================================================= | ||
# Copyright (c) 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. 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. | ||
# ============================================================================= | ||
|
||
set(cython_sources mg_katz_centrality_wrapper.pyx) | ||
set(linked_libraries cugraph::cugraph) | ||
rapids_cython_create_modules( | ||
CXX | ||
SOURCE_FILES "${cython_sources}" | ||
LINKED_LIBRARIES "${linked_libraries}" MODULE_PREFIX centrality_ | ||
) | ||
|
||
foreach(cython_module IN LISTS RAPIDS_CYTHON_CREATED_TARGETS) | ||
set_target_properties(${cython_module} PROPERTIES INSTALL_RPATH "\$ORIGIN;\$ORIGIN/../../library") | ||
endforeach() |
Oops, something went wrong.