opencv编译
请点我
问题1 CMakeLists.txt的写法
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}" ${CMAKE_MODULE_PATH})
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
project(Gaofa_Infer_Cpp)
# Threads
find_package(Threads)
# CUDA
find_package(CUDA REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
message("CUDA_TOOLKIT_ROOT_DIR = ${CUDA_TOOLKIT_ROOT_DIR}")
message("CUDA_INCLUDE_DIRS = ${CUDA_INCLUDE_DIRS}")
message("CUDA_LIBRARIES = ${CUDA_LIBRARIES}")
find_package(CUDA REQUIRED)
message(STATUS "Find CUDA include at ${CUDA_INCLUDE_DIRS}")
message(STATUS "Find CUDA libraries: ${CUDA_LIBRARIES}")
# TensorRT
set(TENSORRT_ROOT TensorRT-7.2.2.3路径)
find_path(TENSORRT_INCLUDE_DIR NvInfer.h
HINTS ${TENSORRT_R

本文详细介绍了在Ubuntu系统中编译OpenCV、TensorRT、CUDA和Boost库的过程,包括CMakeLists.txt的配置、依赖库的查找以及遇到的错误和解决方案。例如,解决找不到Qt5Widgets模块的问题,以及TensorRT运行时的cublasStatus错误和myelin版本不匹配问题。此外,还提到了库文件的链接和添加库目录的步骤。
最低0.47元/天 解锁文章
526





