win7 32位系统下编译paddle

1.安装VirtualBox 和 Vagrant

安装virtualbox官网下载地址:https://www.virtualbox.org一路next就可以了

安装vagrant从官网:http://www.vagrantup.com,选择安装路径一路next就可以了

2.使用Vagrant

下载vbox 下载地址:https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box

拷贝到一个目录,我这边是D:\Vagrant\ubuntu-14.04-amd64

开启cmd,进入D:\Vagrant\ubuntu-14.04-amd64

cd /d D:\Vagrant\ubuntu-14.04-amd64

启动虚拟机

vagrant box add base ubuntu-14.04-amd64-vbox.box

vagrant init

vagrant up

我使用putty登陆,账号密码默认都是vagrant,地址就用上面提示的127.0.0.1:2222

建立共享目录 /mnt/vagrant

sudo mkdir /mnt/vagrant
sudo mount -t vboxsf vagrant /mnt/vagrant


3.编译paddle

安装编译依赖

sudo apt-get install cmake libpython-dev  libprotobuf-dev protobuf-compiler libatlas-base-dev  m4

安装python,用Anaconda ,https://www.continuum.io/downloads,下载Anaconda2-4.1.1-Linux-x86_64.sh

bash Anaconda2-4.1.1-Linux-x86_64.sh

建立tensorflow 开发环境

export PATH=~/anaconda2/bin:$PATH

conda  create -n tensorflow python=2.7

source activate tensorflow

安装protobuf

pip install protobuf

下载paddle源码

git clone https://github.com/baidu/paddle

cd paddle

mkdir build
cd build

cmake -DWITH_AVX=OFF -DWITH_DOC=OFF -DWITH_DOUBLE=OFF -DWITH_GPU=OFF -DWITH_RDMA=OFF -DWITH_STYLE_CHECK=OFF -DWITH_TESTING=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DPYTHON_INCLUDE_DIR=/home/vagrant/anaconda2/include/python2.7 -DPYTHON_INCLUDE_DIR2=/home/vagrant/anaconda2/include/python2.7 -DPYTHON_LIBRARY=/home/vagrant/anaconda2/lib/libpython2.7.so ..

make
sudo make install


4.测试paddle

paddle version

可以看到下面结果:

PaddlePaddle 0.8.0b, compiled with
    with_avx: OFF
    with_gpu: OFF
    with_double: OFF
    with_python: ON
    with_rdma: OFF
    with_glog: OFF
    with_gflags: OFF
    with_metric_learning: 
    with_timer: OFF
    with_predict_sdk: 


你可能感兴趣的:(win7 32位系统下编译paddle)