@@ -11,32 +11,21 @@ You can download PaddlePaddle from the [github source](https://github.com/Paddle
11
11
``` bash
12
12
git clone https://github.com/PaddlePaddle/Paddle paddle
13
13
cd paddle
14
- git submodule update --init --recursive
15
14
```
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
-
24
15
## <span id =" requirements " >Requirements</span >
25
16
26
17
To compile the source code, your computer must be equipped with the following dependencies.
27
18
28
19
- ** 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)
30
21
- ** 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
33
22
34
23
** Note:** For CUDA 7.0 and CUDA 7.5, GCC 5.0 and up are not supported!
35
24
For CUDA 8.0, GCC versions later than 5.3 are not supported!
36
25
37
26
### Options
38
27
39
- PaddlePaddle supports some build options. To enable it, first you need to install the related libraries.
28
+ PaddlePaddle supports some build options.
40
29
41
30
<html >
42
31
<table >
@@ -47,12 +36,21 @@ PaddlePaddle supports some build options. To enable it, first you need to instal
47
36
</tr >
48
37
</thead >
49
38
<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 >
56
54
</tbody >
57
55
</table >
58
56
</html >
@@ -64,18 +62,15 @@ PaddlePaddle supports some build options. To enable it, first you need to instal
64
62
65
63
As a simple example, consider the following:
66
64
67
- 1 . ** Python Dependencies(optional)**
65
+ 1 . ** BLAS Dependencies(optional)**
68
66
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 ` .
70
68
71
69
``` 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>
79
74
```
80
75
81
76
2. ** Doc Dependencies(optional)**
@@ -104,17 +99,9 @@ As a simple example, consider the following:
104
99
```bash
105
100
# necessary
106
101
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'
118
105
```
119
106
120
107
- **GPU Dependencies (optional)**
@@ -149,51 +136,17 @@ As usual, the best option is to create build folder under paddle project directo
149
136
150
137
```bash
151
138
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
+ ```
160
140
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:
179
142
180
143
```bash
181
144
# 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>
183
146
# please use sudo make install, if you want to install PaddlePaddle into the system
184
147
make -j `nproc` && make install
185
148
# set PaddlePaddle installation path in ~/.bashrc
186
149
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.
196
151
sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
197
- # or just run
198
- sudo paddle version
199
152
```
0 commit comments