Skip to content

Commit

Permalink
Use rapids_cpm_nvtx3 to get same nvtx3 target state as rmm (rapidsai#…
Browse files Browse the repository at this point in the history
…15840)

We need to use the `rapids_cpm_nvtx3` so that the nvtx3 targets, and setup are consistent across rmm and cudf. If we don't we get errors around incorrect exports when building statically or link errors when building shared.

Authors:
  - Robert Maynard (https://github.com/robertmaynard)

Approvers:
  - Vyas Ramasubramani (https://github.com/vyasr)
  - Nghia Truong (https://github.com/ttnghia)
  - Jason Lowe (https://github.com/jlowe)

URL: rapidsai#15840
  • Loading branch information
robertmaynard authored May 23, 2024
1 parent 1710e11 commit f873e23
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
4 changes: 2 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,8 @@ add_dependencies(cudf jitify_preprocess_run)
target_link_libraries(
cudf
PUBLIC ${ARROW_LIBRARIES} CCCL::CCCL rmm::rmm
PRIVATE $<BUILD_LOCAL_INTERFACE:nvtx3-cpp> cuco::cuco ZLIB::ZLIB nvcomp::nvcomp kvikio::kvikio
$<TARGET_NAME_IF_EXISTS:cuFile_interface> nanoarrow
PRIVATE $<BUILD_LOCAL_INTERFACE:nvtx3::nvtx3-cpp> cuco::cuco ZLIB::ZLIB nvcomp::nvcomp
kvikio::kvikio $<TARGET_NAME_IF_EXISTS:cuFile_interface> nanoarrow
)

# Add Conda library, and include paths if specified
Expand Down
2 changes: 1 addition & 1 deletion cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ target_compile_options(
target_link_libraries(
cudf_datagen
PUBLIC GTest::gmock GTest::gtest benchmark::benchmark nvbench::nvbench Threads::Threads cudf
cudftestutil nvtx3-cpp
cudftestutil nvtx3::nvtx3-cpp
PRIVATE $<TARGET_NAME_IF_EXISTS:conda_env>
)

Expand Down
16 changes: 7 additions & 9 deletions cpp/cmake/thirdparty/get_nvtx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
# the License.
# =============================================================================

# This function finds NVTX and sets any additional necessary environment variables.
# Need to call rapids_cpm_nvtx3 to get support for an installed version of nvtx3 and to support
# installing it ourselves
function(find_and_configure_nvtx)
rapids_cpm_find(
NVTX3 3.1.0
GLOBAL_TARGETS nvtx3-c nvtx3-cpp
CPM_ARGS
GIT_REPOSITORY https://github.com/NVIDIA/NVTX.git
GIT_TAG v3.1.0
GIT_SHALLOW TRUE SOURCE_SUBDIR c
)
include(${rapids-cmake-dir}/cpm/nvtx3.cmake)

# Find or install nvtx3
rapids_cpm_nvtx3(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports)

endfunction()

find_and_configure_nvtx()
4 changes: 2 additions & 2 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ function(ConfigureTest CMAKE_TEST_NAME)

target_link_libraries(
${CMAKE_TEST_NAME}
PRIVATE cudftestutil GTest::gmock GTest::gmock_main GTest::gtest GTest::gtest_main nvtx3-cpp
$<TARGET_NAME_IF_EXISTS:conda_env> "${_CUDF_TEST_EXTRA_LIB}"
PRIVATE cudftestutil GTest::gmock GTest::gmock_main GTest::gtest GTest::gtest_main
nvtx3::nvtx3-cpp $<TARGET_NAME_IF_EXISTS:conda_env> "${_CUDF_TEST_EXTRA_LIB}"
)
rapids_cuda_set_runtime(${CMAKE_TEST_NAME} USE_STATIC ${CUDA_STATIC_RUNTIME})
rapids_test_add(
Expand Down
2 changes: 1 addition & 1 deletion java/src/main/native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ endif()
# When nvcomp is installed we need to use nvcomp::nvcomp but from the cudf build directory it will
# just be nvcomp.
target_link_libraries(
cudfjni ${CUDF_LINK} PRIVATE nvtx3-cpp $<TARGET_NAME_IF_EXISTS:nvcomp>
cudfjni ${CUDF_LINK} PRIVATE nvtx3::nvtx3-cpp $<TARGET_NAME_IF_EXISTS:nvcomp>
$<TARGET_NAME_IF_EXISTS:nvcomp::nvcomp>
)

Expand Down

0 comments on commit f873e23

Please sign in to comment.