Skip to content

Commit

Permalink
Remove another reference to FindcuFile (#17315)
Browse files Browse the repository at this point in the history
The reference in JNI was missed in #17298. Replace it with `FindCUDAToolkit`.

Also backport `FindCUDAToolkit` from CMake 3.31 to get https://gitlab.kitware.com/cmake/cmake/-/commit/b38a8e77cb3c8401b3022a68f07a4fd77b290524.

Also add an option to statically link `cuFile`.

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - Nghia Truong (https://github.com/ttnghia)
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Gera Shegalov (https://github.com/gerashegalov)

URL: #17315
  • Loading branch information
KyleFromNVIDIA authored Nov 15, 2024
1 parent aa8c0c4 commit 81cd4a0
Show file tree
Hide file tree
Showing 4 changed files with 1,463 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ repos:
- cmakelang==0.6.13
verbose: true
require_serial: true
exclude: |
(?x)^(
cpp/cmake/Modules/FindCUDAToolkit[.]cmake$
)
- id: cmake-lint
name: cmake-lint
entry: ./cpp/scripts/run-cmake-format.sh cmake-lint
Expand All @@ -116,6 +120,10 @@ repos:
- cmakelang==0.6.13
verbose: true
require_serial: true
exclude: |
(?x)^(
cpp/cmake/Modules/FindCUDAToolkit[.]cmake$
)
- id: doxygen-check
name: doxygen-check
entry: ./ci/checks/doxygen.sh
Expand Down Expand Up @@ -151,7 +159,8 @@ repos:
(?x)^(
cpp/include/cudf_test/cxxopts[.]hpp$|
cpp/src/io/parquet/ipc/Message_generated[.]h$|
cpp/src/io/parquet/ipc/Schema_generated[.]h$
cpp/src/io/parquet/ipc/Schema_generated[.]h$|
cpp/cmake/Modules/FindCUDAToolkit[.]cmake$
)
- id: verify-alpha-spec
- repo: https://github.com/rapidsai/dependency-file-generator
Expand Down
10 changes: 8 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ option(CUDA_ENABLE_LINEINFO
option(CUDA_WARNINGS_AS_ERRORS "Enable -Werror=all-warnings for all CUDA compilation" ON)
# cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic linking
option(CUDA_STATIC_RUNTIME "Statically link the CUDA runtime" OFF)
option(CUDA_STATIC_CUFILE "Statically link cuFile" OFF)

set(DEFAULT_CUDF_BUILD_STREAMS_TEST_UTIL ON)
if(CUDA_STATIC_RUNTIME OR NOT BUILD_SHARED_LIBS)
Expand Down Expand Up @@ -240,6 +241,7 @@ rapids_cmake_support_conda_env(conda_env MODIFY_PREFIX_PATH)

# ##################################################################################################
# * compiler options ------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH})
rapids_find_package(
CUDAToolkit REQUIRED
BUILD_EXPORT_SET cudf-exports
Expand Down Expand Up @@ -901,7 +903,11 @@ target_compile_definitions(cudf PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${LIBCU
target_compile_definitions(cudf PRIVATE $<$<BOOL:${CUDF_KVIKIO_REMOTE_IO}>:CUDF_KVIKIO_REMOTE_IO>)

# Enable cuFile support
if(TARGET CUDA::cuFile)
set(_cufile_suffix)
if(CUDA_STATIC_CUFILE)
set(_cufile_suffix _static)
endif()
if(TARGET CUDA::cuFile${_cufile_suffix})
target_compile_definitions(cudf PRIVATE CUDF_CUFILE_FOUND)
endif()

Expand All @@ -913,7 +919,7 @@ target_link_libraries(
cudf
PUBLIC CCCL::CCCL rmm::rmm $<BUILD_LOCAL_INTERFACE:BS::thread_pool> spdlog::spdlog_header_only
PRIVATE $<BUILD_LOCAL_INTERFACE:nvtx3::nvtx3-cpp> cuco::cuco ZLIB::ZLIB nvcomp::nvcomp
kvikio::kvikio $<TARGET_NAME_IF_EXISTS:CUDA::cuFile> nanoarrow
kvikio::kvikio $<TARGET_NAME_IF_EXISTS:CUDA::cuFile${_cufile_suffix}> nanoarrow
)

# Add Conda library, and include paths if specified
Expand Down
Loading

0 comments on commit 81cd4a0

Please sign in to comment.