小言_互联网的博客

ncnn交叉编译 采用 arm-himix100-linux 工具链 适用于hi3516ev200

778人阅读  评论(0)

新增arm-himix100-linux.toolchain.cmake

# set cross-compiled system type, it's better not use the type which cmake cannot recognized.

SET ( CMAKE_SYSTEM_NAME Linux )

SET ( CMAKE_SYSTEM_PROCESSOR arm )

# when hislicon SDK was installed, toolchain was installed in the path as below: 

SET ( CMAKE_C_COMPILER "/opt/hisi-linux/x86-arm/arm-himix100-linux/bin/arm-himix100-linux-gcc")

SET ( CMAKE_CXX_COMPILER "/opt/hisi-linux/x86-arm/arm-himix100-linux/bin/arm-himix100-linux-g++")

SET ( CMAKE_FIND_ROOT_PATH "/opt/hisi-linux/x86-arm/arm-himix100-linux" )

SET ( CMAKE_CXX_FLAGS "-std=c++11  -mcpu=cortex-a7 -mfloat-abi=softfp -mfpu=neon -mno-unaligned-access -fno-aggressive-loop-optimizations -fopenmp")



# set searching rules for cross-compiler

SET ( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )

SET ( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )

SET ( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )




message(${CMAKE_CXX_FLAGS})

# other settings

add_definitions(-D__ARM_NEON)

add_definitions(-D__ANDROID__)

SET ( ANDROID true)

编译

cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-himix100-linux.toolchain.cmake ..

转载:https://blog.csdn.net/luyahan/article/details/102487394
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场