Ubuntu 14.04下Caffe和TensorFlow的ARM NN SDK的aarch64编译环境搭建及MNIST程序测试
原创:转载请标明出处,违者必究!
本片文章是参考了 Configuring the Arm NN SDK build environment for TensorFlow和GarryLau的 Ubuntu 16.04环境下Configuring the Arm NN SDK build environment for Caffe的文章再根据自己实际过程中遇到问题进行了总结。在搭建环境之前最好先建一个目录用于放编译所需的环境,笔者的目录是/home/armnn/
ARM官方测试环境
• SCons. Arm has tested SCons 2.4.1, other versions might work.
• CMake. Arm has tested CMake 3.5.1, other versions might work.
• Boost. Arm have tested version 1.64.
• Protobuf. Arm has tested version 3.5.0.
• flatbuffers
• ARM NN SDK
• Compute Library
• Caffe及相关
1. SCons安装
无论安装是否安装过SCons,都可以在root用户下执行以下命令
> 1.rm /usr/local/bin/scons*
>2.rm -r /usr/local/lib/scons*
下载官方推荐版本,将安装包放入/home/armnn,解压进入/home/armnn/scons-2.4.1# 执行
>sudo python setup.py install
应该会顺利的安装结束
2.安装CMake
卸载原有系统上安装的cmake(如果不卸载系统自带的,直接安装,可能会出现错误)。
> apt-get autoremove cmake
下载CMake-3.5.1-linux-x86_64.tar.gz,或者官网下载,然后直接sh cmake-3.11.1-Linux-x86_64.sh即可;如果是下载了*tar.gz的放到/home/armnn/下解压然后执行
ln -s /home/armnn/cmake-3.5.1-Linux-x86_64/bin/* /usr/bin/
3.下载安装boost
官网下载1.64.0版本,放入/home/armnn/解压之后的文件夹为boost_1_64_0,进入该文件夹运行
sh bootstrap.sh,
运行结果如下所示:
Building Boost.Build engine with toolset gcc… tools/build/src/engine/bin.linuxx86_64/b2
Detecting Python version… 2.7
Detecting Python root… /opt/fsl-imx-wayland/4.9.51-mx8-ga/sysroots/x86_64-pokysdk-linux/usr
Unicode/ICU support for Boost.Regex?.. not found.
Generating Boost.Build configuration in project-config.jam…
Bootstrapping is done. To build, run:
./b2
To adjust configuration, edit ‘project-config.jam’.
Further information:
-Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/build/doc/html/index.html
修改修改project-config.jam文件
if ! gcc in [ feature.values ]
{
using gcc