Skip to content

Commit a94aa4d

Browse files
author
Yancey
authored
add manylinux docker image usage (#10585)
* add manylinux docker image usage * update by comment * update by comment
1 parent b0eca10 commit a94aa4d

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

doc/v2/build_and_install/build_from_source_cn.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@
1919
----------------
2020

2121
PaddlePaddle需要使用Docker环境完成编译,这样可以免去单独安装编译依赖的步骤,可选的不同编译环境Docker镜像
22-
可以在 `这里 <https://hub.docker.com/r/paddlepaddle/paddle_manylinux_devel/tags/>`_ 找到。或者
23-
参考下述可选步骤,从源码中构建用于编译PaddlePaddle的Docker镜像。
22+
可以在 `这里 <https://hub.docker.com/r/paddlepaddle/paddle_manylinux_devel/tags/>`_ 找到,您也可以
23+
在 `这里 <https://github.com/PaddlePaddle/Paddle/tree/develop/tools/manylinux1/>`_ 找到 paddle_manylinux_devel
24+
镜像的编译以及使用方法。或者参考下述可选步骤,从源码中构建用于编译PaddlePaddle的Docker镜像。
2425

2526
如果您选择不使用Docker镜像,则需要在本机安装下面章节列出的 `编译依赖`_ 之后才能开始编译的步骤。
2627

doc/v2/build_and_install/build_from_source_en.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ How To Build
2222
You need to use Docker to build PaddlePaddle
2323
to avoid installing dependencies by yourself. We have several pre-built
2424
Docker images `here <https://hub.docker.com/r/paddlepaddle/paddle_manylinux_devel/tags/>`_ ,
25+
you can also find how to build and use paddle_manylinux_devel Docker image from
26+
`here <https://github.com/PaddlePaddle/Paddle/tree/develop/tools/manylinux1/>`_
2527
Or you can build your own image from source as the optional step below:
2628

2729
.. code-block:: bash

tools/manylinux1/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,38 @@ git clone https://github.com/paddlepaddle/paddle
2828
cd paddle/tools/manylinux1
2929
REPO=[yourrepo] ./build_all.sh
3030
```
31+
32+
## Build PaddlePaddle for the different Python ABIs
33+
34+
Choose one of the following Python ABI and set the correct environment variables.
35+
36+
- cp27-cp27m
37+
38+
```bash
39+
export LD_LIBRARY_PATH=/opt/_internal/cpython-2.7.11-ucs2/lib:${LD_LIBRARY_PATH#/opt/_internal/cpython-2.7.11-ucs4/lib:}
40+
export PATH=/opt/python/cp27-cp27m/bin/:${PATH}
41+
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/python/cp27-cp27m/bin/python
42+
-DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27m/include/python2.7
43+
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs2/lib/libpython2.7.so"
44+
```
45+
46+
- cp27-cp27mu
47+
48+
```bash
49+
export LD_LIBRARY_PATH=/opt/_internal/cpython-2.7.11-ucs4/lib:${LD_LIBRARY_PATH#/opt/_internal/cpython-2.7.11-ucs2/lib:}
50+
export PATH=/opt/python/cp27-cp27mu/bin/:${PATH}
51+
export PYTHON_FLAGS="-DPYTHON_EXECUTABLE:FILEPATH=/opt/python/cp27-cp27mu/bin/python
52+
-DPYTHON_INCLUDE_DIR:PATH=/opt/python/cp27-cp27mu/include/python2.7
53+
-DPYTHON_LIBRARIES:FILEPATH=/opt/_internal/cpython-2.7.11-ucs4/lib/libpython2.7.so"
54+
```
55+
56+
And then add the `PYTHON_FLAGS` as your cmake flags:
57+
58+
```bash
59+
cmake ..
60+
${PYTHON_FLAGS} \
61+
-DWITH_GPU=OFF \
62+
...
63+
```
64+
65+
You can find more details about cmake flags at [here](http://www.paddlepaddle.org/docs/develop/documentation/fluid/en/build_and_install/build_from_source_en.html#appendix-build-options)

0 commit comments

Comments
 (0)