Skip to content

Commit 0c0ff28

Browse files
authored
Refine install docs (#5943)
* refine install docs * do not remove files * follow comments * update
1 parent 21053c1 commit 0c0ff28

File tree

8 files changed

+72
-14
lines changed

8 files changed

+72
-14
lines changed

doc/getstarted/build_and_install/build_from_source_cn.rst

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
从源码编译PaddlePaddle
1+
从源码编译
22
======================
33

44
.. _build_step:
@@ -7,8 +7,11 @@
77
----------------
88

99
PaddlePaddle主要使用 `CMake <https://cmake.org>`_ 以及GCC, G++作为编译工具。
10-
我们推荐您使用PaddlePaddle编译环境镜像完成编译,这样可以免去单独安装编译依赖的步骤,可选的不同编译环境
10+
我们推荐您使用PaddlePaddle Docker编译环境镜像完成编译,这样可以免去单独安装编译依赖的步骤,可选的不同编译环境Docker镜像
1111
可以在 `这里 <https://hub.docker.com/r/paddlepaddle/paddle_manylinux_devel/tags/>`_ 找到。
12+
13+
如果您选择不使用Docker镜像,则需要在本机安装下面章节列出的 `编译依赖`_ 之后才能开始编译的步骤。
14+
1215
编译PaddlePaddle,需要执行:
1316

1417
.. code-block:: bash
@@ -22,7 +25,6 @@ PaddlePaddle主要使用 `CMake <https://cmake.org>`_ 以及GCC, G++作为编译
2225
cd build
2326
cmake -DWITH_GPU=OFF -DWITH_TESTING=OFF ..
2427
make
25-
2628
2729
编译完成后会在build/python/dist目录下生成输出的whl包,可以选在在当前机器安装也可以拷贝到目标机器安装:
2830

@@ -31,7 +33,33 @@ PaddlePaddle主要使用 `CMake <https://cmake.org>`_ 以及GCC, G++作为编译
3133
pip install python/dist/*.whl
3234
3335
34-
.. _build_step:
36+
.. _run_test:
37+
38+
执行单元测试
39+
----------------
40+
41+
如果您期望在编译完成后立即执行所有的单元测试,可以按照下面的方法:
42+
43+
使用Docker的情况下,设置 :code:`RUN_TEST=ON` 和 :code:`WITH_TESTING=ON` 就会在完成编译之后,立即执行单元测试。
44+
开启 :code:`WITH_GPU=ON` 可以指定同时执行GPU上的单元测试。
45+
46+
.. code-block:: bash
47+
48+
docker run -it -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=ON" -e "RUN_TEST=ON" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 bash -x paddle/scripts/docker/build.sh
49+
50+
如果不使用Docker,可以执行ctest命令即可:
51+
52+
.. code-block:: bash
53+
54+
mkdir build
55+
cd build
56+
cmake -DWITH_GPU=OFF -DWITH_TESTING=OFF ..
57+
make
58+
ctest
59+
# 指定执行其中一个单元测试 test_mul_op
60+
ctest -R test_mul_op
61+
62+
.. _compile_deps:
3563

3664
编译依赖
3765
----------------

doc/getstarted/build_and_install/build_from_source_en.rst

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Build PaddlePaddle from Sources
1+
Build from Sources
22
==========================
33

44
.. _build_step:
@@ -9,14 +9,18 @@ How To Build
99
PaddlePaddle mainly uses `CMake <https://cmake.org>`_ and GCC, G++ as compile
1010
tools. We recommend you to use our pre-built Docker image to run the build
1111
to avoid installing dependencies by yourself. We have several build environment
12-
Docker images `here <https://hub.docker.com/r/paddlepaddle/paddle_manylinux_devel/tags/>`_.
12+
Docker images `here <https://hub.docker.com/r/paddlepaddle/paddle_manylinux_devel/tags/>`_ .
13+
14+
If you choose not to use Docker image for your build, you need to install the
15+
below `Compile Dependencies`_ before run the build.
16+
1317
Then run:
1418

1519
.. code-block:: bash
1620
1721
git clone https://github.com/PaddlePaddle/Paddle.git
1822
cd Paddle
19-
# run the following command to build CPU-Only binaries if you are using docker
23+
# run the following command to build a CPU-Only binaries if you are using docker
2024
docker run -it -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 bash -x paddle/scripts/docker/build.sh
2125
# else run these commands
2226
mkdir build
@@ -32,7 +36,35 @@ machine or copy it to the target machine.
3236
3337
pip install python/dist/*.whl
3438
35-
.. _build_step:
39+
40+
.. _run_test:
41+
42+
Run Tests
43+
----------------
44+
45+
If you wish to run the tests, you may follow the below steps:
46+
47+
When using Docker, set :code:`RUN_TEST=ON` and :code:`WITH_TESTING=ON` will run test immediately after the build.
48+
Set :code:`WITH_GPU=ON` Can also run tests on GPU.
49+
50+
.. code-block:: bash
51+
52+
docker run -it -v $PWD:/paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=ON" -e "RUN_TEST=ON" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 bash -x paddle/scripts/docker/build.sh
53+
54+
If you don't use Docker, just run ctest will start the tests:
55+
56+
.. code-block:: bash
57+
58+
mkdir build
59+
cd build
60+
cmake -DWITH_GPU=OFF -DWITH_TESTING=ON ..
61+
make
62+
ctest
63+
# run a single test like test_mul_op
64+
ctest -R test_mul_op
65+
66+
67+
.. _compile_deps:
3668

3769
Compile Dependencies
3870
----------------

doc/getstarted/build_and_install/docker_install_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
使用Docker安装运行PaddlePaddle
1+
使用Docker安装运行
22
================================
33

44
使用Docker安装和运行PaddlePaddle可以无需考虑依赖环境即可运行。并且也可以在Windows的docker中运行。

doc/getstarted/build_and_install/docker_install_en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PaddlePaddle in Docker Containers
1+
Run in Docker Containers
22
=================================
33

44
Run PaddlePaddle in Docker container so that you don't need to care about

doc/getstarted/build_and_install/pip_install_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
使用pip安装PaddlePaddle
1+
使用pip安装
22
================================
33

44
PaddlePaddle可以使用常用的Python包管理工具

doc/getstarted/build_and_install/pip_install_en.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Install PaddlePaddle Using pip
1+
Install Using pip
22
================================
33

44
You can use current widely used Python package management

doc/howto/index_cn.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
.. toctree::
2020
:maxdepth: 1
2121

22-
dev/build_cn.rst
2322
dev/write_docs_cn.rst
2423

2524
模型配置

doc/howto/index_en.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Development
1818
.. toctree::
1919
:maxdepth: 1
2020

21-
dev/build_en.rst
2221
dev/new_layer_en.rst
2322
dev/contribute_to_paddle_en.md
2423

0 commit comments

Comments
 (0)