From 333ab8dc02591bab830aa61558607121738722ca Mon Sep 17 00:00:00 2001 From: Janusz Lisiecki Date: Thu, 3 Aug 2023 14:53:22 +0200 Subject: [PATCH] Make CV-CUDA buildable for Jetson - libcudart on Jetson (CUDA 11.8) requires shm_open symbol which is provided by librt, without it linker complains about a missing symbol. This PR makes sure that whenever libcudart is linked -lrt linker flag is added as well Signed-off-by: Janusz Lisiecki --- python/mod_cvcuda/CMakeLists.txt | 1 + python/mod_nvcv/CMakeLists.txt | 1 + src/cvcuda/CMakeLists.txt | 1 + src/cvcuda/priv/CMakeLists.txt | 1 + src/cvcuda/priv/legacy/CMakeLists.txt | 1 + src/nvcv_types/priv/CMakeLists.txt | 1 + src/util/CMakeLists.txt | 1 + tests/CMakeLists.txt | 1 + 8 files changed, 8 insertions(+) diff --git a/python/mod_cvcuda/CMakeLists.txt b/python/mod_cvcuda/CMakeLists.txt index 919ca2af..466aa6b1 100644 --- a/python/mod_cvcuda/CMakeLists.txt +++ b/python/mod_cvcuda/CMakeLists.txt @@ -75,6 +75,7 @@ target_link_libraries(cvcuda_module_python nvcv_util_compat cvcuda nvcv_python_common + -lrt ) set_target_properties(cvcuda_module_python PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python) diff --git a/python/mod_nvcv/CMakeLists.txt b/python/mod_nvcv/CMakeLists.txt index b92c676d..519eb37c 100644 --- a/python/mod_nvcv/CMakeLists.txt +++ b/python/mod_nvcv/CMakeLists.txt @@ -79,6 +79,7 @@ target_link_libraries(nvcv_module_python nvcv_python_common CUDA::cudart_static dlpack::dlpack + -lrt ) add_library(pynvcv INTERFACE) diff --git a/src/cvcuda/CMakeLists.txt b/src/cvcuda/CMakeLists.txt index 891330c3..9e2dcd61 100644 --- a/src/cvcuda/CMakeLists.txt +++ b/src/cvcuda/CMakeLists.txt @@ -61,6 +61,7 @@ target_link_libraries(cvcuda PUBLIC CUDA::cudart_static nvcv_types + -lrt PRIVATE nvcv_util nvcv_util_symver diff --git a/src/cvcuda/priv/CMakeLists.txt b/src/cvcuda/priv/CMakeLists.txt index 2b73f905..a9c25d4a 100644 --- a/src/cvcuda/priv/CMakeLists.txt +++ b/src/cvcuda/priv/CMakeLists.txt @@ -64,4 +64,5 @@ target_link_libraries(cvcuda_priv nvcv_util_sanitizer cvcuda_legacy CUDA::cudart_static + -lrt ) diff --git a/src/cvcuda/priv/legacy/CMakeLists.txt b/src/cvcuda/priv/legacy/CMakeLists.txt index ead5d515..dc6c0c68 100644 --- a/src/cvcuda/priv/legacy/CMakeLists.txt +++ b/src/cvcuda/priv/legacy/CMakeLists.txt @@ -81,4 +81,5 @@ target_link_libraries(cvcuda_legacy nvcv_types nvcv_util cvcuda_headers + -lrt ) diff --git a/src/nvcv_types/priv/CMakeLists.txt b/src/nvcv_types/priv/CMakeLists.txt index ed795a10..92b28a78 100644 --- a/src/nvcv_types/priv/CMakeLists.txt +++ b/src/nvcv_types/priv/CMakeLists.txt @@ -48,4 +48,5 @@ target_link_libraries(nvcv_types_priv nvcv_types_headers nvcv_util_sanitizer CUDA::cudart_static + -lrt ) diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 8ed65867..b500f0ab 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -190,6 +190,7 @@ target_link_libraries(nvcv_util nvcv_types_headers CUDA::cudart_static nvcv_util_compat + -lrt ) target_compile_definitions(nvcv_util diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e7cc7ace..de95135c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -30,6 +30,7 @@ target_link_libraries(nvcv_test_main PRIVATE nvcv_types CUDA::cudart_static + -lrt ) # Now we want to create a script in the output directory that will run