caffe能否移植到arm平台( 二 )
6 directories, 11 files
二.移植lmdb
1.移植环境
* Ubuntu16.04 + arm-hisiv500-linux-gcc * lmdb下载地址:https://github.com/LMDB/lmdb/releases
2.编译步骤
* 修改makefile
21 #CC = gcc 22 CC = arm-hisiv500-linux-gcc 23 #AR = ar 24 AR = arm-hisiv500-linux-ar26 THREADS = -lpthread32 prefix = /home/shunzhi/software/lmdb/libraries/liblmdb/install
* 新建安装目录:mkdir _install * 编译: make * 安装: sudo make install
3.编译结果:
shunzhi@ubuntu:~/software/lmdb/lmdb-LMDB_0.9.19/libraries/liblmdb/install$ tree.├── bin│ ├── mdb_copy│ ├── mdb_dump│ ├── mdb_load│ └── mdb_stat├── include│ └── lmdb.h├── lib│ ├── liblmdb.a│ └── liblmdb.so└── share └── man └── man1 ├── mdb_copy.1 ├── mdb_dump.1 ├── mdb_load.1 └── mdb_stat.1
6 directories, 11 files
三.移植protobuf
【caffe能否移植到arm平台】 1.编译环境:
* Ubuntu16.04 + arm-hisiv500-linux- * protobuf3.20下载地址:https://github.com/google/protobuf/tags
2.移植到3519:
1)编译步骤:
* 生成配置文件:autoconf.sh * 配置:./configure --build=i686-pc-linux --host=arm-hisiv500-linux CC=arm-hisiv500-linux-gcc CXX=arm-hisiv500-linux-g++ --with-protoc=../../protobuf/protobuf-3.2.0/src/protoc --prefix=/home/shunzhi/software/protobuf/hi_proto/protobuf-3.2.0/install * 编译:make * 检测:make check # 检测会出现错误,不用管他( If "make check" fails, you can still install, but it is likely that some features of this library will not work correctly on your system. Proceed at your own risk.) * 安装:make install
2)配置参数解释:
* --build:指明执行编译的平台为64位x86的Linux平台。 * --host :指明运行的平台。 * CC :gcc交叉编译工具。 * CXX :c++交叉编译工具。 * --prefix:安装目录。 * --with-protoc:指明protoc的查找路径,当我们在pc机上进行交叉编译时,src目录下protoc可能会无法执行,所以我们必须要编译一个protoc可执行文件,将其拷贝到src目录或者执行用这个配置参数来指明protoc的路径;上述参数就是指明protoc路径为我之前在pc编译protobuf时生成的protoc。
四.移植leveldb:
1.编译环境
* Ubuntu16.4 + arm-hisiv500-linux- * leveldb 下载地址:https://github.com/google/leveldb/releases
2.移植步骤:
* 修改build_detect_platform文件:
#添加海思编译工具CC=arm-hisiv500-linux-gccif test -z "$CC"; then CC=gccfi
CXX=arm-hisiv500-linux-g++if test -z "$CXX"; then CXX=g++fi
* 修改db/db_iter.h文件
在#endif前添加如下一行
typedef int ssize_t;如果不定义会出现如下错误:
arm-hisiv500-linux-g++ -I. -I./include -std=c++0x -fno-builtin-memcmp -lpthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -O2 -DNDEBUG -fPIC -c db/http://db_iter.cc -o out-shared/db/db_iter.odb/db_iter.cc:107:3: error: ‘ssize_t’ does not name a type ssize_t RandomPeriod() { ^db/db_iter.cc:123:3: error: ‘ssize_t’ does not name a type ssize_t bytes_counter_; ^db/db_iter.cc: In constructor ‘leveldb::{anonymous}::DBIter::DBIter(leveldb::DBImpl*, const leveldb::Comparator*, leveldb::Iterator*, leveldb::SequenceNumber, uint32_t)’:db/db_iter.cc:60:9: error: class ‘leveldb::{anonymous}::DBIter’ does not have any field named ‘bytes_counter_’ bytes_counter_(RandomPeriod()) { ^db/db_iter.cc:60:37: error: ‘RandomPeriod’ was not declared in this scope bytes_counter_(RandomPeriod()) { ^db/db_iter.cc: In member function ‘bool leveldb::{anonymous}::DBIter::ParseKey(leveldb::ParsedInternalKey*)’:db/db_iter.cc:132:3: error: ‘ssize_t’ was not declared in this scope ssize_t n = k.size() + iter_-\u0026gt;value().size(); ^db/db_iter.cc:133:3: error: ‘bytes_counter_’ was not declared in this scope bytes_counter_ -= n; ^db/db_iter.cc:133:21: error: ‘n’ was not declared in this scope bytes_counter_ -= n; ^db/db_iter.cc:135:36: error: ‘RandomPeriod’ was not declared in this scope bytes_counter_ += RandomPeriod(); ^Makefile:415: recipe for target \u0026#39;out-shared/db/db_iter.o\u0026#39; failedmake: *** Error 1
推荐阅读
- 广东今年角膜捐献量和移植手术量较往年均有增加
- 汽车知识|押宝全新造型,东风雪铁龙新C5能否成为神龙公司“救世主”
- 中国版Evan能火吗美国9岁男童录制评测玩具视频年入800万,中国能否复制成功
- 汽车市场|中期改款再战D级车市场,新雷克萨斯LS能否超过宝马7系等对手?
- 澎湃汽车圈|试驾名爵MG领航 运动性和实用性能否兼顾?
- 天天汽车|超高性价比实力宠粉,2021款奕歌能否点燃你的心?
- 能否推荐一个能用快播看电影且电影都是中英双字幕的网站
- 汽车|定位更细分SUV市场,领克06能否扩大领克的“朋友圈”?
- 汽车白话|看脸蛋、观腰身、品内饰长安欧尚X5“塑光美学”能否打动挑剔的你
- 环球车讯网|软件能否定义汽车