Skip to content

Commit

Permalink
cudf consistently specifies the cuda runtime
Browse files Browse the repository at this point in the history
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
  • Loading branch information
robertmaynard committed Apr 7, 2021
1 parent 5f84ea8 commit d6145cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions cpp/cmake/thirdparty/CUDF_GetArrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d6145cf

Please sign in to comment.