Skip to content

Commit 77eb729

Browse files
authored
Merge pull request #1106 from gangliao/clean_docs
Update build and install docs
2 parents de27ee7 + 4de7797 commit 77eb729

File tree

6 files changed

+33
-112
lines changed

6 files changed

+33
-112
lines changed

doc/faq/index_cn.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -286,22 +286,3 @@ PaddlePaddle的参数使用名字 :code:`name` 作为参数的ID,相同名字
286286
.. code-block:: bash
287287
288288
paddle train --use_gpu=true --trainer_count=2 --gpu_id=2
289-
290-
12. 编译源码提示warp-ctc/include/ctc.h 找不到的情况
291-
---------------------------------------------------
292-
293-
目前Paddle使用\ :code:`git submodule`\ 来引用一些第三方模块。简单的\
294-
:code:`git clone`\ 命令不能得到第三方模块的代码。需要使用\:
295-
296-
.. code-block:: bash
297-
298-
git clone --recursive https://github.com/PaddlePaddle/Paddle.git
299-
300-
来获取所有源码。对于已经clone的git版本库,可以在Paddle的源码目录中执行\:
301-
302-
.. code-block:: bash
303-
304-
git submodule init
305-
git submodule update
306-
307-
来获得所有第三方模块。

doc/getstarted/build_and_install/build_from_source_en.md

Lines changed: 30 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,21 @@ You can download PaddlePaddle from the [github source](https://github.com/Paddle
1111
```bash
1212
git clone https://github.com/PaddlePaddle/Paddle paddle
1313
cd paddle
14-
git submodule update --init --recursive
1514
```
16-
17-
If you already have a local PaddlePaddle repo and have not initialized the submodule, your local submodule folder will be empty. You can simply run the last line of the above codes in your PaddlePaddle home directory to initialize your submodule folder.
18-
19-
If you have already initialized your submodule and you would like to sync with the upstream submodule repo, you can run the following command
20-
```
21-
git submodule update --remote
22-
```
23-
2415
## <span id="requirements">Requirements</span>
2516

2617
To compile the source code, your computer must be equipped with the following dependencies.
2718

2819
- **Compiler**: GCC >= 4.8 or Clang >= 3.3 (AppleClang >= 5.1)
29-
- **CMake**: version >= 2.8
20+
- **CMake**: version >= 3.0 (at least CMake 3.4 on Mac OS X)
3021
- **BLAS**: MKL, OpenBlas or ATLAS
31-
- **Protocol Buffers**: version >= 2.4, **Note: 3.x is not supported**
32-
- **Python**: only python 2.7 is supported currently
3322

3423
**Note:** For CUDA 7.0 and CUDA 7.5, GCC 5.0 and up are not supported!
3524
For CUDA 8.0, GCC versions later than 5.3 are not supported!
3625

3726
### Options
3827

39-
PaddlePaddle supports some build options. To enable it, first you need to install the related libraries.
28+
PaddlePaddle supports some build options.
4029

4130
<html>
4231
<table>
@@ -47,12 +36,21 @@ PaddlePaddle supports some build options. To enable it, first you need to instal
4736
</tr>
4837
</thead>
4938
<tbody>
50-
<tr><td class="left">WITH_GPU</td><td class="left">Compile with GPU mode.</td></tr>
51-
<tr><td class="left">WITH_DOUBLE</td><td class="left">Compile with double precision floating-point, default: single precision.</td></tr>
52-
<tr><td class="left">WITH_TESTING</td><td class="left">Compile with gtest for PaddlePaddle's unit testing.</td></tr>
53-
<tr><td class="left">WITH_DOC</td><td class="left"> Compile to generate PaddlePaddle's docs, default: disabled (OFF).</td></tr>
54-
<tr><td class="left">WITH_SWIG_PY</td><td class="left">Compile with python predict API, default: disabled (OFF).</td></tr>
55-
<tr><td class="left">WITH_STYLE_CHECK</td><td class="left">Compile with code style check, default: enabled (ON).</td></tr>
39+
<tr><td class="left">WITH_GPU</td><td class="left">Compile PaddlePaddle with NVIDIA GPU</td></tr>
40+
<tr><td class="left">WITH_AVX</td><td class="left">Compile PaddlePaddle with AVX intrinsics</td></tr>
41+
<tr><td class="left">WITH_DSO</td><td class="left">Compile PaddlePaddle with dynamic linked CUDA</td></tr>
42+
<tr><td class="left">WITH_TESTING</td><td class="left">Compile PaddlePaddle with unit testing</td></tr>
43+
<tr><td class="left">WITH_SWIG_PY</td><td class="left">Compile PaddlePaddle with inference api</td></tr>
44+
<tr><td class="left">WITH_STYLE_CHECK</td><td class="left">Compile PaddlePaddle with style check</td></tr>
45+
<tr><td class="left">WITH_PYTHON</td><td class="left">Compile PaddlePaddle with python interpreter</td></tr>
46+
<tr><td class="left">WITH_DOUBLE</td><td class="left">Compile PaddlePaddle with double precision</td></tr>
47+
<tr><td class="left">WITH_RDMA</td><td class="left">Compile PaddlePaddle with RDMA support</td></tr>
48+
<tr><td class="left">WITH_TIMER</td><td class="left">Compile PaddlePaddle with stats timer</td></tr>
49+
<tr><td class="left">WITH_PROFILER</td><td class="left">Compile PaddlePaddle with GPU profiler</td></tr>
50+
<tr><td class="left">WITH_DOC</td><td class="left">Compile PaddlePaddle with documentation</td></tr>
51+
<tr><td class="left">ON_COVERALLS</td><td class="left">Compile PaddlePaddle with code coverage</td></tr>
52+
<tr><td class="left">COVERALLS_UPLOAD</td><td class="left">Package code coverage data to coveralls</td></tr>
53+
<tr><td class="left">ON_TRAVIS</td><td class="left">Exclude special unit test on Travis CI</td></tr>
5654
</tbody>
5755
</table>
5856
</html>
@@ -64,18 +62,15 @@ PaddlePaddle supports some build options. To enable it, first you need to instal
6462

6563
As a simple example, consider the following:
6664

67-
1. **Python Dependencies(optional)**
65+
1. **BLAS Dependencies(optional)**
6866

69-
To compile PaddlePaddle with python predict API, make sure swig installed and set `-DWITH_SWIG_PY=ON` as follows:
67+
Paddle will find BLAS from system's default path. But you can specify MKL, OpenBLAS or ATLAS via `MKL_ROOT`, `OPENBLAS_ROOT` or `ATLAS_ROOT`.
7068

7169
```bash
72-
# install swig on ubuntu
73-
sudo apt-get install swig
74-
# install swig on Mac OS X
75-
brew install swig
76-
77-
# active swig in cmake
78-
cmake .. -DWITH_SWIG_PY=ON
70+
# specify MKL
71+
cmake .. -DMKL_ROOT=<mkl_path>
72+
# or specify OpenBLAS
73+
cmake .. -DOPENBLAS_ROOT=<openblas_path>
7974
```
8075

8176
2. **Doc Dependencies(optional)**
@@ -104,17 +99,9 @@ As a simple example, consider the following:
10499
```bash
105100
# necessary
106101
sudo apt-get update
107-
sudo apt-get install -y g++ make cmake swig build-essential libatlas-base-dev python python-pip libpython-dev m4 libprotobuf-dev protobuf-compiler python-protobuf python-numpy git
108-
# optional
109-
sudo apt-get install libgoogle-glog-dev
110-
sudo apt-get install libgflags-dev
111-
sudo apt-get install libgtest-dev
112-
sudo pip install wheel
113-
pushd /usr/src/gtest
114-
cmake .
115-
make
116-
sudo cp *.a /usr/lib
117-
popd
102+
sudo apt-get install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev git
103+
sudo pip install wheel numpy
104+
sudo pip install 'protobuf>=3.0.0'
118105
```
119106
120107
- **GPU Dependencies (optional)**
@@ -149,51 +136,17 @@ As usual, the best option is to create build folder under paddle project directo
149136
150137
```bash
151138
mkdir build && cd build
152-
cmake ..
153-
```
154-
155-
CMake first check PaddlePaddle's dependencies in system default path. After installing some optional
156-
libraries, corresponding build option will be set automatically (for instance, glog, gtest and gflags).
157-
If still not found, you can manually set it based on CMake error information from your screen.
158-
159-
As a simple example, consider the following:
139+
```
160140
161-
- **Only CPU with swig**
162-
163-
```bash
164-
cmake .. -DWITH_GPU=OFF -DWITH_SWIG_PY=ON
165-
```
166-
- **GPU with swig**
167-
168-
```bash
169-
cmake .. -DWITH_GPU=ON -DWITH_SWIG_PY=ON
170-
```
171-
172-
- **GPU with doc and swig**
173-
174-
```bash
175-
cmake .. -DWITH_GPU=ON -DWITH_DOC=ON -DWITH_SWIG_PY=ON
176-
```
177-
178-
Finally, you can build PaddlePaddle:
141+
Finally, you can build and install PaddlePaddle:
179142
180143
```bash
181144
# you can add build option here, such as:
182-
cmake .. -DWITH_GPU=ON -DCMAKE_INSTALL_PREFIX=<path to install> -DWITH_SWIG_PY=ON
145+
cmake .. -DCMAKE_INSTALL_PREFIX=<path to install>
183146
# please use sudo make install, if you want to install PaddlePaddle into the system
184147
make -j `nproc` && make install
185148
# set PaddlePaddle installation path in ~/.bashrc
186149
export PATH=<path to install>/bin:$PATH
187-
```
188-
189-
If you set `WITH_SWIG_PY=ON`, related python dependencies also need to be installed.
190-
Otherwise, PaddlePaddle will automatically install python dependencies
191-
at first time when user run paddle commands, such as `paddle version`, `paddle train`.
192-
It may require sudo privileges:
193-
194-
```bash
195-
# you can run
150+
# install PaddlePaddle Python modules.
196151
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
197-
# or just run
198-
sudo paddle version
199152
```

doc/getstarted/build_and_install/cmake/build_from_source_cn.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ PaddePaddle通过编译时指定路径来实现引用各种BLAS/CUDA/Cudnn库。
4040
4141
cmake .. -DMKL_ROOT=/opt/mkl/ -DCUDNN_ROOT=/opt/cudnnv5
4242
43-
注意:这几个编译选项的设置,只在第一次cmake的时候有效。如果之后想要重新设置,推荐清理整个编译目录(``rm -rf``)后,再指定。
43+
注意:这几个编译选项的设置,只在第一次cmake的时候有效。如果之后想要重新设置,推荐清理整个编译目录(``rm -rf``)后,再指定。

doc/getstarted/build_and_install/docker_install_en.rst

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,13 @@ Developers can work on PaddlePaddle using Docker. This allows
1616
developers to work on different platforms -- Linux, Mac OS X, and
1717
Windows -- in a consistent way.
1818

19-
The general development workflow with Docker and Bazel is as follows:
19+
The general development workflow with Docker and CMake is as follows:
2020

2121
1. Get the source code of Paddle:
2222

2323
.. code-block:: bash
2424
25-
git clone --recursive https://github.com/PaddlePaddle/Paddle.git
26-
27-
28-
Here **git clone --recursive is required** as we have a submodule `warp-ctc <https://github.com/baidu-research/warp-ctc>`_.
29-
30-
If you have used :code:`git clone https://github.com/PaddlePaddle/Paddle` and find that the directory :code:`warp-ctc` is
31-
empty, please use the following command to get the submodule.
32-
33-
.. code-block:: bash
34-
35-
git submodule update --init --recursive
25+
git clone https://github.com/PaddlePaddle/Paddle.git
3626
3727
3828
2. Build a development Docker image :code:`paddle:dev` from the source
@@ -162,7 +152,6 @@ source code:
162152
cd ~
163153
git clone https://github.com/PaddlePaddle/Paddle.git
164154
cd Paddle
165-
git submodule update --init --recursive
166155
docker build --build-arg WITH_AVX=OFF -t paddle:cpu-noavx -f paddle/scripts/docker/Dockerfile .
167156
docker build --build-arg WITH_AVX=OFF -t paddle:gpu-noavx -f paddle/scripts/docker/Dockerfile.gpu .
168157

doc/howto/dev/contribute_to_paddle_cn.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ cd Paddle
3333
git checkout -b develop # 创建 develop 分支
3434
git remote add upstream https://github.com/PaddlePaddle/Paddle.git # 添加 upstream 到 baidu/Paddle
3535
git pull upstream develop # 更新 upstream
36-
git submodule update --init --recursive
3736
```
3837

3938
然后你可以通过做一个本地开发分支开始开发

doc/howto/dev/contribute_to_paddle_en.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ cd Paddle
3838
git checkout -b develop # create develop branch.
3939
git remote add upstream https://github.com/PaddlePaddle/Paddle.git # add upstream to baidu/Paddle
4040
git pull upstream develop # update to upstream
41-
git submodule update --init --recursive
4241
```
4342

4443
Then you can start to develop by making a local developement branch

0 commit comments

Comments
 (0)