@@ -11,32 +11,21 @@ You can download PaddlePaddle from the [github source](https://github.com/Paddle
1111``` bash
1212git clone https://github.com/PaddlePaddle/Paddle paddle
1313cd 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
2617To 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!
3524For 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
6563As 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
81762. ** 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
151138mkdir 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
184147make -j `nproc` && make install
185148# set PaddlePaddle installation path in ~/.bashrc
186149export 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.
196151sudo pip install <path to install>/opt/paddle/share/wheels/*.whl
197- # or just run
198- sudo paddle version
199152```
0 commit comments