OS:Ubuntu14.04
GPU: GTX 660
sudo apt-get install git
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
source ~/.bashrc
sudo apt-get update
sudo apt-get install cuda
luarocks install torch
luarocks install cutorch
luarocks install cunn
sudo cp cuda/lib64/libcudnn* /usr/local/cuda-8.0/lib64/
sudo cp cuda/include/cudnn.h /usr/local/cuda-8.0/include/
luarocks install cudnn
會出現連結的問題,下一步解決
6. 執行
vim ~/.bashrc
在最後一行添加
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBARARY_PATH
執行
source ~/.bashrc
選擇一個自訂資料夾並安裝以下套件
git clone https://github.com/facebook/folly
git clone https://github.com/facebook/fbthrift
git clone https://github.com/facebook/thpp
git clone https://github.com/facebook/fblualib
cd $dir/folly/folly
autoreconf -ivf
./configure --prefix=/自訂資料夾名稱
make
make install
添加環境變數PATH(添加your-path/bin)以及LD_LIBRARY_PATH(添加your-path/lib)
增加到.bashrc中
cd $dir/fbthrift/thrift
autoreconf -ivf
./configure --prefix=/your-path --with-folly=/your-path
需要指定folly的安装目錄
make
make install
cd $dir/thpp/thpp
打開 build sh檔, 下载gtest.zip
mkdir build
安装thpp需要安装好Folly, Torch, Thrift,需要修改cmake的配置信息来告诉系统這三個套件在什麼地方,修改方法如下:
cd cmake,修改Findxx.cmake的路徑
FindFolly.cmake
SET(FOLLY_LIBRARY "/your-path/lib")
SET(FOLLY_INCLUDE_DIR "/your-path/include")
Warnning: 在這一步驟編譯失敗,原因為四個套件版本各自有改動導致約少一些套件,目前沒有找到解法
按照以下連結安裝(有腳本)
https://github.com/facebookarchive/fbcunn/blob/master/INSTALL.md
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get install g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5
sudo add-apt-repository ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get upgrade