From d6145cfc692f62433def443556a133cf6acef8ee Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Wed, 7 Apr 2021 11:50:31 -0400 Subject: [PATCH] cudf consistently specifies the cuda runtime CMake has two ways to control the CUDA runtime to link too. This makes sure that the CUDA language controls and the CUDAToolkit both target the same runtime --- cpp/CMakeLists.txt | 6 ++++++ cpp/cmake/thirdparty/CUDF_GetArrow.cmake | 1 + 2 files changed, 7 insertions(+) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index b49f1e3dda1..525e5f9225d 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -470,8 +470,14 @@ target_link_libraries(cudf rmm::rmm) if(CUDA_STATIC_RUNTIME) + # Tell CMake what CUDA language runtime to use + set_target_properties(cudf PROPERTIES CUDA_RUNTIME_LIBRARY Static) + # Make sure to export to consumers what runtime we used target_link_libraries(cudf PUBLIC CUDA::cudart_static CUDA::cuda_driver) else() + # Tell CMake what CUDA language runtime to use + set_target_properties(cudf PROPERTIES CUDA_RUNTIME_LIBRARY Shared) + # Make sure to export to consumers what runtime we used target_link_libraries(cudf PUBLIC CUDA::cudart CUDA::cuda_driver) endif() diff --git a/cpp/cmake/thirdparty/CUDF_GetArrow.cmake b/cpp/cmake/thirdparty/CUDF_GetArrow.cmake index 002085c2973..c1c29a693d5 100644 --- a/cpp/cmake/thirdparty/CUDF_GetArrow.cmake +++ b/cpp/cmake/thirdparty/CUDF_GetArrow.cmake @@ -43,6 +43,7 @@ function(find_and_configure_arrow VERSION BUILD_STATIC) GIT_SHALLOW TRUE SOURCE_SUBDIR cpp OPTIONS "CMAKE_VERBOSE_MAKEFILE ON" + "CUDA_USE_STATIC_CUDA_RUNTIME ${CUDA_STATIC_RUNTIME}" "ARROW_IPC ON" "ARROW_CUDA ON" "ARROW_DATASET ON"