From c45ff5f9fa2855c7123d4cd094c48c2aee527ed0 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 11 Oct 2024 15:06:47 -0500 Subject: [PATCH 1/2] remove unused variables in build_docs script (#1469) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributes to https://github.com/rapidsai/build-planning/issues/106 This project doesn't need any of the changes that are being made as part of that issue across most other repos... it's already doing all of its `pip` and `conda` installs in CI in single installs (which is strict and safe) 🎉 This small PR just makes its handling of environment variables in `ci/build_docs.sh` consistent with other RAPIDS repos, in the interest of keeping those scripts looking similar so it's easy to apply changes across all RAPIDS projects. ref: https://github.com/rapidsai/cudf/pull/17013#discussion_r1792163289 Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Mark Harris (https://github.com/harrism) - Mike Sarahan (https://github.com/msarahan) URL: https://github.com/rapidsai/cuspatial/pull/1469 --- ci/build_docs.sh | 3 +-- ci/release/update-version.sh | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/build_docs.sh b/ci/build_docs.sh index 3ce57b2d8..ab2b56c35 100755 --- a/ci/build_docs.sh +++ b/ci/build_docs.sh @@ -23,7 +23,6 @@ rapids-print-env export RAPIDS_VERSION="$(rapids-version)" export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)" -export RAPIDS_VERSION_NUMBER="24.12" export RAPIDS_DOCS_DIR="$(mktemp -d)" rapids-logger "Build cuSpatial CPP docs" @@ -54,4 +53,4 @@ mkdir -p "${RAPIDS_DOCS_DIR}/cuproj/html" mv _html/* "${RAPIDS_DOCS_DIR}/cuproj/html" popd -rapids-upload-docs +RAPIDS_VERSION_NUMBER="${RAPIDS_VERSION_MAJOR_MINOR}" rapids-upload-docs diff --git a/ci/release/update-version.sh b/ci/release/update-version.sh index 03c05e9c4..dfd0fe7e3 100755 --- a/ci/release/update-version.sh +++ b/ci/release/update-version.sh @@ -40,7 +40,6 @@ echo "${NEXT_FULL_TAG}" > VERSION for FILE in .github/workflows/*.yaml; do sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}" done -sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_SHORT_TAG}\"/g" ci/build_docs.sh DEPENDENCIES=( pylibcudf From 8314c1365ddde9d630a8d4e22d82fcba4ea926d8 Mon Sep 17 00:00:00 2001 From: Basit Ayantunde Date: Wed, 16 Oct 2024 15:14:39 +0100 Subject: [PATCH 2/2] Updated libcudftestutil CMake linking logic for 24.12 (#1475) This merge request fixes the CMake linking logic to cudftestutil for branch-24.12, allowing you to specify which version of GTest/GBench to use as long as the API is source compatible. Follows up on: https://github.com/rapidsai/cudf/pull/16839 Authors: - Basit Ayantunde (https://github.com/lamarrr) Approvers: - Mark Harris (https://github.com/harrism) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1475 --- cpp/CMakeLists.txt | 2 +- cpp/benchmarks/CMakeLists.txt | 6 +++++- cpp/cmake/thirdparty/get_cudf.cmake | 4 ++-- cpp/tests/CMakeLists.txt | 28 +++++++++++++++++++++++++++- cpp/tests/test_common.cpp | 15 +++++++++++++++ 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 cpp/tests/test_common.cpp diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 8908617b1..aac5aea43 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -68,7 +68,7 @@ set(CUSPATIAL_BUILD_TESTS ${BUILD_TESTS}) set(CUSPATIAL_BUILD_BENCHMARKS ${BUILD_BENCHMARKS}) set(CUSPATIAL_CXX_FLAGS "") -set(CUSPATIAL_CUDA_FLAGS "") +set(CUSPATIAL_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) set(CUSPATIAL_CXX_DEFINITIONS "") set(CUSPATIAL_CUDA_DEFINITIONS "") diff --git a/cpp/benchmarks/CMakeLists.txt b/cpp/benchmarks/CMakeLists.txt index 10e626f3f..98506d9a4 100644 --- a/cpp/benchmarks/CMakeLists.txt +++ b/cpp/benchmarks/CMakeLists.txt @@ -23,6 +23,9 @@ add_library(cuspatial_benchmark_common OBJECT target_compile_features(cuspatial_benchmark_common PUBLIC cxx_std_17 cuda_std_17) +target_compile_options(cuspatial_benchmark_common PUBLIC "$<$:${CUSPATIAL_CXX_FLAGS}>" + "$<$:${CUSPATIAL_CUDA_FLAGS}>") + set_target_properties(cuspatial_benchmark_common PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$" INSTALL_RPATH "\$ORIGIN/../../../lib" @@ -38,7 +41,8 @@ target_link_libraries(cuspatial_benchmark_common PUBLIC benchmark::benchmark cudf::cudftestutil ranger::ranger - cuspatial) + cuspatial GTest::gtest GTest::gmock + PRIVATE cudf::cudftestutil_impl) target_compile_options(cuspatial_benchmark_common PUBLIC "$<$:${CUSPATIAL_CXX_FLAGS}>" diff --git a/cpp/cmake/thirdparty/get_cudf.cmake b/cpp/cmake/thirdparty/get_cudf.cmake index 3d7232fba..c5d2712c9 100644 --- a/cpp/cmake/thirdparty/get_cudf.cmake +++ b/cpp/cmake/thirdparty/get_cudf.cmake @@ -1,5 +1,5 @@ #============================================================================= -# Copyright (c) 2021-2023, NVIDIA CORPORATION. +# Copyright (c) 2021-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. @@ -27,7 +27,7 @@ function(find_and_configure_cudf) set(cudf_components "") if(BUILD_TESTS OR BUILD_BENCHMARKS) - list(APPEND global_targets cudf::cudftestutil) + list(APPEND global_targets cudf::cudftestutil cudf::cudftestutil_impl) set(cudf_components COMPONENTS testing) endif() diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index f6752c860..7bca36a41 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -17,6 +17,32 @@ ################################################################################################### # - compiler function ----------------------------------------------------------------------------- +# cudftestutil_impl is an interface source library, this empty object +# library is used to speed-up compilation and linking against it, +# otherwise we pay the non-trivial compilation cost repeatedly for each +# test executable +add_library(cuspatial_test_common OBJECT test_common.cpp) + +target_compile_features(cuspatial_test_common PUBLIC cxx_std_17 cuda_std_17) + +set_target_properties(cuspatial_test_common + PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$" + INSTALL_RPATH "\$ORIGIN/../../../lib" + CXX_STANDARD 17 + CXX_STANDARD_REQUIRED ON + CUDA_STANDARD 17 + CUDA_STANDARD_REQUIRED ON + POSITION_INDEPENDENT_CODE ON + INTERFACE_POSITION_INDEPENDENT_CODE ON +) + +target_link_libraries(cuspatial_test_common + PUBLIC cudf::cudftestutil GTest::gtest GTest::gmock + PRIVATE cudf::cudftestutil_impl) + +target_compile_options(cuspatial_test_common PUBLIC "$<$:${CUSPATIAL_CXX_FLAGS}>" +"$<$:${CUSPATIAL_CUDA_FLAGS}>") + function(ConfigureTest CMAKE_TEST_NAME) add_executable(${CMAKE_TEST_NAME} ${ARGN}) target_compile_options(${CMAKE_TEST_NAME} @@ -34,7 +60,7 @@ function(ConfigureTest CMAKE_TEST_NAME) CUDA_STANDARD 17 CUDA_STANDARD_REQUIRED ON ) - target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial) + target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial cuspatial_test_common) add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME}) install( TARGETS ${CMAKE_TEST_NAME} diff --git a/cpp/tests/test_common.cpp b/cpp/tests/test_common.cpp new file mode 100644 index 000000000..244bc0c4b --- /dev/null +++ b/cpp/tests/test_common.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (c) 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. + */