Skip to content

[install doc] optimize cmake command in compile install doc #5122

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/install/compile/linux-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ apt install patchelf

* 对于需要编译**CPU 版本 PaddlePaddle**的用户:
```
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF
```

* 对于需要编译**GPU 版本 PaddlePaddle**的用户:
```
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=ON
```
- 具体编译选项含义请参见[编译选项表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#Compile)

Expand Down Expand Up @@ -493,7 +493,7 @@ mkdir build && cd build

```
cmake .. -DPY_VERSION=3.7 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
```

> 如果遇到`Could NOT find PROTOBUF (missing: PROTOBUF_LIBRARY PROTOBUF_INCLUDE_DIR)`可以重新执行一次 cmake 指令。
Expand Down Expand Up @@ -535,7 +535,7 @@ mkdir build && cd build
2. 如果您已经正确安装了`nccl2`,就可以开始 cmake 了:(*For Python3: 请给 PY_VERSION 参数配置正确的 python 版本*)

```
cmake .. -DPYTHON_EXECUTABLE:FILEPATH=[您可执行的 Python3 的路径] -DPYTHON_INCLUDE_DIR:PATH=[之前的 PYTHON_INCLUDE_DIRS] -DPYTHON_LIBRARY:FILEPATH=[之前的 PYTHON_LIBRARY] -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPYTHON_EXECUTABLE:FILEPATH=[您可执行的 Python3 的路径] -DPYTHON_INCLUDE_DIR:PATH=[之前的 PYTHON_INCLUDE_DIRS] -DPYTHON_LIBRARY:FILEPATH=[之前的 PYTHON_LIBRARY] -DWITH_GPU=ON
```

注意:以上涉及 Python3 的命令,用 Python3.7 来举例,如您的 Python 版本为 3.6/3.8/3.9,请将上述命令中的 Python3.7 改成 Python3.6/Python3.8/Python3.9
Expand Down
8 changes: 4 additions & 4 deletions docs/install/compile/linux-compile_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ apt install patchelf
* For users who need to compile the **CPU version PaddlePaddle**:

```
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF
```

* For users who need to compile the **GPU version PaddlePaddle**:
```
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=ON
```

- For details on the compilation options, see the [compilation options table](https://www.paddlepaddle.org.cn/documentation/docs/en/develop/install/Tables.html#Compile).
Expand Down Expand Up @@ -479,7 +479,7 @@ mkdir build && cd build

```
cmake .. -DPY_VERSION=3.7 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
```


Expand Down Expand Up @@ -507,7 +507,7 @@ mkdir build && cd build


```
cmake .. -DPYTHON_EXECUTABLE:FILEPATH=[您可执行的 Python3 的路径] -DPYTHON_INCLUDE_DIR:PATH=[之前的 PYTHON_INCLUDE_DIRS] -DPYTHON_LIBRARY:FILEPATH=[之前的 PYTHON_LIBRARY] -DWITH_GPU=ON -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPYTHON_EXECUTABLE:FILEPATH=[您可执行的 Python3 的路径] -DPYTHON_INCLUDE_DIR:PATH=[之前的 PYTHON_INCLUDE_DIRS] -DPYTHON_LIBRARY:FILEPATH=[之前的 PYTHON_LIBRARY] -DWITH_GPU=ON
```


Expand Down
4 changes: 2 additions & 2 deletions docs/install/compile/macos-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ apt install patchelf
* 对于需要编译**CPU 版本 PaddlePaddle**的用户(我们目前不支持 macOS 下 GPU 版本 PaddlePaddle 的编译):

```
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF -DWITH_TESTING=OFF -DWITH_AVX=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF
```
- 具体编译选项含义请参见[编译选项表](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/install/Tables.html#Compile)

Expand Down Expand Up @@ -259,7 +259,7 @@ mkdir build && cd build

```
cmake .. -DPY_VERSION=3.7 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
```

>`-DPY_VERSION=3.7`请修改为安装环境的 Python 版本
Expand Down
4 changes: 2 additions & 2 deletions docs/install/compile/macos-compile_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ apt install patchelf
* For users who need to compile the **CPU version PaddlePaddle** (We currently do not support the compilation of the GPU version PaddlePaddle under macOS):

```
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF -DWITH_TESTING=OFF -DWITH_AVX=OFF -DCMAKE_BUILD_TYPE=Release
cmake .. -DPY_VERSION=3.7 -DWITH_GPU=OFF
```
> For details on the compilation options, see the [compilation options table](/documentation/docs/en/install/Tables_en.html/#Compile).

Expand Down Expand Up @@ -263,7 +263,7 @@ mkdir build && cd build

```
cmake .. -DPY_VERSION=3.7 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_FLUID_ONLY=ON -DWITH_GPU=OFF -DWITH_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
```

- ``-DPY_VERSION=3.7`` Please change to the Python version of the installation environment.
Expand Down