Commit 334ea198 authored by liuji's avatar liuji

Merge branch 'liuji_freespace' of…

Merge branch 'liuji_freespace' of http://git.corp.roadlinks.cn:2020//liuji/get_freespace into liuji_freespace
parents c45b7d7d a665a5fd
cmake_minimum_required(VERSION 3.10)
project(cp_pp_jf)
set(TRT_MAIN_PATH "/host/home/juefx/liuji_workspace/nvidia_lib/TensorRT-8.5.1.7") # office 1660 trt 8
#enable_language(CUDA)
find_package(CUDA REQUIRED)
find_package(PCL 1.8 REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(Boost 1.65.1 REQUIRED system)
find_package(OpenCV REQUIRED)
set(PCL_PTH "pcl-1.8")
set(CUDA_NVCC_PLAGS ${CUDA_NVCC_PLAGS};-std=c++11;-g;-G;-gencode;arch=compute_72;code=sm_72)
add_definitions(-DJFPRE) # use jf preprocess
include_directories("/usr/include/${PCL_PTH}" /usr/include/eigen3)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
message("xavier on")
# add_definitions(-DWERXAVIER)
include_directories(/usr/local/cuda/targets/aarch64-linux/include)
link_directories(/usr/local/cuda/targets/aarch64-linux/lib)
# find_package (OpenCV 4.0.0 REQUIRED)
# include_directories ("/usr/include/opencv4/")
else()
# add_compile_definitions(THRUST_IGNORE_CUB_VERSION_CHECK) # for cuda version >= 11
# message( SEND_ERROR "only valid in xavier!" )
add_definitions(-DBOOST_ERROR_CODE_HEADER_ONLY)
add_definitions(-DWERGPU)
message("=> xavier off")
include_directories("${TRT_MAIN_PATH}/include")
include_directories(/usr/local/cuda/include)
link_directories("${TRT_MAIN_PATH}/lib" )
link_directories(/usr/local/cuda/lib64)
link_directories(/usr/local/lib)
endif()
file(GLOB gpu_source_files "${PROJECT_SOURCE_DIR}/trt/*.cu")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Ofast -Wfatal-errors -D_MWAITXINTRIN_H_INCLUDED")
cuda_add_library(myplugins SHARED ${gpu_source_files})
target_link_libraries(myplugins nvinfer cudart)
# target_include_directories(myplugins PRIVATE)
add_executable(cp_pp_jf ${PROJECT_SOURCE_DIR}/trt/cp_pillar_juefx_local.cc
${PROJECT_SOURCE_DIR}/trt/cp_2d_juefx.cpp)
target_link_libraries(cp_pp_jf nvinfer)
target_link_libraries(cp_pp_jf cudart)
target_link_libraries(cp_pp_jf myplugins)
target_link_libraries(cp_pp_jf nvonnxparser)
target_link_libraries(cp_pp_jf -lm -pthread -lboost_system)
target_link_libraries(cp_pp_jf ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES} ${OpenCV_LIBS})
target_link_libraries(cp_pp_jf -lpcl_filters yaml-cpp)
add_definitions(-O2 -pthread)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment