Skip to content

Hotfix/cudev cmake interface #3890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 4.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
clean up unnecessary libs for cudev
  • Loading branch information
braindevices committed Feb 22, 2025
commit 0228cfa83ae02d7e80933a8cce210c7ac9926197
23 changes: 3 additions & 20 deletions modules/cudev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,11 @@ if(ENABLE_CUDA_FIRST_CLASS_LANGUAGE)
if(UNIX AND NOT BUILD_SHARED_LIBS AND CUDA_VERSION_STRING VERSION_GREATER_EQUAL 9.2 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.23)
set(CUDA_FFT_LIB_EXT "_static_nocallback")
endif()
list(APPEND extra_dependencies CUDA::cudart_static CUDA::nppial${CUDA_LIB_EXT} CUDA::nppc${CUDA_LIB_EXT} CUDA::nppitc${CUDA_LIB_EXT} CUDA::nppig${CUDA_LIB_EXT} CUDA::nppist${CUDA_LIB_EXT} CUDA::nppidei${CUDA_LIB_EXT})
if(HAVE_CUBLAS)
list(APPEND optional_dependencies CUDA::cublas${CUDA_LIB_EXT})
if(NOT CUDA_VERSION VERSION_LESS 10.1)
list(APPEND optional_dependencies CUDA::cublasLt${CUDA_LIB_EXT})
endif()
endif()
if(HAVE_CUFFT)
# static version requires seperable compilation which is incompatible with opencv's current library structure
# the cufft_static_nocallback variant does not requires seperable compilation. callbacks are currently not used.
list(APPEND optional_dependencies CUDA::cufft${CUDA_FFT_LIB_EXT})
endif()
else()
if(HAVE_CUBLAS)
list(APPEND optional_dependencies ${CUDA_cublas_LIBRARY})
endif()
if(HAVE_CUFFT)
list(APPEND optional_dependencies ${CUDA_cufft_LIBRARY})
endif()
list(APPEND extra_dependencies CUDA::cudart_static)

endif()

ocv_add_module(cudev opencv_core ${extra_dependencies} OPTIONAL opencv_cudev ${optional_dependencies} WRAP python)
ocv_add_module(cudev opencv_core ${extra_dependencies} OPTIONAL ${optional_dependencies} WRAP python)

ocv_module_include_directories()
ocv_glob_module_sources()
Expand Down