arm ncnn
ncnn网址:https://github.com/Tencent/ncnn
1、
sudo apt-get update
sudo apt-get upgrade
2、
命令:sudo apt-get install g++-4.8-arm-linux-gnueabihf
sudo apt-get install gcc-4.8-arm-linux-gnueabihf
测试:
$arm-linux-gnueabihf-g++-4.8 --version
arm-linux-gnueabihf-g++-4.8 (Ubuntu/Linaro 4.8.5-4ubuntu1) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
sudo ln -s /usr/bin/arm-linux-gnueabihf-g++-4.8 /usr/bin/arm-linux-gnueabihf-g++
sudo ln -s /usr/bin/arm-linux-gnueabihf-gcc-4.8 /usr/bin/arm-linux-gnueabihf-gcc
arm linux 64位交叉编译器
网址:https://releases.linaro.org/components/toolchain/binaries/6.3-2017.05/aarch64-linux-gnu/
下载:gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu.tar.xz
vi ~/.bashrc
export PATH=/home/Your Name/armlinux/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin:$PATH
source ~/.bashrc
测试:
aarch64-linux-gnu-g++ --version
输出:
aarch64-linux-gnu-g++ (Linaro GCC 6.3-2017.05) 6.3.1 20170404
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3、在ncnn目录下的CMakeLists.txt,在cmake_minimum_required(VERSION 2.8.10)下面添加
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
add_definitions(-D__ARM_NEON)
add_definitions("-mfpu=neon")
4、 src
文件夹下,修改该文件夹下的CMakeLists.txt文件。删除如下图所示代码:
CMakeLists.txt为
############################################## configure_file(platform.h.in ${CMAKE_CURRENT_BINARY_DIR}/platform.h) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/layer) set(ncnn_SRCS
allocator.cpp
blob.cpp
cpu.cpp
layer.cpp
mat.cpp
mat_pixel.cpp
modelbin.cpp
net.cpp
opencv.cpp
paramdict.cpp
benchmark.cpp
) macro(ncnn_add_layer class)
string(TOLOWER ${class} name) # WITH_LAYER_xxx option
if(${ARGC} EQUAL )
option(WITH_LAYER_${name} "build with layer ${name}" ${ARGV1})
else()
option(WITH_LAYER_${name} "build with layer ${name}" ON)
endif() message("WITH_LAYER_${name} = ${WITH_LAYER_${name}}") if(WITH_LAYER_${name})
list(APPEND ncnn_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/layer/${name}.cpp") # look for arch specific implementation and append source
# optimized implementation for armv7 aarch64
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/layer/arm/${name}_arm.cpp")
list(APPEND ncnn_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/layer/arm/${name}_arm.cpp")
set(WITH_LAYER_${name}_arm )
endif() endif() # generate layer_declaration and layer_registry file
if(WITH_LAYER_${name})
if(WITH_LAYER_${name}_arm)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_declaration.h
"extern Layer* ${class}_arm_layer_creator();\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_registry.h
"#if NCNN_STRING\n{\"${class}\",${class}_arm_layer_creator},\n#else\n{${class}_arm_layer_creator},\n#endif\n")
elseif(WITH_LAYER_${name}_x86)
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_declaration.h
"extern Layer* ${class}_x86_layer_creator();\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_registry.h
"#if NCNN_STRING\n{\"${class}\",${class}_x86_layer_creator},\n#else\n{${class}_x86_layer_creator},\n#endif\n")
else()
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_declaration.h
"extern Layer* ${class}_layer_creator();\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_registry.h
"#if NCNN_STRING\n{\"${class}\",${class}_layer_creator},\n#else\n{${class}_layer_creator},\n#endif\n")
endif()
else()
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_registry.h "#if NCNN_STRING\n{\"${class}\",0},\n#else\n{0},\n#endif\n")
endif() # generate layer_type_enum file
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/layer_type_enum.h "${class} = ${__LAYER_TYPE_ENUM_INDEX},\n")
math(EXPR __LAYER_TYPE_ENUM_INDEX "${__LAYER_TYPE_ENUM_INDEX}+1")
endmacro() # create new
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/layer_declaration.h)
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/layer_registry.h)
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/layer_type_enum.h)
set(__LAYER_TYPE_ENUM_INDEX ) # layer implementation
ncnn_add_layer(AbsVal)
ncnn_add_layer(ArgMax OFF)
ncnn_add_layer(BatchNorm)
ncnn_add_layer(Bias)
ncnn_add_layer(BNLL)
ncnn_add_layer(Concat)
ncnn_add_layer(Convolution)
ncnn_add_layer(Crop)
ncnn_add_layer(Deconvolution)
ncnn_add_layer(Dropout)
ncnn_add_layer(Eltwise)
ncnn_add_layer(ELU)
ncnn_add_layer(Embed)
ncnn_add_layer(Exp)
ncnn_add_layer(Flatten)
ncnn_add_layer(InnerProduct)
ncnn_add_layer(Input)
ncnn_add_layer(Log)
ncnn_add_layer(LRN)
ncnn_add_layer(MemoryData)
ncnn_add_layer(MVN)
ncnn_add_layer(Pooling)
ncnn_add_layer(Power)
ncnn_add_layer(PReLU)
ncnn_add_layer(Proposal)
ncnn_add_layer(Reduction)
ncnn_add_layer(ReLU)
ncnn_add_layer(Reshape)
ncnn_add_layer(ROIPooling)
ncnn_add_layer(Scale)
ncnn_add_layer(Sigmoid)
ncnn_add_layer(Slice)
ncnn_add_layer(Softmax)
ncnn_add_layer(Split)
ncnn_add_layer(SPP OFF)
ncnn_add_layer(TanH)
ncnn_add_layer(Threshold)
ncnn_add_layer(Tile OFF)
ncnn_add_layer(RNN OFF)
ncnn_add_layer(LSTM OFF)
ncnn_add_layer(BinaryOp)
ncnn_add_layer(UnaryOp)
ncnn_add_layer(ConvolutionDepthWise)
ncnn_add_layer(Padding)
ncnn_add_layer(Squeeze)
ncnn_add_layer(ExpandDims)
ncnn_add_layer(Normalize)
ncnn_add_layer(Permute)
ncnn_add_layer(PriorBox)
ncnn_add_layer(DetectionOutput)
ncnn_add_layer(Interp)
ncnn_add_layer(DeconvolutionDepthWise)
ncnn_add_layer(ShuffleChannel)
ncnn_add_layer(InstanceNorm)
ncnn_add_layer(Clip)
ncnn_add_layer(Reorg)
ncnn_add_layer(YoloDetectionOutput)
ncnn_add_layer(Quantize)
ncnn_add_layer(Dequantize)
ncnn_add_layer(Yolov3DetectionOutput) add_library(ncnn STATIC ${ncnn_SRCS}) if(COVERAGE)
target_compile_options(ncnn PRIVATE --coverage)
endif() install(TARGETS ncnn ARCHIVE DESTINATION lib)
install(FILES
allocator.h
blob.h
cpu.h
layer.h
layer_type.h
mat.h
modelbin.h
net.h
opencv.h
paramdict.h
benchmark.h
${CMAKE_CURRENT_BINARY_DIR}/layer_type_enum.h
${CMAKE_CURRENT_BINARY_DIR}/platform.h
DESTINATION include
)
编译
git clone https://github.com/Tencent/ncnn
cd ncnn
mkdir build
cd build
cmake ..
make -j
make install
检查:
readelf libncnn.a –a
最后出现
Tag_Advanced_SIMD_arch: NEONv1 编译正确
arm ncnn的更多相关文章
- iOS逆向工程之Hopper中的ARM指令
虽然前段时间ARM被日本软银收购了,但是科技是无国界的,所以呢ARM相关知识该学的学.现在看ARM指令集还是倍感亲切的,毕竟大学里开了ARM这门课,并且做了不少的实验,当时自我感觉ARM这门课学的还是 ...
- ARM的栈指令
ARM的指令系统中关于栈指令的内容比较容易引起迷惑,这是因为准确描述一个栈的特点需要两个参数: 栈地址的增长方向:ARM将向高地址增长的栈称为递增栈(Descendent Stack),将向低地址增长 ...
- ARM CPU大小端
ARM CPU大小端: 大端模式:低位字节存在高地址上,高位字节存在低地址上 小端模式:高位字节存在高地址上,低位字节存在低地址上 STM32属于小端模式,简单的说,比如u32 temp=0X1234 ...
- 基于ARM处理器的反汇编器软件简单设计及实现
写在前面 2012年写的毕业设计,仅供参考 反汇编的目的 缺乏某些必要的说明资料的情况下, 想获得某些软件系统的源代码.设计思想及理念, 以便复制, 改造.移植和发展: 从源码上对软件的可靠性和安全性 ...
- EZchip将推全球首款100核64位ARM A-53芯片
EZchip将推全球首款100核64位ARM A-53芯片 2015-02-25 16:32:03 来源:互联网 关键字: 将推 全球 64位 arm EZchip日前表示,将准备开发 ...
- Jetson ARM SeetaFace编译
SeetaFace简介 SeetaFace依赖于OpenCV,对于Tegra on Ubuntu,Nvidia提供libopencv4tegra并且可以使用Cuda加速. 准备工作 1.阅读OpenC ...
- 如何在ARM中创建Express Route
很早之前就想试试Azure的express route,但是一直没有找到合适的机会,正好有个客户需要上express route,所以最近先自己研究研究,防止在做poc的时候耗费更多时间,本次场景我们 ...
- 如何将已部署在ASM的资源迁移到ARM中
使用过Azure的读者都知道,Azure向客户提供了两个管理portal,一个是ASM,一个是ARM,虽然Azure官方没有宣布说淘汰ASM,两个portal可能会在很长的一段时间共存,但是考虑到AR ...
- arm汇编指令
ARM处理器的指令集可以分为跳转指令.数据处理指令.程序状态寄存器(PSR)处理指令.加载/存储指令.协处理器指令和异常产生指令6大指令 一.跳转指令 跳转指令用于实现程序流程的跳转 跳转指令分类 Ⅰ ...
随机推荐
- sonarqube中new issue的标准
https://docs.sonarqube.org/latest/user-guide/issues/#header-4 Understanding which Issues are "N ...
- Why there is two completely different version of Reverse for List and IEnumerable?
https://stackoverflow.com/questions/12390971/why-there-is-two-completely-different-version-of-revers ...
- [转] Java 基础
1. 面向对象和面向过程的区别 面向过程 面向对象 2. Java 语言有哪些特点 3. 关于 JVM JDK 和 JRE 最详细通俗的解答 JVM JDK 和 JRE 4. Oracle JDK 和 ...
- C++中的string常用函数用法
标准c++中string类函数介绍 注意不是CString 之所以抛弃char*的字符串而选用C++标准程序库中的string类,是因为他和前者比较起来,不必 担心内存是否足够.字符串长度等等,而 ...
- PredNet --- Deep Predictive coding networks for video prediction and unsupervised learning --- 论文笔记
PredNet --- Deep Predictive coding networks for video prediction and unsupervised learning ICLR 20 ...
- 【译】第13节---数据注解-Required
原文:http://www.entityframeworktutorial.net/code-first/required-attribute-dataannotations-in-code-firs ...
- SqlParameter 多个参数动态拼接解决参数化问题
多个参数化是固定比较easy,多个动态的就有点...工作中遇到的问题整理下来分享 ,上代码 SqlParameter[] param = new SqlParameter[] { }; List< ...
- 【Selenium2】【问题】
[iframe 和 HTML 相互嵌套] 比如126登录页,我的几个方法都不好用 1. iframeFather = driver.find_element(By.XPATH,"//div[ ...
- _event
EventId 事件ID 请使用大于100的ID EventName 事件的名称,用于游戏中各种提示 NoticeText 事件开始时的弹窗内容 GossipText 功能宝石等菜单内容 Z ...
- _itemmod_add
命令._add items XXX 为目标添加一组物品 `comment` 备注 `categoryId` 组ID `entry` 物品entry `count`数量