Skip to content

Commit 25e9bd6

Browse files
alex-dinhjzhang533
andauthored
Update local compilation docs (#1622)
* Update local compilation docs * local compilation docs chinese version update Signed-off-by: Zhang Jun <jzhang533@gmail.com> --------- Signed-off-by: Zhang Jun <jzhang533@gmail.com> Co-authored-by: Zhang Jun <jzhang533@gmail.com>
1 parent c8b5048 commit 25e9bd6

File tree

4 files changed

+63
-19
lines changed

4 files changed

+63
-19
lines changed

docs/en/compile_local.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,19 @@ make install
2222
# set the library to environment
2323
export PATH=${PWD}/installed_protobuf_lib/bin:${PATH}
2424
```
25+
### Alternatively:
2526

26-
### 1.2 Install Protobuf
27+
Install Protobuf via apt (Linux):
28+
```bash
29+
sudo apt install protobuf-compiler
30+
```
31+
32+
Install Protobuf via homebrew (Mac):
33+
```bash
34+
brew install protobuf
35+
```
36+
37+
### 1.2 Install PaddlePaddle
2738

2839
```bash
2940
python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
@@ -45,12 +56,17 @@ If you are developing the Paddle2ONNX project locally, you can use `pip install
4556
## 2 Install on Windows
4657

4758
**Note that the prerequisite for compiling and installing Windows is that Visual Studio 2019 is already installed in the system**
59+
### 2.1 Install Visual Studio 16 2019
60+
1. Download Visual Studio 16 2019 from [this link](https://download.visualstudio.microsoft.com/download/pr/e7ffa30b-43a5-4afc-bf2a-2e3656a842e4/60b26131ac7b8c59f734a1e0c32cc9dc/vs_community.exe) and run `vs_community.exe`.
61+
2. Under the **Workloads** tab, select the checkbox for **Desktop development with C++**.
62+
- Note: Under Installation Details > Desktop Development with C++ > Optional: **Live Share** and **Intellicode** are unnecessary, feel free to uncheck these boxes.
63+
3. Click **Install**
4864

49-
### 2.1 Open Visual Studio Command Prompt
65+
### 2.2 Open Visual Studio Command Prompt
5066

5167
In the system menu, find **x64 Native Tools Command Prompt for VS 2019** and open it.
5268

53-
### 2.2 Install Protobuf
69+
### 2.3 Install Protobuf
5470

5571
Note that the `-DCMAKE_INSTALL_PREFIX` in the following cmake command specifies your actual set path.
5672

@@ -67,7 +83,7 @@ cmake --build . --config Release --target install
6783
set PATH=%CD%\protobuf_install\bin;%PATH%
6884
```
6985

70-
### 2.3 Install Paddle2ONNX
86+
### 2.4 Install Paddle2ONNX
7187

7288
```bash
7389
git clone https://github.com/PaddlePaddle/Paddle2ONNX.git

docs/en/op_list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ All supported PaddlePaddle operators are listed as below,
6161
- hard_shrink
6262
- hard_sigmoid
6363
- hard_swish
64+
- index_put
65+
- index_select
6466
- layer_norm
6567
- leaky_relu
6668
- less_equal
@@ -110,6 +112,7 @@ All supported PaddlePaddle operators are listed as below,
110112
- round
111113
- rsqrt
112114
- scale
115+
- scatter
113116
- selu
114117
- set_value
115118
- shape

docs/zh/compile_local.md

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# 如何在本地编译并安装 Paddle2ONNX
22

3-
Paddle2ONNX 的编译安装至少需要确保环境满足以下需求
3+
Paddle2ONNX 的编译安装需要确保环境满足以下需求
44

55
- cmake >= 3.16.0
66
- protobuf == 21.12
77

8-
## 在 Linux/Mac 下编译并安装
8+
## 1 在 Linux/Mac 下安装
99

10-
### 安装 Protobuf
10+
### 1.1 安装 Protobuf
1111

1212
```bash
1313
git clone https://github.com/protocolbuffers/protobuf.git
@@ -19,16 +19,31 @@ cmake ../cmake -DCMAKE_INSTALL_PREFIX=`pwd`/installed_protobuf_lib -Dprotobuf_BU
1919
make -j
2020
make install
2121

22-
# 将编译目录加入环境变量
22+
# 将库路径添加到环境变量
2323
export PATH=${PWD}/installed_protobuf_lib/bin:${PATH}
2424
```
2525

26-
### 安装PaddlePaddle
26+
### 或者:
27+
28+
通过 apt 安装 Protobuf (Linux):
29+
30+
```bash
31+
sudo apt install protobuf-compiler
32+
```
33+
34+
通过 homebrew 安装 Protobuf (Mac):
35+
36+
```bash
37+
brew install protobuf
38+
```
39+
40+
### 1.2 安装 PaddlePaddle
41+
2742
```bash
2843
python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
2944
```
3045

31-
### 安装Paddle2ONNX
46+
### 1.3 安装 Paddle2ONNX
3247

3348
```bash
3449
git clone https://github.com/PaddlePaddle/Paddle2ONNX.git
@@ -39,19 +54,26 @@ python -m build
3954
pip install dist/*.whl
4055
```
4156

42-
如果你是在本地开发 Paddle2ONNX 项目,推荐使用 `pip install -e .` 命令,以 editable mode 来安装。
57+
如果你是在本地开发 Paddle2ONNX 项目,可以使用 `pip install -e .` 命令以可编辑模式安装。
58+
59+
## 2 在 Windows 下安装
60+
61+
**注意,在 Windows 上编译安装的先决条件是系统已安装 Visual Studio 2019**
4362

44-
## Windows编译安装
63+
### 2.1 安装 Visual Studio 16 2019
4564

46-
注意Windows编译安装先验条件是系统中已安装好Visual Studio 2019
65+
1.[此链接](https://download.visualstudio.microsoft.com/download/pr/e7ffa30b-43a5-4afc-bf2a-2e3656a842e4/60b26131ac7b8c59f734a1e0c32cc9dc/vs_community.exe)下载 Visual Studio 16 2019 并运行 `vs_community.exe`
66+
2.**工作负载** 选项卡下,勾选 **使用 C++ 的桌面开发**
67+
- 注意:在安装详细信息 > 使用 C++ 的桌面开发 > 可选 中:**Live Share****Intellicode** 不是必需的,可以取消勾选。
68+
3. 点击 **安装**
4769

48-
### 打开VS命令行工具
70+
### 2.2 打开 Visual Studio 命令提示符
4971

50-
系统菜单中,找到**x64 Native Tools Command Prompt for VS 2019**打开
72+
在系统菜单中,找到 **x64 Native Tools Command Prompt for VS 2019** 并打开。
5173

52-
### 安装Protobuf
74+
### 2.3 安装 Protobuf
5375

54-
注意下面cmake命令中`-DCMAKE_INSTALL_PREFIX`指定为你实际设定的路径
76+
注意下面cmake命令中`-DCMAKE_INSTALL_PREFIX`指定为你实际设定的路径
5577

5678
```bash
5779
git clone https://github.com/protocolbuffers/protobuf.git
@@ -62,11 +84,11 @@ mkdir build
6284
cd build
6385
cmake -G "Visual Studio 16 2019" -DCMAKE_INSTALL_PREFIX=%CD%\protobuf_install -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -Dprotobuf_BUILD_SHARED_LIBS=OFF -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF ..
6486
cmake --build . --config Release --target install
65-
# 设置环境变量
87+
# 将库设置到环境变量
6688
set PATH=%CD%\protobuf_install\bin;%PATH%
6789
```
6890

69-
### 安装Paddle2ONNX
91+
### 2.4 安装 Paddle2ONNX
7092

7193
```bash
7294
git clone https://github.com/PaddlePaddle/Paddle2ONNX.git

docs/zh/op_list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ All supported PaddlePaddle operators are listed as below,
6161
- hard_shrink
6262
- hard_sigmoid
6363
- hard_swish
64+
- index_put
65+
- index_select
6466
- layer_norm
6567
- leaky_relu
6668
- less_equal
@@ -110,6 +112,7 @@ All supported PaddlePaddle operators are listed as below,
110112
- round
111113
- rsqrt
112114
- scale
115+
- scatter
113116
- selu
114117
- set_value
115118
- shape

0 commit comments

Comments
 (0)