Skip to content

Commit 8b64446

Browse files
committed
Update build and install docs
1 parent 748229a commit 8b64446

File tree

1 file changed

+25
-74
lines changed

1 file changed

+25
-74
lines changed

doc/getstarted/build_and_install/build_from_source_en.md

Lines changed: 25 additions & 74 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
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>
@@ -66,14 +64,9 @@ As a simple example, consider the following:
6664

6765
1. **Python Dependencies(optional)**
6866

69-
To compile PaddlePaddle with python predict API, make sure swig installed and set `-DWITH_SWIG_PY=ON` as follows:
67+
To compile PaddlePaddle with python predict API, set `-DWITH_SWIG_PY=ON` as follows:
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-
7770
# active swig in cmake
7871
cmake .. -DWITH_SWIG_PY=ON
7972
```
@@ -104,17 +97,9 @@ As a simple example, consider the following:
10497
```bash
10598
# necessary
10699
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
100+
sudo apt-get install -y g++ make cmake build-essential libatlas-base-dev python python-pip libpython-dev git
101+
sudo pip install wheel numpy
102+
sudo pip install 'protobuf>=3.0.0'
118103
```
119104
120105
- **GPU Dependencies (optional)**
@@ -149,51 +134,17 @@ As usual, the best option is to create build folder under paddle project directo
149134
150135
```bash
151136
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:
137+
```
160138
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:
139+
Finally, you can build and install PaddlePaddle:
179140
180141
```bash
181142
# you can add build option here, such as:
182-
cmake .. -DWITH_GPU=ON -DCMAKE_INSTALL_PREFIX=<path to install> -DWITH_SWIG_PY=ON
143+
cmake .. -DCMAKE_INSTALL_PREFIX=<path to install>
183144
# please use sudo make install, if you want to install PaddlePaddle into the system
184145
make -j `nproc` && make install
185146
# set PaddlePaddle installation path in ~/.bashrc
186147
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
148+
# install PaddlePaddle Python modules.
196149
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
197-
# or just run
198-
sudo paddle version
199150
```

0 commit comments

Comments
 (0)