kou commented on PR #37497:
URL: https://github.com/apache/arrow/pull/37497#issuecomment-1702186355

   How about this?
   
   ```diff
   diff --git a/cpp/src/arrow/gpu/ArrowCUDAConfig.cmake.in 
b/cpp/src/arrow/gpu/ArrowCUDAConfig.cmake.in
   index bb36abf24..626c536a0 100644
   --- a/cpp/src/arrow/gpu/ArrowCUDAConfig.cmake.in
   +++ b/cpp/src/arrow/gpu/ArrowCUDAConfig.cmake.in
   @@ -30,6 +30,10 @@ include(CMakeFindDependencyMacro)
    find_dependency(Arrow)
    if(CMAKE_VERSION VERSION_LESS 3.17)
      find_package(CUDA REQUIRED)
   +  add_library(ArrowCUDA::cuda_driver SHARED IMPORTED)
   +  set_target_properties(ArrowCUDA::cuda_driver
   +                        PROPERTIES IMPORTED_LOCATION "${CUDA_CUDA_LIBRARY}"
   +                                   INTERFACE_INCLUDE_DIRECTORIES 
"${CUDA_INCLUDE_DIRS}")
    else()
      find_package(CUDAToolkit REQUIRED)
    endif()
   diff --git a/cpp/src/arrow/gpu/CMakeLists.txt 
b/cpp/src/arrow/gpu/CMakeLists.txt
   index 2556f30f0..a5b176793 100644
   --- a/cpp/src/arrow/gpu/CMakeLists.txt
   +++ b/cpp/src/arrow/gpu/CMakeLists.txt
   @@ -32,8 +32,11 @@ endif()
    set(ARROW_CUDA_LINK_LIBS arrow::flatbuffers)
    if(CMAKE_VERSION VERSION_LESS 3.17)
      find_package(CUDA REQUIRED)
   -  set(ARROW_CUDA_SHARED_LINK_LIBS ${CUDA_CUDA_LIBRARY})
   -  include_directories(SYSTEM ${CUDA_INCLUDE_DIRS})
   +  add_library(ArrowCUDA::cuda_driver SHARED IMPORTED)
   +  set_target_properties(ArrowCUDA::cuda_driver
   +                        PROPERTIES IMPORTED_LOCATION "${CUDA_CUDA_LIBRARY}"
   +                                   INTERFACE_INCLUDE_DIRECTORIES 
"${CUDA_INCLUDE_DIRS}")
   +  set(ARROW_CUDA_SHARED_LINK_LIBS ArrowCUDA::cuda_driver)
    else()
      # find_package(CUDA) is deprecated, and for newer CUDA, it doesn't
      # recognize that the CUDA driver library is in the "stubs" dir, but
   @@ -61,6 +64,7 @@ add_arrow_lib(arrow_cuda
                  ${ARROW_CUDA_SHARED_LINK_LIBS}
                  SHARED_INSTALL_INTERFACE_LIBS
                  Arrow::arrow_shared
   +              ${ARROW_CUDA_SHARED_LINK_LIBS}
                  # Static arrow_cuda must also link against CUDA shared libs
                  STATIC_LINK_LIBS
                  ${ARROW_CUDA_LINK_LIBS}
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to