caffe能否移植到arm平台( 五 )


# below steps needs to be done twice as make tries to generate with arm binary on x86 (H5detect) # and second for H5make_libsettings make generate_fake_tools cp "$path_gen_files"/$G_GENERATE_H5MAKE_LIBSETTINGS . cp "$path_gen_files"/$G_GENERATE_H5DETECT .
make generate_fake_tools cp "$path_gen_files"/$G_GENERATE_H5MAKE_LIBSETTINGS . cp "$path_gen_files"/$G_GENERATE_H5DETECT .
# no start the real build make -j4 make install}
#build_for_platform "xilinx" "$PWD/build_xilinx" "arm-xilinx-linux-gnueabi" "$PWD/install_xilinx"#build_for_platform "sam9" "$PWD/build_sam9" "arm-none-linux-gnueabi" "$PWD/install_sam9"
七.boost移植
1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux-gcc * 下载地址: http://sourceforge.net/projects/boost/files/boost/
2.移植:
* 解压: * 新建安装目录:mkdir install * 运行安装包自带脚本:./bootstrap.sh --prefix=/home/shunzhi/software/boost/boost_1_64_0/install * 修改project-config.jam文件,具体修改如下:
10 if ! gcc in 11 {12 using gcc : arm : arm-hisiv500-linux-gcc ; #注意中间空格13 }
* 编译安装:./bjam install toolset=gcc-arm --layout=tagged --build-type=complete --prefix=/home/shunzhi/software/boost/boost_1_63_0/install
3.测试程序:
#include\u0026lt;iostream\u0026gt;#include\u0026lt;boost/lexical_cast.hpp\u0026gt;
int main() {
int a = boost::lexical_cast\u0026lt;int\u0026gt;("1008611");
std::cout \u0026lt;\u0026lt; a \u0026lt;\u0026lt;std::endl;
return 0; }
编译测试程序:arm-hisiv500-linux-g++ boost_test.cpp -L ../stage/lib/ -I ../ -o test
注意:
* option.set prefix 交叉编译器所在位置); * option.set exec-prefix 交叉编译器所在位置)/bin ; * option.set libdir 交叉编译器所在位置)/lib ; * option.set includedir 交叉编译器所在位置)/include
八.OpenBLAS移植
1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux-gcc * 下载地址: https://github.com/xianyi/OpenBLAS/releases
2.移植步骤:
修改Makefile.arm
12 ifeq ($(CORE), ARMV7) 13 ifeq ($(OSNAME), Android) 14 CCOMMON_OPT += -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch 15 FCOMMON_OPT += -marm -mfpu=neon -mfloat-abi=hard -march=armv7-a -Wl,--no-warn-mismatch 16 else 17 #CCOMMON_OPT += -marm -mfpu=vfpv3 -mfloat-abi=hard -march=armv7-a 18 #FCOMMON_OPT += -marm -mfpu=vfpv3 -mfloat-abi=hard -march=armv7-a 19 CCOMMON_OPT += -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations 20 FCOMMON_OPT += -mcpu=cortex-a17.cortex-a7 -mfloat-abi=softfp -mfpu=neon-vfpv4 -mno-unaligned-access -fno-aggressive-loop-optimizations 21 endif 22 endif


推荐阅读