Linux服务器无权限安装caffe教程

Linux服务器无权限安装caffe教程

作者:贾金让

前言:服务器上没有root权限,不能使用sudo和apt-get无脑安装caffe需要的各种依赖,因此需要手动安装这些依赖库。核心就是将原来apt-get安装在/usr/include,/usr/lib等位置的库,手动安装在我们自己的路径下,即自定义路径安装依赖。
这些依赖由于版本,交叉依赖等问题,不小心的话会出现各种错误,比较经典的就是opencv和cuda9.0这种错误(下面有处理方法)。因此把我自己的安装流程记录下来,防止重复踩坑。
参考:https://github.com/yosinski/caffe/blob/jason_public/doc/linux-no-root-install-log.md
0.根目录下,终端依次执行

mkdir temp
mkdir local

用途:以后所有步骤下载的源码都放在temp文件夹中,编译得到的库、头文件和可执行程序都放在local文件夹中。
PS:下面路径中的所有your_root_path都要替换为你自己的根目录路径。

  1. 安装必备工具m4, autoconf, automake, libtool
    安装m4
 cd temp
 wget http://ftp.gnu.org/gnu/m4/m4-1.4.18.tar.gz
 tar zxvf m4-1.4.18.tar.gz
 cd m4-1.4.18
 ./configure --prefix=/your_root_path/local
 make
 make install

安装autoconf

 cd temp
 wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
 tar zxvf autoconf-2.69.tar.gz
 cd autoconf-2.69
 ./configure --prefix=/your_root_path/local
 make
 make install

安装automake

 cd temp
 wget http://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.gz
 tar zxvf automake-1.16.1.tar.gz
 cd automake-1.16.1
 ./configure --prefix=/your_root_path/local
 make
 make install

安装libtool

 cd temp
 wget http://mirror.csclub.uwaterloo.ca/gnu/libtool/libtool-2.4.6.tar.gz
 cd libtool-2.4.6
 tar zxvf libtool-2.4.6.tar.gz
 ./configure --prefix=/your_root_path/local
 make
 make install

将它们的可执行程序路径写入环境变量中:

vim ~/.bashrc

点击i进入输入模式
将下列代码复制粘贴到文件最后:

export PATH="/your_root_path/local/bin:$PATH"
export LIBRARY_PATH="/your_root_path/local/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="/your_root_path/local/lib:$LD_LIBRARY_PATH"

点ESC退出输入模式,输入:wq进行保存并退出。
命令行输入source ~/.bashrc激活环境变量。
可分别使用下面的命令进行版本查询并验证是否安装成功:

m4 --version
autoconf --version
automake --version
libtool --version

PS:本部分参考https://blog.csdn.net/qq_30549833/article/details/72955881

2.安装boost库
源码下载地址:https://www.boost.org/users/history/version_1_67_0.html
或使用wget下载。

cd temp
wget https://dl.bintray.com/boostorg/release/1.67.0/source/bo
  • 9
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 7
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值