Skip to content

Commit e90678c

Browse files
author
Yancey
authored
fix build doc (#12177)
* fix build doc * add some description about Python ABI
1 parent 2c3495c commit e90678c

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

doc/v2/build_and_install/build_from_source_cn.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,16 @@ PaddlePaddle需要使用Docker环境完成编译,这样可以免去单独安
3535
# 2. 可选步骤:源码中构建用于编译PaddlePaddle的Docker镜像
3636
docker build -t paddle:dev .
3737
# 3. 执行下面的命令编译CPU-Only的二进制
38-
docker run -it -v $PWD:/paddle -w /paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 ./paddle/scripts/paddle_build.sh build
38+
docker run -it -v $PWD:/paddle -w /paddle -e "PYTHON_ABI=cp27-cp27mu" -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 ./paddle/scripts/paddle_build.sh build
3939
# 4. 或者也可以使用为上述可选步骤构建的镜像(必须先执行第2步)
4040
docker run -it -v $PWD:/paddle -w /paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddle:dev ./paddle/scripts/paddle_build.sh build
4141
42-
注:上述命令把当前目录(源码树根目录)映射为 container 里的 :code:`/paddle` 目录。
42+
注:
43+
44+
- 上述命令把当前目录(源码树根目录)映射为 container 里的 :code:`/paddle` 目录。
45+
46+
- 如果您使用的是 manylinux 的镜像进行编译, 那么您需要通过环境变量 :code:`PYTHON_ABI` 来指定一个 `Python ABI <https://www.python.org/dev/peps/pep-0425/#id8>`__.
47+
PaddlePaddle目前支持的 Python ABI 有 :code:`cp27-cp27m` 和 :code:`cp27-cp27mu`.
4348

4449
编译完成后会在build/python/dist目录下生成输出的whl包,可以选在在当前机器安装也可以拷贝到目标机器安装:
4550

doc/v2/build_and_install/build_from_source_en.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,18 @@ If you don't wish to use docker,you need to install several compile dependenci
3636
# 2. Optional: build development docker image from source
3737
docker build -t paddle:dev .
3838
# 3. Run the following command to build a CPU-Only binaries
39-
docker run -it -v $PWD:/paddle -w /paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 ./paddle/scripts/paddle_build.sh build
39+
docker run -it -v $PWD:/paddle -w /paddle -e "PYTHON_ABI=cp27-cp27mu" -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddlepaddle/paddle_manylinux_devel:cuda8.0_cudnn5 ./paddle/scripts/paddle_build.sh build
4040
# 4. Or, use your built Docker image to build PaddlePaddle (must run step 2)
4141
docker run -it -v $PWD:/paddle -w /paddle -e "WITH_GPU=OFF" -e "WITH_TESTING=OFF" paddle:dev ./paddle/scripts/paddle_build.sh build
4242
43-
NOTE: The above command try to mount the current working directory (root directory of source code)
43+
NOTE:
44+
45+
- The above command try to mount the current working directory (root directory of source code)
4446
into :code:`/paddle` directory inside docker container.
4547

48+
- You need to pass in the required environment variable :code:`PYTHON_ABI` to specify a `Python ABI <https://www.python.org/dev/peps/pep-0425/#id8>`__.
49+
Currently PaddlePaddle supported Python ABIs include :code:`cp27-cp27m` and :code:`cp27-cp27mu` .
50+
4651
When the compile finishes, you can get the output whl package under
4752
build/python/dist, then you can choose to install the whl on local
4853
machine or copy it to the target machine.

0 commit comments

Comments
 (0)