- Linux安装----下载ubuntu14.04安装就可以了。
- gcc降级
sudo apt-get install -y gcc-4.7 // 下载gcc 4.7
sudo apt-get install -y g++-4.7 // 下载g++4.7
cd /use/bin
sudo rm gcc // 删除gcc
sudo ln -s gcc-4.7 gcc //链接
sudo rm g++
sudo ln -s g++-4.7 g++
sudo ldconfig
- git安装和caffe代码下载
sudo apt-get install build-essential cmake git pkg-config
sudo git clone https://github.com/BVLC/caffe.git
- cuda安装
1 CUDA Repository
获取CUDA安装包,安装包请自行去NVidia官网下载。(https://developer.nvidia.com/cuda-downloads)
$ sudo dpkg -i cuda-repo-ubuntu1504-7-5-local_7.5-18_amd64
$ sudo apt-get update
2 CUDA Toolkit
$ sudo apt-get install -y cuda
- caffe安装
General dependencies
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev BLAS sudo apt-get install libatlas-base-dev
Everything is packaged in 14.04
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
Google Logging Library(glog) 下载地址:https://code.google.com/p/google-glog/,然后解压安装:
tar zxvf glog-0.3.3.tar.gz
./configure
make
$ sudo make install
安装 cudnn
自己去官网下载cudnn,下载完了之后解压,得到一个cuda的文件夹,然后输入以下语句:
cd cuda/include
sudo cp *.h /usr/local/include/
cd ../lib64
sudo cp lib* /usr/local/lib/
cd /usr/local/lib
sudo chmod +r libcudnn.so.4.0.4
sudo ln -sf libcudnn.so.4.0.4 libcudnn.so.4
sudo ln -sf libcudnn.so.4 libcudnn.so
sudo ldconfig
- 编译
make使用
cp Makefile.config.example Makefile.config
make all
make test
make runtest
cmake使用
mkdir build
cd build
cmake ..
make all
make install
make runtest