CentOs7下,Caffe环境安装问题解决
2017-04-06 18:26
316 查看
准备在CentOS 7 下重新安装Caffe,centos7很不错,基本上官方文档里的:
可以顺利执行完成,接着根据文档:
BLAS:
install ATLAS by
install OpenBLAS or MKL for better CPU performance. For the Makefile build, uncomment and set
as ATLAS is usually installed under
安装atlas-devel。
开始编译~
make all
报错:
[root@**** caffe]# make all
CXX/LD -o .build_release/tools/convert_imageset.bin
/bin/ld: cannot find -lcblas
/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
查了一下,是程序在我们配置的lib目录里找不到atlas的so文件,比对了一下ld命令的查找方式和我们已安装的atlas:
ld -latlas --verbose
显示查找路径如下:
==================================================
attempt to open /usr/x86_64-redhat-linux/lib64/libatlas.so failed
attempt to open /usr/x86_64-redhat-linux/lib64/libatlas.a failed
attempt to open /usr/lib64/libatlas.so failed
attempt to open /usr/lib64/libatlas.a failed
attempt to open /usr/local/lib64/libatlas.so failed
attempt to open /usr/local/lib64/libatlas.a failed
attempt to open /lib64/libatlas.so failed
attempt to open /lib64/libatlas.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libatlas.so failed
attempt to open /usr/x86_64-redhat-linux/lib/libatlas.a failed
attempt to open /usr/local/lib/libatlas.so failed
attempt to open /usr/local/lib/libatlas.a failed
attempt to open /lib/libatlas.so failed
attempt to open /lib/libatlas.a failed
attempt to open /usr/lib/libatlas.so failed
attempt to open /usr/lib/libatlas.a failed
ld: cannot find -latlas
我看了一下我们安装的atlas,在/usr/lib64/atlas/下,内有这些so:
[root@*** caffe]# ll /usr/lib64/atlas
total 21304
lrwxrwxrwx 1 root root 17 Apr 6 04:38 libsatlas.so -> libsatlas.so.3.10
lrwxrwxrwx 1 root root 17 Mar 14 22:24 libsatlas.so.3 -> libsatlas.so.3.10
-rwxr-xr-x 1 root root 10852104 Nov 20 2015 libsatlas.so.3.10
lrwxrwxrwx 1 root root 17 Apr 6 04:38 libtatlas.so -> libtatlas.so.3.10
lrwxrwxrwx 1 root root 17 Mar 14 22:24 libtatlas.so.3 -> libtatlas.so.3.10
-rwxr-xr-x 1 root root 10959464 Nov 20 2015 libtatlas.so.3.10
我们安装的atlas的so库只有libsatlas和libtatlas两种,与caffe要的完全不匹配。
查了一些材料(https://www.centos.org/forums/viewtopic.php?t=48543),这个提问里有提到这个现象,在centOS7下,库名已改,引入方式也要改变:
Names and content of atlas libraries have changed recently. Try
-L/usr/lib64/atlas -lsatlas or -L/usr/lib64/atlas -ltatlas
instead of
-lcblas.
但我并不想去修改caffe源码,担心引起连锁问题,且报错中并没有提示具体发生问题的文件。
解决方案
改用openblas:
yum install openblas-devel
MakeFile.config配置如下:
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
#BLAS_INCLUDE := /usr/include/atlas
#BLAS_LIB := /usr/lib64/atlas
后续一切成功。 done。
建议Caffe对CentOS 7 下atlas引用失败的问题做修复。有空提个issue。
sudo yum install protobuf-devel leveldb-devel snappy-devel opencv-devel boost-devel hdf5-devel
sudo yum install gflags-devel glog-devel lmdb-devel
可以顺利执行完成,接着根据文档:
BLAS:
install ATLAS by
sudo yum install atlas-develor
install OpenBLAS or MKL for better CPU performance. For the Makefile build, uncomment and set
BLAS_LIBaccordingly
as ATLAS is usually installed under
/usr/lib[64]/atlas).
安装atlas-devel。
开始编译~
make all
报错:
[root@**** caffe]# make all
CXX/LD -o .build_release/tools/convert_imageset.bin
/bin/ld: cannot find -lcblas
/bin/ld: cannot find -latlas
collect2: error: ld returned 1 exit status
查了一下,是程序在我们配置的lib目录里找不到atlas的so文件,比对了一下ld命令的查找方式和我们已安装的atlas:
ld -latlas --verbose
显示查找路径如下:
==================================================
attempt to open /usr/x86_64-redhat-linux/lib64/libatlas.so failed
attempt to open /usr/x86_64-redhat-linux/lib64/libatlas.a failed
attempt to open /usr/lib64/libatlas.so failed
attempt to open /usr/lib64/libatlas.a failed
attempt to open /usr/local/lib64/libatlas.so failed
attempt to open /usr/local/lib64/libatlas.a failed
attempt to open /lib64/libatlas.so failed
attempt to open /lib64/libatlas.a failed
attempt to open /usr/x86_64-redhat-linux/lib/libatlas.so failed
attempt to open /usr/x86_64-redhat-linux/lib/libatlas.a failed
attempt to open /usr/local/lib/libatlas.so failed
attempt to open /usr/local/lib/libatlas.a failed
attempt to open /lib/libatlas.so failed
attempt to open /lib/libatlas.a failed
attempt to open /usr/lib/libatlas.so failed
attempt to open /usr/lib/libatlas.a failed
ld: cannot find -latlas
我看了一下我们安装的atlas,在/usr/lib64/atlas/下,内有这些so:
[root@*** caffe]# ll /usr/lib64/atlas
total 21304
lrwxrwxrwx 1 root root 17 Apr 6 04:38 libsatlas.so -> libsatlas.so.3.10
lrwxrwxrwx 1 root root 17 Mar 14 22:24 libsatlas.so.3 -> libsatlas.so.3.10
-rwxr-xr-x 1 root root 10852104 Nov 20 2015 libsatlas.so.3.10
lrwxrwxrwx 1 root root 17 Apr 6 04:38 libtatlas.so -> libtatlas.so.3.10
lrwxrwxrwx 1 root root 17 Mar 14 22:24 libtatlas.so.3 -> libtatlas.so.3.10
-rwxr-xr-x 1 root root 10959464 Nov 20 2015 libtatlas.so.3.10
我们安装的atlas的so库只有libsatlas和libtatlas两种,与caffe要的完全不匹配。
查了一些材料(https://www.centos.org/forums/viewtopic.php?t=48543),这个提问里有提到这个现象,在centOS7下,库名已改,引入方式也要改变:
Names and content of atlas libraries have changed recently. Try
-L/usr/lib64/atlas -lsatlas or -L/usr/lib64/atlas -ltatlas
instead of
-lcblas.
但我并不想去修改caffe源码,担心引起连锁问题,且报错中并没有提示具体发生问题的文件。
解决方案
改用openblas:
yum install openblas-devel
MakeFile.config配置如下:
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
#BLAS_INCLUDE := /usr/include/atlas
#BLAS_LIB := /usr/lib64/atlas
后续一切成功。 done。
建议Caffe对CentOS 7 下atlas引用失败的问题做修复。有空提个issue。
相关文章推荐
- 在CENTOS环境安装ASTERISK+FREEPBX常见问题以及解决办法
- 在CENTOS环境安装ASTERISK+FREEPBX常见问题以及解决办法
- CentOS7下安装NVIDIA独立显卡驱动出现X service error问题解决方法
- 【Caffe】手动安装CUDA, cuDNN, opencv 3, boost, glog, gflags, protobuf, nccl指南,以及各种问题的解决方法(CentOS 6.9)
- CentOS 7 U盘安装及常用WEB环境安装过程问题解决
- CENTOS6.5环境下POSTGRESQL的安装与配置总结以及远程连接问题的解决
- CentOS7下通过rpm方式安装MySQL及插入中文问题解决 [原创]
- CentOS6.5环境安装VMware虚拟机----解决启动虚拟机时could not open /dev/vmmon: No such file or directory的问题
- 解决CentOS7下 ifconfig默认不安装的问题
- kafka+zookeeper集群安装与配置(CENTOS7环境)及开发中遇到的问题解决
- CentOS6.5上python-mysql环境的安装问题解决
- CentOS 7下 RabbitMQ 安装以及问题解决
- [阿里云] Linux CentOS 7.4 环境下安装 MySql5.7 完整流程以及常见问题的解决方法
- 解决redis在centos自带ruby版本太低问题centos 6.5 ruby环境安装2.2+
- CentOS 6.5安装caffe注意事项 应该可以解决大部分报错问题
- 【环境】Caffe安装 'unique_path' is not a member of 'boost::filesystem' 问题解决
- [置顶]CentOS7下通过rpm方式安装MySQL及插入中文问题解决 [原创]
- Linux第一天接触, 安装CentOS后解决中文字体的问题
- apach2.2+php5.35 windows环境下安装问题解决
- 解决安装CentOS 5.7中文版报错问题