Skip to content

Commit 685d061

Browse files
authored
fix: update macOS compilation docs for Apple Silicon compatibility (#7445)
- Add Apple Silicon warnings for Docker compilation limitations - Add -DWITH_ARM=ON flag to cmake commands for ARM64 compilation - Clarify Docker generates x86_64 packages that cannot be installed on Apple Silicon - Update both make and ninja compilation methods - Update both Chinese and English documentation versions
1 parent 7a29904 commit 685d061

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

docs/install/compile/macos-compile-make.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
* **macOS 版本 10.x/11.x/12.x/13.x/14.x/15.x (64 bit) (不支持 GPU 版本)**
66
* **Python 版本 3.9/3.10/3.11/3.12/3.13 (64 bit)**
7+
* **注意:Docker 编译方式仅支持 x86_64 架构,生成的 x86_64 whl 包无法在 Apple Silicon (M系列芯片) Mac 上安装**
78

89
## 选择 CPU/GPU
910

1011
* 目前仅支持在 macOS 环境下编译安装 CPU 版本的 PaddlePaddle
1112

1213
## 安装步骤
13-
在 macOS 系统下有 2 种编译方式,推荐使用 Docker 编译。
14-
Docker 环境中已预装好编译 Paddle 需要的各种依赖,相较本机编译环境更简单。
14+
在 macOS 系统下有 2 种编译方式:
1515

16-
* [Docker 源码编译](#compile_from_docker)
17-
* [本机源码编译](#compile_from_host)
16+
* [Docker 源码编译](#compile_from_docker) - 仅适用于 Intel Mac (x86_64)
17+
* [本机源码编译](#compile_from_host) - 推荐用于 Apple Silicon Mac (ARM64)
18+
19+
**注意:** Docker 编译方式仅支持 x86_64 架构,生成的 x86_64 whl 包无法在 Apple Silicon (M系列芯片) Mac 上安装。如果您使用的是 Apple Silicon Mac,请使用本机编译方式。
1820

1921
<a name="mac_docker"></a>
2022
### <span id="compile_from_docker">**使用 Docker 编译**</span>
@@ -149,6 +151,8 @@ pip3.10 install -U [whl 包的名字]
149151
150152
**请严格按照以下指令顺序执行**
151153
154+
**重要提示:** 如果您使用的是 Apple Silicon (M系列芯片) Mac,请确保使用本机编译方式,并在 cmake 命令中添加 `-DWITH_ARM=ON` 参数。
155+
152156
#### 1. 检查您的计算机和操作系统是否符合我们支持的编译标准:
153157
```
154158
uname -m
@@ -258,7 +262,7 @@ pip3.10 install -r /paddle/python/requirements.txt
258262
259263
```
260264
cmake .. -DPY_VERSION=3.10 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
261-
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
265+
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF -DWITH_ARM=ON
262266
```
263267
264268
>`-DPY_VERSION=3.10`请修改为安装环境的 Python 版本

docs/install/compile/macos-compile-make_en.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
* **macOS version 10.x/11.x/12.x/13.x/14.x/15.x (64 bit) (not support GPU version)**
66
* **Python version 3.9/3.10/3.11/3.12/3.13 (64 bit)**
7+
* **Note: Docker compilation only supports x86_64 architecture, generated x86_64 whl packages cannot be installed on Apple Silicon (M-series chip) Macs**
78

89
## Choose CPU/GPU
910

1011
* Currently, only PaddlePaddle for CPU is supported.
1112

1213
## Installation steps
13-
There are two compilation methods in macOS system. It's recommended to use Docker to compile.
14-
The dependencies required for compiling Paddle are pre-installed in the Docker environment, which is simpler than the native compiling environment.
14+
There are two compilation methods in macOS system:
1515

16-
* [Compile with Docker](#compile_from_docker)
17-
* [Local compilation](#compile_from_host)
16+
* [Compile with Docker](#compile_from_docker) - Only for Intel Mac (x86_64)
17+
* [Local compilation](#compile_from_host) - Recommended for Apple Silicon Mac (ARM64)
18+
19+
**Note:** Docker compilation only supports x86_64 architecture, generated x86_64 whl packages cannot be installed on Apple Silicon (M-series chip) Macs. If you are using an Apple Silicon Mac, please use local compilation.
1820

1921
<a name="mac_docker"></a>
2022
### <span id="compile_from_docker">**Compile with Docker**</span>
@@ -169,6 +171,8 @@ We used Python3.10 command as an example above, if the version of your Python is
169171
170172
**Please strictly follow the order of the following instructions**
171173
174+
**Important:** If you are using an Apple Silicon (M-series chip) Mac, please ensure you use local compilation and add the `-DWITH_ARM=ON` parameter to the cmake command.
175+
172176
#### 1. Check that your computer and operating system meet our supported compilation standards: `uname -m` and view the system version `about this Mac`. And install [OpenCV](https://opencv.org/releases.html) in advance.
173177
174178
#### 2. Install python and pip:
@@ -268,7 +272,7 @@ mkdir build && cd build
268272
269273
```
270274
cmake .. -DPY_VERSION=3.10 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
271-
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
275+
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF -DWITH_ARM=ON
272276
```
273277
274278
- ``-DPY_VERSION=3.10`` Please change to the Python version of the installation environment.

docs/install/compile/macos-compile-ninja.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44

55
* **macOS 版本 10.x/11.x/12.x/13.x/14.x/15.x (64 bit) (不支持 GPU 版本)**
66
* **Python 版本 3.9/3.10/3.11/3.12/3.13 (64 bit)**
7+
* **注意:Docker 编译方式仅支持 x86_64 架构,生成的 x86_64 whl 包无法在 Apple Silicon (M系列芯片) Mac 上安装**
78

89
## 选择 CPU/GPU
910

1011
* 目前仅支持在 macOS 环境下编译安装 CPU 版本的 PaddlePaddle
1112

1213
## 安装步骤
13-
在 macOS 系统下有 2 种编译方式,推荐使用 Docker 编译。
14-
Docker 环境中已预装好编译 Paddle 需要的各种依赖,相较本机编译环境更简单。
14+
在 macOS 系统下有 2 种编译方式:
1515

16-
* [Docker 源码编译](#compile_from_docker)
17-
* [本机源码编译](#compile_from_host)
16+
* [Docker 源码编译](#compile_from_docker) - 仅适用于 Intel Mac (x86_64)
17+
* [本机源码编译](#compile_from_host) - 推荐用于 Apple Silicon Mac (ARM64)
18+
19+
**注意:** Docker 编译方式仅支持 x86_64 架构,生成的 x86_64 whl 包无法在 Apple Silicon (M系列芯片) Mac 上安装。如果您使用的是 Apple Silicon Mac,请使用本机编译方式。
1820

1921
<a name="mac_docker"></a>
2022
### <span id="compile_from_docker">**使用 Docker 编译**</span>
@@ -112,6 +114,8 @@ pip3.10 install -U [whl 包的名字]
112114
<br/><br/>
113115
### <span id="compile_from_host">**本机编译**</span>
114116
**请严格按照以下指令顺序执行**
117+
118+
**重要提示:** 如果您使用的是 Apple Silicon (M系列芯片) Mac,请确保使用本机编译方式,并在 cmake 命令中添加 `-DWITH_ARM=ON` 参数。
115119
#### 1. 检查您的计算机和操作系统是否符合我们支持的编译标准:
116120
```
117121
uname -m
@@ -190,7 +194,7 @@ pip3.10 install -r /paddle/python/requirements.txt
190194
* 对于需要编译**CPU 版本 PaddlePaddle**的用户:
191195
```
192196
cmake .. -GNinja -DPY_VERSION=3.10 -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
193-
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF
197+
-DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DWITH_GPU=OFF -DWITH_ARM=ON
194198
```
195199
>`-DPY_VERSION=3.10`请修改为安装环境的 Python 版本
196200
#### 10. 使用以下命令来编译:

0 commit comments

Comments
 (0)