forked from linClubs/FastBEV-ROS-TensorRT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·168 lines (137 loc) · 3.6 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#!/bin/bash
cmake_minimum_required(VERSION 2.8.12)
project(fastbev)
set(CMAKE_BUILD_PYTHON $ENV{USE_Python})
set(CMAKE_BUILD_TYPE "Release")
# set(CMAKE_BUILD_TYPE "Debug")
set(arch ${CMAKE_HOST_SYSTEM_PROCESSOR})
set(CMAKE_CXX_FLAGS_RELEASE "-std=c++14 -Wextra -Wall -Wno-missing-field-initializers -Wno-deprecated-declarations -O3 -DENABLE_TEXT_BACKEND_STB")
set(CMAKE_CXX_FLAGS_DEBUG "-std=c++14 -O0 -g -DENABLE_TEXT_BACKEND_STB")
set(CUDA_NVCC_FLAGS_RELEASE "-Werror=all-warnings -Xcompiler -std=c++14,-Wextra,-Wall,-Wno-deprecated-declarations,-O3 -DENABLE_TEXT_BACKEND_STB")
set(CUDA_NVCC_FLAGS_DEBUG "-std=c++14 -O0 -g -DENABLE_TEXT_BACKEND_STB")
# set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}
# -gencode arch=compute_$ENV{CUDASM},code=compute_$ENV{CUDASM}
# )
set(CUDA_INCLUDE_DIRS /usr/local/cuda/include)
set(CUDA_LIBS /usr/local/cuda/lib64)
set(CUDASM 86)
set(TensorRT_ROOT /home/lin/software/TensorRT-8.5.3.1)
# set(TensorRT_ROOT ~/share/software/TensorRT-8.5.3.1)
set(TensorRT_INCLUDE_DIRS ${TensorRT_ROOT}/include)
set(TensorRT_LIBS ${TensorRT_ROOT}/lib/)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} -gencode arch=compute_${CUDASM},code=compute_${CUDASM})
find_package(CUDA REQUIRED)
find_package(Protobuf REQUIRED)
find_package(OpenCV)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
message_filters
sensor_msgs
cv_bridge
tf2
# geometry_msgs
# jsk_recognition_msgs
# vision_msgs
roslib
)
include_directories(
${Protobuf_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
${TensorRT_INCLUDE_DIRS}
third_party/stb
third_party/cuOSD/src
third_party/3DSparseConvolution/libspconv/include
src/common
src/
include_ros
${catkin_INCLUDE_DIRS}
)
catkin_package()
link_directories(
${TensorRT_LIBS}
${CUDA_LIBS}
third_party/3DSparseConvolution/libspconv/lib/${arch}
build
)
file(GLOB_RECURSE CORE_FILES
src/fastbev/*.cu
src/fastbev/*.cpp
src/common/tensor.cu
src/common/tensorrt.cpp
)
file(GLOB_RECURSE VISUALIZE_FILES
third_party/cuOSD/src/*.cpp
third_party/cuOSD/src/*.cu
src/common/visualize.cu
)
####################### libfastbev_core.so ##########################
cuda_add_library(fastbev_core SHARED
${CORE_FILES}
)
target_link_libraries(fastbev_core
libcudart.so # CUDA_LIBS
libcublasLt.so # CUDA_LIBS
libnvinfer.so # TensorRT_LIBS
libnvinfer_plugin.so # TensorRT_LIBS
libspconv.so # 3DSparseConvolution
${Protobuf_LIBRARIES}
${OpenCV_LIBS}
)
####################### fastbev program #############################
cuda_add_executable(fastbev
src/main.cpp
${VISUALIZE_FILES}
)
target_link_libraries(fastbev
fastbev_core
libnvinfer.so
libspconv.so
${Protobuf_LIBRARIES}
libnvinfer_plugin.so
${OpenCV_LIBS}
)
cuda_add_executable(01test
src/01test.cpp
${VISUALIZE_FILES}
)
target_link_libraries(01test
fastbev_core
libnvinfer.so
libspconv.so
${Protobuf_LIBRARIES}
libnvinfer_plugin.so
${OpenCV_LIBS}
)
# -----------stb2cv----------
# add_executable(stb2cv src/stb2cv.cpp)
# target_link_libraries(stb2cv ${OpenCV_LIBS})
# ---------------------------
cuda_add_executable(demo
src_ros/demo.cpp
src_ros/fastbev_plugin.cpp
${VISUALIZE_FILES}
)
target_link_libraries(demo
fastbev_core
libnvinfer.so
libspconv.so
${Protobuf_LIBRARIES}
libnvinfer_plugin.so
${OpenCV_LIBS}
)
cuda_add_executable(fastbev_node
src_ros/fastbev_ros_node.cpp
src_ros/fastbev_ros.cpp
src_ros/fastbev_plugin.cpp
${VISUALIZE_FILES}
)
target_link_libraries(fastbev_node
fastbev_core
libnvinfer.so
libspconv.so
${Protobuf_LIBRARIES}
libnvinfer_plugin.so
${OpenCV_LIBS}
${catkin_LIBRARIES}
)