xavier NX编译caffe错误记录(二)

原博客搬移到:https://blog.csdn.net/u013171226/article/details/107813202

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

由于某种原因对xavier NX重新刷机了,然后重新编译caffe,再次重新记录下编译caffe过程中遇到的错误,解决错误的过程中很多都是用到了apt-get安装一些依赖库,因此最好先更改xavier NX的源头,更该方法如下:

https://blog.csdn.net/u013171226/article/details/107680339

一:./include/caffe/common.hpp:4:10: fatal error: boost/shared_ptr.hpp: No such file or directory

sudo apt-get install libboost-all-dev  #报错 libboost-all-dev : Depends: libboost-mpi-dev but it is not going to be installed    Depends: libboost-mpi-python-dev but it is not going to be installed
sudo apt-get install libboost-mpi-dev  #报错libboost-mpi-dev : Depends: libboost-mpi1.58-dev but it is not going to be installed
apt-get install libboost-mpi1.58-dev  #报错libboost-mpi1.58-dev : Depends: mpi-default-dev but it is not going to be installed
apt-get install mpi-default-dev  #报错mpi-default-dev : Depends: libopenmpi-dev but it is not going to be installed
apt-get install libopenmpi-dev  #报错libopenmpi-dev : Depends: libibverbs-dev (>= 1.1.7) but it is not going to be installed  Depends: libhwloc-dev but it is not going to be installed
apt-get install libibverbs-dev  #报错libibverbs-dev : Depends: libibverbs1 (= 1.1.8-1.1ubuntu2) but 17.1-1ubuntu0.2 is to be installed

于是先卸载掉,然后重装,重装之后就是1.1.8版本了,命令如下

apt-get remove --purge libibverbs1
apt-get install libibverbs1

然后倒序把依赖全部安装上,终端输入history命令可以看到之前的命令,然后依次倒序安装即可。

   37  sudo apt-get install libboost-all-dev
   38  apt-get install libboost-mpi-dev
   39  apt-get install libboost-mpi1.58-dev
   40  apt-get install mpi-default-dev
   41  apt-get install libopenmpi-dev
   42  apt-get install libibverbs-dev
   43  apt-get remove --purge libibverbs1
   44  apt-get install libibverbs1
   45  history

在依次逆序安装的时候还是会提示某个库依赖另一个的库的情况,就按照上面的方法进行安装就好了,遇到需要的版本不一致的就先卸载再重装,不再重复了。

二:./include/caffe/common.hpp:5:10: fatal error: gflags/gflags.h: No such file or directory

sudo apt-get install libgflags-dev

三:./include/caffe/common.hpp:6:10: fatal error: glog/logging.h: No such file or directory

sudo apt-get install libgoogle-glog-dev

四:./include/caffe/proto/caffe.pb.h:9:10: fatal error: google/protobuf/stubs/common.h: No such file or directory

sudo apt-get install libprotobuf-dev protobuf-compiler

五:./include/caffe/util/mkl_alternate.hpp:14:10: fatal error: cblas.h: No such file or directory

sudo apt-get install libatlas-base-dev  #报错libatlas-base-dev : Depends: libatlas3-base (= 3.10.2-9) but it is not going to be installed   Depends: libatlas-dev but it is not going to be installed
sudo apt-get install libatlas3-base

然后发现了一个问题,安装到这里之后发现刷机自带的oppencv4不见了,最开始还是能搜到刷机自带的opencv4的,大约是第四第五步的之后才消失的。

六:./include/caffe/util/bbox_util.hpp:2:10: fatal error: opencv2/core/core.hpp: No such file or directory

apt-get install libopencv-dev  #libopencv-dev : Depends: libopencv (= 4.1.1-2-gd5a58aa75) but it is not going to be installed
apt-get install libopencv  #libopencv : Depends: libavcodec57 (>= 7:3.4.6) but it is not installable or  libavcodec-extra57 (>= 7:3.4.6) but it is not installable  Depends: libavformat57 (>= 7:3.4.6) but it is not installable
apt-get install libavcodec57  #E: Package 'libavcodec57' has no installation candidate

于是去https://pkgs.org/ 网站下载libavcodec57_3.4.8-0ubuntu0.2_arm64.deb,然后

于是在该网站继续下载这三个安装包,然后

   31  sudo dpkg -i libavutil55_3.4.8-0ubuntu0.2_arm64.deb 
   32  sudo dpkg -i libswresample2_3.4.8-0ubuntu0.2_arm64.deb 
   33  sudo dpkg -i libx265-146_2.6-3_arm64.deb 
   34  sudo dpkg -i libavcodec57_3.4.8-0ubuntu0.2_arm64.deb 

同样去网站下载下面的两个安装包进行安装

   39  sudo dpkg -i libchromaprint1_1.4.3-1_arm64.deb 
   40  sudo dpkg -i libavformat57_3.4.8-0ubuntu0.2_arm64.deb 

然后安装opencv

  122  apt-get install libopencv
  123  apt-get install libopencv-dev

七:./include/caffe/proto/caffe.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is

感觉这个环境越来越奇怪了。

这个问题在https://blog.csdn.net/u013171226/article/details/107680343里面有了,

八:error: ‘

CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT’ was not declared in this scope

 

自己从下载最新的caffe源码编译了一下,发现还是报错,于是放弃刷机自带的cudnn8,从xavier板子上拷贝cuda10和cudnn7,需要拷贝的文件为:

cuda

从xavier上把/usr/local/cuda-10.0拷贝到NX的/usr/local/cuda-10.0    

cudnn:

/usr/lib/aarch64-linux-gnu/libcudnn.so.7.5.0---->/usr/lib/aarch64-linux-gnu/libcudnn.so.7----->/etc/alternatives/libcudnn_so*----->/usr/lib/aarch64-linux-gnu/libcudnn.so:直接把/usr/lib/aarch64-linux-gnu/libcudnn.so.7.5.0拷贝过来然后重命名为/usr/lib/aarch64-linux-gnu/libcudnn.so

/usr/include/cudnn.h---->/etc/alternatives/libcudnn---->/usr/include/aarch64-linux-gnu/cudnn_v8.h:直接把 /usr/include/cudnn.h删掉,然后吧xavier的/usr/include/aarch64-linux-gnu/cudnn_v7.h拷贝过来,然后重命名位cudnn.7

posted @ 2020-08-23 14:52  cumtchw  阅读(1287)  评论(0编辑  收藏  举报