Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add scripts to build ubuntu install package. #132

Merged
merged 1 commit into from
Sep 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion doc_cn/build_and_install/install/ubuntu_install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,41 @@ https://github.com/baidu/Paddle/releases/tag/V0.8.0b0

.. code-block:: shell

dpkg -i paddle-0.8.0b-cpu.deb
dpkg -i paddle-*-cpu.deb
apt-get install -f

在 :code:`dpkg -i` 的时候如果报一些依赖未找到的错误是正常的,
在 :code:`apt-get install -f` 里会继续安装 PaddlePaddle。

或者使用下面一条命令安装.

.. code-block:: shell

gdebi paddle-*-cpu.deb

如果 :code:`gdebi` 没有安装,则需要使用 :code:`sudo apt-get install gdebi`, 来安装 :code:`gdebi`


需要注意的是,如果使用GPU版本的PaddlePaddle,请安装CUDA 7.5 和CUDNN 5到本地环境中,
并设置好对应的环境变量(LD_LIBRARY_PATH等等)。

安装完成后,可以使用命令 :code:`paddle version` 查看安装后的paddle 版本。可能的输出为

.. code-block:: text

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


可能遇到的问题
--------------

Expand Down
1 change: 1 addition & 0 deletions paddle/scripts/deb/build_scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
5 changes: 5 additions & 0 deletions paddle/scripts/deb/build_scripts/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM paddledev/paddle:gpu-latest
MAINTAINER PaddlePaddle Dev Team <paddle-dev@baidu.com>
COPY build.sh /root/
CMD cd /root/ && bash build.sh

37 changes: 37 additions & 0 deletions paddle/scripts/deb/build_scripts/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -e
apt-get install -y dh-make
cd ~
mkdir -p ~/dist/gpu
mkdir -p ~/dist/cpu
mkdir -p ~/dist/cpu-noavx
mkdir -p ~/dist/gpu-noavx
git clone https://github.com/baidu/Paddle.git paddle
cd paddle
mkdir build
cd build
cmake .. -DWITH_GPU=OFF -DWITH_SWIG_PY=ON -DWITH_AVX=ON
make -j `nproc`
cpack -D CPACK_GENERATOR='DEB' ..
mv *.deb ~/dist/cpu

rm -rf *
cmake .. -DWITH_GPU=ON -DWITH_SWIG_PY=ON -DWITH_AVX=ON -DCUDNN_ROOT=/usr/
make -j `nproc`
cpack -D CPACK_GENERATOR='DEB' ..
mv *.deb ~/dist/gpu


rm -rf *
cmake .. -DWITH_GPU=OFF -DWITH_SWIG_PY=ON -DWITH_AVX=OFF
make -j `nproc`
cpack -D CPACK_GENERATOR='DEB' ..
mv *.deb ~/dist/cpu-noavx

rm -rf *
cmake .. -DWITH_GPU=ON -DWITH_SWIG_PY=ON -DWITH_AVX=OFF -DCUDNN_ROOT=/usr/
make -j `nproc`
cpack -D CPACK_GENERATOR='DEB' ..
mv *.deb ~/dist/gpu-noavx


8 changes: 8 additions & 0 deletions paddle/scripts/deb/build_scripts/build_deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
docker build -t build_paddle_deb .
rm -rf dist
mkdir -p dist
docker run -v$PWD/dist:/root/dist --name tmp_build_deb_container build_paddle_deb
docker rm tmp_build_deb_container
docker rmi build_paddle_deb