COMPILE.md 1.4 KB
Newer Older
D
Dong Daxiang 已提交
1 2
# 如何编译PaddleServing

D
Dong Daxiang 已提交
3
### 编译环境设置
D
Dong Daxiang 已提交
4 5 6 7 8 9
- os: CentOS 6u3
- gcc: 4.8.2及以上
- go: 1.9.2及以上
- git:2.17.1及以上
- cmake:3.2.2及以上
- python:2.7.2及以上
D
Dong Daxiang 已提交
10

D
Dong Daxiang 已提交
11 12 13 14 15 16 17 18 19
### 获取代码

``` python
git clone https://github.com/PaddlePaddle/Serving
git submodule update --init --recursive
```

### 编译Server部分

D
Dong Daxiang 已提交
20 21 22 23 24 25
#### PYTHONROOT设置
``` shell
# 例如python的路径为/usr/bin/python,可以设置PYTHONROOT
export PYTHONROOT=/usr/
```

D
Dong Daxiang 已提交
26 27 28 29 30 31
#### 集成CPU版本Paddle Inference Library
``` shell
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ -DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so -DPYTHON_EXECUTABLE=/home/users/dongdaxiang/software/baidu/third-party/python/bin/python -DCLIENT_ONLY=OFF ..
make -j10
```

D
Dong Daxiang 已提交
32 33 34 35 36 37
#### 集成GPU版本Paddle Inference Library
``` shell
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ -DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so -DPYTHON_EXECUTABLE=/home/users/dongdaxiang/software/baidu/third-party/python/bin/python -DCLIENT_ONLY=ON -DWITH_GPU=ON ..
make -j10
```

D
Dong Daxiang 已提交
38 39 40 41 42 43
### 编译Client部分

``` shell
cmake -DPYTHON_INCLUDE_DIR=$PYTHONROOT/include/python2.7/ -DPYTHON_LIBRARIES=$PYTHONROOT/lib/libpython2.7.so -DPYTHON_EXECUTABLE=/home/users/dongdaxiang/software/baidu/third-party/python/bin/python -DCLIENT_ONLY=ON ..
make -j10
```
D
Dong Daxiang 已提交
44 45 46 47 48 49 50 51

### 安装wheel包
无论是client端还是server端,编译完成后,安装python/dist/下的whl包即可