Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CMake files in libcudf C++ examples to use existing libcudf build if present #15348

Merged
merged 30 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6401ef2
updates for libcudf examples cmake files
mhaseeb123 Mar 20, 2024
360d78a
Applying suggested fixes
mhaseeb123 Mar 20, 2024
24149bb
reverting CUDF_TAG to fetch_dependencies and handle in set_cuda_arch
mhaseeb123 Mar 22, 2024
90bd8b0
Adding CI artifacts to build and run libcudf examples
mhaseeb123 Mar 22, 2024
28ed85b
set cuda_architectures in each example
mhaseeb123 Apr 1, 2024
0f44faf
updates from cmake-format
mhaseeb123 Apr 8, 2024
aafd3be
add working directory variable to avoid mishandled sed
mhaseeb123 Apr 11, 2024
ee0100a
update file permissions for ci to run
mhaseeb123 Apr 12, 2024
8e5dfce
Merge branch 'rapidsai:branch-24.06' into cudf-examples-cmake-fix
mhaseeb123 Apr 16, 2024
9a65213
adding more CI artifacts for examples
mhaseeb123 Apr 16, 2024
51c89a2
Merge branch 'cudf-examples-cmake-fix' of https://github.com/mhaseeb1…
mhaseeb123 Apr 16, 2024
1370176
minor pre-commit fixes
mhaseeb123 Apr 16, 2024
bc00b9e
handle CMAKE_INSTALL_PREFIX in examples build
mhaseeb123 Apr 16, 2024
74aa66a
test CI with default CMAKE_INSTALL_PREFIX
mhaseeb123 Apr 16, 2024
80e705c
Merge branch 'cudf-examples-cmake-fix' of https://github.com/mhaseeb1…
mhaseeb123 Apr 16, 2024
0ac6f61
minor pre-commit fix
mhaseeb123 Apr 16, 2024
3e18bf3
revert custom install prefix and test CI.
mhaseeb123 Apr 16, 2024
fa3bf00
Use $PREFIX as CMAKE_INSTALL_PREFIX
mhaseeb123 Apr 16, 2024
1cbde69
minor fix for paths
mhaseeb123 Apr 16, 2024
a265da7
Merge branch 'branch-24.06' into cudf-examples-cmake-fix
mhaseeb123 Apr 16, 2024
9d8bf76
update install logic and fix for default behavior
mhaseeb123 Apr 16, 2024
f180fa7
Merge branch 'cudf-examples-cmake-fix' of https://github.com/mhaseeb1…
mhaseeb123 Apr 16, 2024
ad3f6a6
incorporting suggested changes from reviews
mhaseeb123 Apr 16, 2024
324e6dc
Merge branch 'branch-24.06' into cudf-examples-cmake-fix
mhaseeb123 Apr 16, 2024
00d1e2b
pre-commit eol
mhaseeb123 Apr 16, 2024
d767c49
Merge branch 'cudf-examples-cmake-fix' of https://github.com/mhaseeb1…
mhaseeb123 Apr 16, 2024
72089ac
apply reviewer suggestions
mhaseeb123 Apr 17, 2024
f984c01
Merge branch 'branch-24.06' into cudf-examples-cmake-fix
mhaseeb123 Apr 17, 2024
c088772
minor improvements
mhaseeb123 Apr 17, 2024
996367d
minor improvements and add default LIB_BUILD_DIR
mhaseeb123 Apr 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cpp/examples/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

cmake_minimum_required(VERSION 3.26.4)

include(../set_cuda_architecture.cmake)

project(
basic_example
VERSION 0.0.1
Expand Down
4 changes: 2 additions & 2 deletions cpp/examples/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.

# libcudf examples build script

Expand All @@ -20,7 +20,7 @@ build_example() {
build_dir="${example_dir}/build"

# Configure
cmake -S ${example_dir} -B ${build_dir} -Dcudf_ROOT="${LIB_BUILD_DIR}"
cmake -S ${example_dir} -B ${build_dir} -Dcudf_ROOT="${LIB_BUILD_DIR}" -DCUDF_TAG=branch-24.06
mhaseeb123 marked this conversation as resolved.
Show resolved Hide resolved
# Build
cmake --build ${build_dir} -j${PARALLEL_LEVEL}
}
Expand Down
13 changes: 9 additions & 4 deletions cpp/examples/fetch_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
set(CPM_DOWNLOAD_VERSION v0.35.3)
set(CPM_DOWNLOAD_VERSION v0.38.5)
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/${CPM_DOWNLOAD_VERSION}/get_cpm.cmake
${CMAKE_BINARY_DIR}/cmake/get_cpm.cmake
)
include(${CMAKE_BINARY_DIR}/cmake/get_cpm.cmake)

set(CUDF_TAG branch-24.06)
# allow using local packages if already installed
set(CPM_USE_LOCAL_PACKAGES ON)
mhaseeb123 marked this conversation as resolved.
Show resolved Hide resolved

# find or build it via CPM
CPMFindPackage(
NAME cudf GIT_REPOSITORY https://github.com/rapidsai/cudf
NAME cudf
FIND_PACKAGE_ARGUMENTS "HINTS ${cudf_ROOT}/latest"
GIT_REPOSITORY https://github.com/rapidsai/cudf
GIT_TAG ${CUDF_TAG}
GIT_SHALLOW
TRUE
SOURCE_SUBDIR
cpp
)
)
4 changes: 3 additions & 1 deletion cpp/examples/nested_types/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) 2023, NVIDIA CORPORATION.
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

cmake_minimum_required(VERSION 3.26.4)

include(../set_cuda_architecture.cmake)

project(
nested_types
VERSION 0.0.1
Expand Down
24 changes: 24 additions & 0 deletions cpp/examples/set_cuda_architecture.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# =============================================================================
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
mhaseeb123 marked this conversation as resolved.
Show resolved Hide resolved
#
# 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}/basic_example_RAPIDS.cmake)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/${CUDF_TAG}/RAPIDS.cmake
${CMAKE_CURRENT_BINARY_DIR}/basic_example_RAPIDS.cmake)
endif()
include(${CMAKE_CURRENT_BINARY_DIR}/basic_example_RAPIDS.cmake)

include(rapids-cuda)

# initialize cuda architectures
rapids_cuda_init_architectures(basic_examples)
rapids_cuda_set_architectures(RAPIDS)
4 changes: 3 additions & 1 deletion cpp/examples/strings/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

cmake_minimum_required(VERSION 3.26.4)

include(../set_cuda_architecture.cmake)

project(
strings_examples
VERSION 0.0.1
Expand Down
Loading