-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build cuspatial with scikit-build (#524)
This PR switches cuspatial's Python build system to use scikit-build and CMake. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - AJ Schmidt (https://github.com/ajschmidt8) - Mark Harris (https://github.com/harrism) URL: #524
- Loading branch information
Showing
14 changed files
with
174 additions
and
93 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
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,61 @@ | ||
# ============================================================================= | ||
# 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(cuspatial_version 22.06.00) | ||
|
||
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-22.06/RAPIDS.cmake | ||
${CMAKE_BINARY_DIR}/RAPIDS.cmake) | ||
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) | ||
|
||
project( | ||
cuspatial-python | ||
VERSION ${cuspatial_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) | ||
|
||
option(FIND_CUSPATIAL_CPP "Search for existing cuspatial C++ installations before defaulting to local files" | ||
OFF) | ||
|
||
# If the user requested it we attempt to find cuspatial. | ||
if(FIND_CUSPATIAL_CPP) | ||
find_package(cuspatial ${cuspatial_version}) | ||
else() | ||
set(cuspatial_FOUND OFF) | ||
endif() | ||
|
||
if(NOT cuspatial_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(cuspatial) | ||
enable_language(CUDA) | ||
# Since cuspatial only enables CUDA optionally we need to manually include the file that | ||
# rapids_cuda_init_architectures relies on `project` including. | ||
include("${CMAKE_PROJECT_cuspatial_INCLUDE}") | ||
|
||
add_subdirectory(../../cpp cuspatial-cpp) | ||
|
||
install(TARGETS cuspatial DESTINATION cuspatial/_lib) | ||
endif() | ||
|
||
include(rapids-cython) | ||
rapids_cython_init() | ||
|
||
add_subdirectory(cuspatial/_lib) |
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,31 @@ | ||
# ============================================================================= | ||
# 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 | ||
hausdorff.pyx | ||
interpolate.pyx | ||
point_in_polygon.pyx | ||
polygon_bounding_boxes.pyx | ||
polyline_bounding_boxes.pyx | ||
quadtree.pyx | ||
shapefile_reader.pyx | ||
spatial.pyx | ||
spatial_join.pyx | ||
spatial_window.pyx | ||
trajectory.pyx | ||
) | ||
set(linked_libraries cuspatial::cuspatial) | ||
|
||
rapids_cython_create_modules(SOURCE_FILES "${cython_sources}" LINKED_LIBRARIES "${linked_libraries}" | ||
CXX) |
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,24 @@ | ||
# 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. | ||
|
||
[build-system] | ||
|
||
requires = [ | ||
"wheel", | ||
"setuptools", | ||
"cython>=0.29,<0.30", | ||
"scikit-build>=0.13.1", | ||
"cmake>=3.20.1,!=3.23.0", | ||
"ninja", | ||
] |
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