Skip to content

Commit 649ef15

Browse files
committed
build(cmake): 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 Fixes CVCUDA-450 Signed-off-by: Janusz Lisiecki <[email protected]>
1 parent e4f97ee commit 649ef15

File tree

8 files changed

+9
-1
lines changed

8 files changed

+9
-1
lines changed

python/mod_cvcuda/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ target_link_libraries(cvcuda_module_python
7575
nvcv_util_compat
7676
cvcuda
7777
nvcv_python_common
78+
-lrt
7879
)
7980

8081
set_target_properties(cvcuda_module_python PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/python)

python/mod_nvcv/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ target_link_libraries(nvcv_module_python
7979
nvcv_python_common
8080
CUDA::cudart_static
8181
dlpack::dlpack
82+
-lrt
8283
)
8384

8485
add_library(pynvcv INTERFACE)

src/cvcuda/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ target_link_libraries(cvcuda
6161
PUBLIC
6262
CUDA::cudart_static
6363
nvcv_types
64+
-lrt
6465
PRIVATE
6566
nvcv_util
6667
nvcv_util_symver

src/cvcuda/priv/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,5 @@ target_link_libraries(cvcuda_priv
6464
nvcv_util_sanitizer
6565
cvcuda_legacy
6666
CUDA::cudart_static
67+
-lrt
6768
)

src/cvcuda/priv/legacy/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,5 @@ target_link_libraries(cvcuda_legacy
8181
nvcv_types
8282
nvcv_util
8383
cvcuda_headers
84+
-lrt
8485
)

src/nvcv_types/priv/CMakeLists.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,4 +48,5 @@ target_link_libraries(nvcv_types_priv
4848
nvcv_types_headers
4949
nvcv_util_sanitizer
5050
CUDA::cudart_static
51+
-lrt
5152
)

src/util/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ target_link_libraries(nvcv_util
190190
nvcv_types_headers
191191
CUDA::cudart_static
192192
nvcv_util_compat
193+
-lrt
193194
)
194195

195196
target_compile_definitions(nvcv_util

tests/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ target_link_libraries(nvcv_test_main
3030
PRIVATE
3131
nvcv_types
3232
CUDA::cudart_static
33+
-lrt
3334
)
3435

3536
# Now we want to create a script in the output directory that will run

0 commit comments

Comments
 (0)