diff --git a/ci/build_docs.sh b/ci/build_docs.sh index b04dff1fc..9e43c6b22 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. set -euo pipefail @@ -27,7 +27,9 @@ rapids-mamba-retry install \ cuspatial \ cuproj -export RAPIDS_VERSION_NUMBER="24.04" +export RAPIDS_VERSION="$(rapids-version)" +export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)" +export RAPIDS_VERSION_NUMBER="$RAPIDS_VERSION_MAJOR_MINOR" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build cuSpatial CPP docs" diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index deeb9d53f..8bf47d77f 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -1,4 +1,5 @@ #!/bin/bash +# Copyright (c) 2019-2024, NVIDIA CORPORATION. ############################# # cuSpatial Version Updater # ############################# @@ -29,33 +30,9 @@ function sed_runner() { sed -i.bak ''"$1"'' $2 && rm -f ${2}.bak } -# python/cpp update -sed_runner 's/'"CUSPATIAL VERSION .* LANGUAGES"'/'"CUSPATIAL VERSION ${NEXT_FULL_TAG} LANGUAGES"'/g' cpp/CMakeLists.txt -sed_runner 's/'"CUPROJ VERSION .* LANGUAGES"'/'"CUPROJ VERSION ${NEXT_FULL_TAG} LANGUAGES"'/g' cpp/cuproj/CMakeLists.txt -sed_runner 's/'"cuspatial_version .*)"'/'"cuspatial_version ${NEXT_FULL_TAG})"'/g' python/cuspatial/CMakeLists.txt -sed_runner 's/'"cuproj_version .*)"'/'"cuproj_version ${NEXT_FULL_TAG})"'/g' python/cuproj/CMakeLists.txt -sed_runner 's/'"cuproj_version .*)"'/'"cuproj_version ${NEXT_FULL_TAG})"'/g' python/cuproj/cuproj/cuprojshim/CMakeLists.txt - -# RTD update -sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/source/conf.py -sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/source/conf.py -sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/cuproj/source/conf.py -sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/cuproj/source/conf.py - # Centralized version file update echo "${NEXT_FULL_TAG}" > VERSION -# rapids-cmake version -sed_runner 's/'"branch-.*\/RAPIDS.cmake"'/'"branch-${NEXT_SHORT_TAG}\/RAPIDS.cmake"'/g' fetch_rapids.cmake - -# Doxyfile update - cuspatial -sed_runner "/PROJECT_NUMBER[ ]*=/ s|=.*|= ${NEXT_FULL_TAG}|g" cpp/doxygen/Doxyfile -sed_runner "/TAGFILES/ s|[0-9]\+.[0-9]\+|${NEXT_SHORT_TAG}|g" cpp/doxygen/Doxyfile - -#Doxyfile update - cuproj -sed_runner "/PROJECT_NUMBER[ ]*=/ s|=.*|= ${NEXT_FULL_TAG}|g" cpp/cuproj/doxygen/Doxyfile -sed_runner "/TAGFILES/ s|[0-9]\+.[0-9]\+|${NEXT_SHORT_TAG}|g" cpp/cuproj/doxygen/Doxyfile - # CI files for FILE in .github/workflows/*.yaml; do sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}" diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index f73fd6b7d..1de36d515 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2019-2023, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -include(../fetch_rapids.cmake) +include(../rapids_config.cmake) include(rapids-cmake) include(rapids-cpm) include(rapids-cuda) @@ -25,7 +25,7 @@ include(rapids-find) rapids_cuda_init_architectures(CUSPATIAL) -project(CUSPATIAL VERSION 24.04.00 LANGUAGES C CXX CUDA) +project(CUSPATIAL VERSION "${RAPIDS_VERSION}" LANGUAGES C CXX CUDA) # Needed because GoogleBenchmark changes the state of FindThreads.cmake, # causing subsequent runs to have different values for the `Threads::Threads` target. @@ -296,7 +296,7 @@ if(DOXYGEN_FOUND) add_custom_command( OUTPUT CUSPATIAL_DOXYGEN WORKING_DIRECTORY ${CUSPATIAL_SOURCE_DIR}/doxygen - COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile + COMMAND ${CMAKE_COMMAND} -E env "RAPIDS_VERSION=${RAPIDS_VERSION}" "RAPIDS_VERSION_MAJOR_MINOR=${RAPIDS_VERSION_MAJOR_MINOR}" ${DOXYGEN_EXECUTABLE} Doxyfile VERBATIM COMMENT "Custom command for building cuspatial doxygen docs." ) diff --git a/cpp/cuproj/CMakeLists.txt b/cpp/cuproj/CMakeLists.txt index fe339760f..35ba0277e 100644 --- a/cpp/cuproj/CMakeLists.txt +++ b/cpp/cuproj/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 3.23.1 FATAL_ERROR) -include(../../fetch_rapids.cmake) +include(../../rapids_config.cmake) include(rapids-cmake) include(rapids-cpm) include(rapids-cuda) @@ -25,7 +25,7 @@ include(rapids-find) rapids_cuda_init_architectures(CUPROJ) -project(CUPROJ VERSION 24.04.00 LANGUAGES C CXX CUDA) +project(CUPROJ VERSION "${RAPIDS_VERSION}" LANGUAGES C CXX CUDA) # Needed because GoogleBenchmark changes the state of FindThreads.cmake, # causing subsequent runs to have different values for the `Threads::Threads` target. @@ -237,7 +237,7 @@ if(DOXYGEN_FOUND) add_custom_command( OUTPUT CUPROJ_DOXYGEN WORKING_DIRECTORY ${CUPROJ_SOURCE_DIR}/doxygen - COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile + COMMAND ${CMAKE_COMMAND} -E env "RAPIDS_VERSION=${RAPIDS_VERSION}" "RAPIDS_VERSION_MAJOR_MINOR=${RAPIDS_VERSION_MAJOR_MINOR}" ${DOXYGEN_EXECUTABLE} Doxyfile VERBATIM COMMENT "Custom command for building cuproj doxygen docs." ) diff --git a/cpp/cuproj/doxygen/Doxyfile b/cpp/cuproj/doxygen/Doxyfile index 55c780084..986e5d6c6 100644 --- a/cpp/cuproj/doxygen/Doxyfile +++ b/cpp/cuproj/doxygen/Doxyfile @@ -48,7 +48,7 @@ PROJECT_NAME = libcuproj # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 24.04.00 +PROJECT_NUMBER = $(RAPIDS_VERSION) # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -2345,7 +2345,7 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/24.04 "libcudf.tag=https://docs.rapids.ai/api/libcudf/24.04" +TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/$(RAPIDS_VERSION_MAJOR_MINOR) "libcudf.tag=https://docs.rapids.ai/api/libcudf/$(RAPIDS_VERSION_MAJOR_MINOR)" # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to diff --git a/cpp/doxygen/Doxyfile b/cpp/doxygen/Doxyfile index eb4bbff22..2cc6f51d3 100644 --- a/cpp/doxygen/Doxyfile +++ b/cpp/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "libcuspatial" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 24.04.00 +PROJECT_NUMBER = $(RAPIDS_VERSION) # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -2171,7 +2171,7 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/24.04 "libcudf.tag=https://docs.rapids.ai/api/libcudf/24.04" +TAGFILES = rmm.tag=https://docs.rapids.ai/api/librmm/$(RAPIDS_VERSION_MAJOR_MINOR) "libcudf.tag=https://docs.rapids.ai/api/libcudf/$(RAPIDS_VERSION_MAJOR_MINOR)" # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to diff --git a/docs/cuproj/source/conf.py b/docs/cuproj/source/conf.py index 06cdfac0e..f11b5bd82 100644 --- a/docs/cuproj/source/conf.py +++ b/docs/cuproj/source/conf.py @@ -1,10 +1,14 @@ -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, NVIDIA CORPORATION. # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' +from packaging.version import Version + +import cuproj + # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. @@ -49,10 +53,11 @@ # |version| and |release|, also used in various other places throughout the # built documents. # +CUPROJ_VERSION = Version(cuproj.__version__) # The short X.Y version. -version = '24.04' +version = f"{CUPROJ_VERSION.major:02}.{CUPROJ_VERSION.minor:02}" # The full version, including alpha/beta/rc tags. -release = '24.04.00' +release = f"{CUPROJ_VERSION.major:02}.{CUPROJ_VERSION.minor:02}.{CUPROJ_VERSION.micro:02}" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/conf.py b/docs/source/conf.py index 791d59308..569ce8806 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,10 +1,14 @@ -# Copyright (c) 2018-2023, NVIDIA CORPORATION. +# Copyright (c) 2018-2024, NVIDIA CORPORATION. # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' +from packaging.version import Version + +import cuspatial + # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. @@ -49,10 +53,11 @@ # |version| and |release|, also used in various other places throughout the # built documents. # +CUSPATIAL_VERSION = Version(cuspatial.__version__) # The short X.Y version. -version = '24.04' +version = f"{CUSPATIAL_VERSION.major:02}.{CUSPATIAL_VERSION.minor:02}" # The full version, including alpha/beta/rc tags. -release = '24.04.00' +release = f"{CUSPATIAL_VERSION.major:02}.{CUSPATIAL_VERSION.minor:02}.{CUSPATIAL_VERSION.micro:02}" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/fetch_rapids.cmake b/fetch_rapids.cmake deleted file mode 100644 index f67ba4491..000000000 --- a/fetch_rapids.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# ============================================================================= -# Copyright (c) 2018-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. -# ============================================================================= -if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/CUSPATIAL_RAPIDS.cmake) - file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-24.04/RAPIDS.cmake - ${CMAKE_BINARY_DIR}/CUSPATIAL_RAPIDS.cmake - ) -endif() -include(${CMAKE_BINARY_DIR}/CUSPATIAL_RAPIDS.cmake) diff --git a/java/src/main/native/CMakeLists.txt b/java/src/main/native/CMakeLists.txt index 071f0ca37..b02e201d5 100755 --- a/java/src/main/native/CMakeLists.txt +++ b/java/src/main/native/CMakeLists.txt @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2019-2020, NVIDIA CORPORATION. +# Copyright (c) 2019-2024, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ #============================================================================= cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -include(../../../../fetch_rapids.cmake) +include(../../../../rapids_config.cmake) # TODO: The logic for setting the architectures was previously not here. Was # that just an oversight, or is there a reason not to include this here? diff --git a/python/cuproj/CMakeLists.txt b/python/cuproj/CMakeLists.txt index 76dd5c814..2f7b743b0 100644 --- a/python/cuproj/CMakeLists.txt +++ b/python/cuproj/CMakeLists.txt @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -14,15 +14,13 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuproj_version 24.04.00) - -include(../../fetch_rapids.cmake) +include(../../rapids_config.cmake) include(rapids-cuda) rapids_cuda_init_architectures(cuproj-python) project( cuproj-python - VERSION ${cuproj_version} + VERSION "${RAPIDS_VERSION}" LANGUAGES CXX CUDA) option(FIND_CUPROJ_CPP "Search for existing cuproj C++ installations before defaulting to local files" @@ -30,7 +28,7 @@ option(FIND_CUPROJ_CPP "Search for existing cuproj C++ installations before defa # If the user requested it we attempt to find cuproj. if(FIND_CUPROJ_CPP) - find_package(cuproj ${cuproj_version}) + find_package(cuproj "${RAPIDS_VERSION}") else() set(cuproj_FOUND OFF) endif() diff --git a/python/cuproj/cuproj/cuprojshim/CMakeLists.txt b/python/cuproj/cuproj/cuprojshim/CMakeLists.txt index 57f2abeab..00769965f 100644 --- a/python/cuproj/cuproj/cuprojshim/CMakeLists.txt +++ b/python/cuproj/cuproj/cuprojshim/CMakeLists.txt @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2023, NVIDIA CORPORATION. +# Copyright (c) 2023-2024, 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 @@ -14,9 +14,7 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuproj_version 24.04.00) - -include(../../../../fetch_rapids.cmake) +include(../../../../rapids_config.cmake) include(rapids-cmake) include(rapids-cpm) include(rapids-cuda) @@ -26,7 +24,7 @@ rapids_cuda_init_architectures(CUPROJSHIM) project( CUPROJSHIM - VERSION ${cuproj_version} + VERSION "${RAPIDS_VERSION}" LANGUAGES CXX CUDA) diff --git a/python/cuspatial/CMakeLists.txt b/python/cuspatial/CMakeLists.txt index 92126b90f..e3678c311 100644 --- a/python/cuspatial/CMakeLists.txt +++ b/python/cuspatial/CMakeLists.txt @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, 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 @@ -14,15 +14,13 @@ cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) -set(cuspatial_version 24.04.00) - -include(../../fetch_rapids.cmake) +include(../../rapids_config.cmake) include(rapids-cuda) rapids_cuda_init_architectures(cuspatial-python) project( cuspatial-python - VERSION ${cuspatial_version} + VERSION "${RAPIDS_VERSION}" LANGUAGES CXX CUDA) option(FIND_CUSPATIAL_CPP "Search for existing cuspatial C++ installations before defaulting to local files" @@ -30,7 +28,7 @@ option(FIND_CUSPATIAL_CPP "Search for existing cuspatial C++ installations befor # If the user requested it we attempt to find cuspatial. if(FIND_CUSPATIAL_CPP) - find_package(cuspatial ${cuspatial_version}) + find_package(cuspatial "${RAPIDS_VERSION}") else() set(cuspatial_FOUND OFF) endif() diff --git a/rapids_config.cmake b/rapids_config.cmake new file mode 100644 index 000000000..40207b870 --- /dev/null +++ b/rapids_config.cmake @@ -0,0 +1,36 @@ +# ============================================================================= +# Copyright (c) 2018-2024, 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(READ "${CMAKE_CURRENT_LIST_DIR}/VERSION" _rapids_version) +if(_rapids_version MATCHES [[^([0-9][0-9])\.([0-9][0-9])\.([0-9][0-9])]]) + set(RAPIDS_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(RAPIDS_VERSION_MINOR "${CMAKE_MATCH_2}") + set(RAPIDS_VERSION_PATCH "${CMAKE_MATCH_3}") + set(RAPIDS_VERSION_MAJOR_MINOR "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}") + set(RAPIDS_VERSION "${RAPIDS_VERSION_MAJOR}.${RAPIDS_VERSION_MINOR}.${RAPIDS_VERSION_PATCH}") +else() + string(REPLACE "\n" "\n " _rapids_version_formatted " ${_rapids_version}") + message( + FATAL_ERROR + "Could not determine RAPIDS version. Contents of VERSION file:\n${_rapids_version_formatted}" + ) +endif() + +if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/CUSPATIAL_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake") + file( + DOWNLOAD + "https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-${RAPIDS_VERSION_MAJOR_MINOR}/RAPIDS.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/CUSPATIAL_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake" + ) +endif() +include("${CMAKE_CURRENT_BINARY_DIR}/CUSPATIAL_RAPIDS-${RAPIDS_VERSION_MAJOR_MINOR}.cmake")