-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide XRoc Sample #6
Open
kevinwhzou
wants to merge
7
commits into
HorizonRobotics:master
Choose a base branch
from
kevinwhzou:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e0987e4
Provide XRoc Sample
7422b7b
clear cmake config
c511796
clear cmake config
3f388f4
Unified build framework style with other sample
28aa59d
change readme
630fbc7
update README.md user manual
fb0ad55
update user manual
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
cmake_minimum_required(VERSION 2.8) | ||
option(PARENT_BUILD "is build from parent" OFF) | ||
if(NOT ${PARENT_BUILD}) | ||
include(cmake/hobot_util.cmake) | ||
endif() | ||
project(xroc-framework-example) | ||
|
||
option(RELEASE_LIB "build version of release" ON) | ||
|
||
if (${RELEASE_LIB}) | ||
set(CMAKE_BUILD_TYPE Release) | ||
else () | ||
set(CMAKE_BUILD_TYPE Debug) | ||
endif () | ||
|
||
if (${PLATFORM_MAC}) | ||
add_definitions(-DHR_POSIX) | ||
add_definitions(-DHR_MAC) | ||
elseif (${PLATFORM_LINUX}) | ||
add_definitions(-DHR_POSIX) | ||
add_definitions(-DHR_LINUX) | ||
if(NOT(${arch} STREQUAL "default") AND NOT(${arch} STREQUAL "x86")) | ||
if(${arch} STREQUAL "arm_hi3519") | ||
list(APPEND CMAKE_C_FLAGS " -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 ") | ||
add_definitions(-DHR_HI3519) | ||
elseif(${arch} STREQUAL "armhf") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 把这些没用的编译选项去掉,只写aarch64的参数就行,可以参考在Fasterrcnnmethod和smartplugin精简的cmake |
||
list(APPEND CMAKE_C_FLAGS " -marm -mfloat-abi=hard -mfpu=neon ") | ||
elseif(${arch} STREQUAL "aarch64") | ||
list(APPEND CMAKE_C_FLAGS "-march=armv8-a -mcpu=cortex-a53 ") | ||
elseif (${arch} STREQUAL "armv8l") | ||
# x2 32 soc | ||
add_definitions(-DX2) | ||
else() | ||
list(APPEND CMAKE_C_FLAGS " -marm -mfloat-abi=softfp -mfpu=neon ") | ||
endif() | ||
else() # linux on x86? | ||
list(APPEND CMAKE_C_FLAGS " -msse4.2 ") | ||
endif() | ||
elseif (${PLATFORM_ANDROID}) | ||
set(ENABLE_NEON "true") | ||
add_definitions(-DENABLE_OMP) | ||
add_definitions(-DHR_POSIX) | ||
add_definitions(-DHR_ANDROID) | ||
elseif (${PLATFORM_WIN}) | ||
set(CMAKE_CXX_FLAGS_RELEASE "/MD") | ||
set(CMAKE_CXX_FLAGS_DEBUG "/MDd") | ||
add_definitions(-DHR_WIN) | ||
add_definitions(-D_MBCS) | ||
add_definitions(-DHOBOT_EXPORTS) | ||
else () | ||
message(FATAL_ERROR "invoke cmake with -DPLATFORM_MAC=TRUE|-DPLATFORM_LINUX=TRUE|-DPLATFORM_ANDROID=TRUE|-DPLATFORM_WIN=TRUE") | ||
return() | ||
endif() | ||
message("CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}" ) | ||
|
||
option(USE_ENCRYPT "whether to use hobot aes encrypt" OFF) | ||
if (NOT ${USE_ENCRYPT}) | ||
add_definitions(-DNO_ENCRYPT) | ||
message("not use hobot aes encrypt") | ||
else () | ||
message("use hobot aes encrypt") | ||
endif() | ||
|
||
option(USE_OMP "whether to use omp" OFF) | ||
if (NOT ${USE_OMP}) | ||
add_definitions(-DNO_OMP) | ||
message("not use omp..") | ||
else () | ||
message("use omp..") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp" ) | ||
endif () | ||
|
||
option(IPC_VER "whether to use omp" OFF) | ||
if (NOT ${IPC_VER}) | ||
add_definitions(-DNOIPC_VER) | ||
message("not ipc ver..") | ||
else () | ||
message("ipc ver..") | ||
add_definitions(-DUSE_ZLOG) | ||
message("use zlog....") | ||
add_definitions(-DNO_OMP) | ||
message("not use omp....") | ||
endif () | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") | ||
message("building release") | ||
list(APPEND CMAKE_C_FLAGS " -O3") | ||
else () | ||
list(APPEND CMAKE_C_FLAGS " -Og -g ") | ||
endif() | ||
|
||
list(APPEND CMAKE_C_FLAGS " -Wall -fPIC") | ||
list(APPEND CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11") | ||
string(REGEX REPLACE ";" " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) | ||
string(REGEX REPLACE ";" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) | ||
|
||
|
||
include_directories( | ||
include | ||
include/common | ||
include/log | ||
include/timer | ||
) | ||
|
||
include_directories(SYSTEM /usr/include/python2.7) | ||
|
||
|
||
message("add src files ...") | ||
|
||
#add_library(xroc-framework STATIC ${SOURCE_FILES}) | ||
|
||
add_subdirectory(example/bbox_filter) | ||
|
||
|
||
if(NOT ${PARENT_BUILD}) | ||
set(OUTPUT_ROOT ${CMAKE_SOURCE_DIR}/output/) | ||
endif() | ||
|
||
set(MY_OUTPUT_ROOT ${OUTPUT_ROOT}/${PROJECT_NAME}) | ||
|
||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/hobotxsdk | ||
DESTINATION ${MY_OUTPUT_ROOT}/include/ | ||
FILES_MATCHING PATTERN "*.h") | ||
install(FILES | ||
${PROJECT_SOURCE_DIR}/include/hobotxroc/method.h | ||
${PROJECT_SOURCE_DIR}/include/hobotxroc/method_factory.h | ||
${PROJECT_SOURCE_DIR}/include/hobotxroc/profiler.h | ||
DESTINATION ${MY_OUTPUT_ROOT}/include/hobotxroc) | ||
|
||
#install(TARGETS ${PROJECT_NAME} | ||
# DESTINATION ${MY_OUTPUT_ROOT}/lib) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要包含gradle这一套参数了, 用最简单的cmake来改造吧, 参考FasterrcnnMethod