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

由于某种原因对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

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

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

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

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

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

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

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


一:./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,然后

xavier NX编译caffe错误记录(二)_第1张图片

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

   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

xavier NX编译caffe错误记录(二)_第2张图片xavier NX编译caffe错误记录(二)_第3张图片

自己从下载最新的caffe源码编译了一下,发现还是报错,于是放弃刷机自带的cudnn8,从xavier板子上拷贝cuda10和cudnn7,但是一共要拷贝哪几个库和头文件呢,还有拷贝过来之后刷机自带的cuda10.2和cudnn8如果不删除会不会冲突。

 

 

你可能感兴趣的:(Caffe,NVIDIA,Jetson,Xavier/NX)