环境:ubuntu 14.04, cuda 6.5
先安装cuda-toolkit, cuda-cublas, cudart, cuda-curand这四个安装包
cuda_6.5.14_linux_64.run
cuda-cublas-6-5_6.5-14_amd64.deb
cuda-cudart-6-5_6.5-14_amd64.deb
cuda-curand-6-5_6.5-14_amd64.deb
下载路径:http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/
安装 OpenCV
sudo apt-get install libopencv-2.4
配置环境变量
vi ~/.bashrc
export CUDA_HOME=/usr/local/cuda-6.5
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:/usr/local/lib:$LD_LIBRARY_PATH
export CPLUS_INCLUDE_PATH=/usr/local/cuda/include
下载一份cxxnet
git clone https://github.com/dmlc/cxxnet.git
切换至目录 cd cxxnet
拷贝一份配置到当前目录 cp make/config.mk .
修改 vi config.mk
USE_CUDA = 1
USE_BLAS = blas
USE_DIST_PS = 1
USE_OPENMP_ITER = 1
编辑 vi Makefile, 修改如下:
CFLAGS += -g -O3 -I./mshadow/ -fPIC $(MSHADOW_CFLAGS) -fopenmp -I/usr/local/cuda/include
LDFLAGS = -pthread $(MSHADOW_LDFLAGS) -L/usr/local/cuda/lib64
最后编译文件
./build.sh
评论已关闭。