Skip to content
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

macOS (M1) 编译 develop 分支失败 #43766

Closed
SigureMo opened this issue Jun 22, 2022 · 6 comments
Closed

macOS (M1) 编译 develop 分支失败 #43766

SigureMo opened this issue Jun 22, 2022 · 6 comments
Assignees
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/new-issue 新建 type/bug-report 报bug

Comments

@SigureMo
Copy link
Member

SigureMo commented Jun 22, 2022

问题描述 Issue Description

M1 设备编译 develop 分支( 4c9330d )失败,失败时 log 如下:

image

完整 log 见 cmake.logmake.log

编译 release/2.3( 1aafc31 ) 分支是没有任何问题的,编译后可以成功 install 并 import

以上问题稳定复现 3 次及以上(develop 分支编译失败且 release/2.3 分支编译成功的问题)

我的环境如下:

  • Device: MacBook Pro (13-inch, M1, 2020)
  • Clang: 13.1.6 (clang-1316.0.21.2.5)
  • Operator System: macOS 12.4
  • Python: 3.9.12 (通过 Homebrew(ARM 的,非 X86 的)安装的 miniforge 创建的 Python3.9 环境)

编译命令如下(编译 release/2.3 和编译 develop 都使用了这些命令),主要参考编译文档本机编译部分,部分参考的是 #42402

PYTHON_BASE=/opt/homebrew/Caskroom/miniforge/base/envs/paddle/
PYTHON_LIB_PATH=${PYTHON_BASE}lib/libpython3.9.dylib
PYTHON_INCLUDE_PATH=${PYTHON_BASE}include/python3.9/
PYTHON_BIN_PATH=${PYTHON_BASE}bin/
PYTHON_LD_PATH=${PYTHON_BASE}
export PYTHON_LIBRARY=$PYTHON_LIB_PATH
export PYTHON_INCLUDE_DIRS=$PYTHON_INCLUDE_PATH
export PATH=${PYTHON_BIN_PATH}:$PATH
export LD_LIBRARY_PATH=$PYTHON_LD_PATH
export DYLD_LIBRARY_PATH=$PYTHON_LD_PATH

mkdir build && cd build

cmake .. \
    -DPY_VERSION=3.9 \
    -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIRS} \
    -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
    -DWITH_GPU=OFF \
    -DWITH_TESTING=OFF \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_ARM=ON \
    -DWITH_AVX=OFF > cmake.log 2>&1

make TARGET=ARMV8 -j8 > make.log 2>&1

版本&环境信息 Version & Environment Information

****************************************
Paddle version: 2.3.0          <---- 这个是通过 PyPI 安装的……
Paddle With CUDA: False

OS: macOS 12.4
Python version: 3.9.12

CUDA version: None
cuDNN version: None.None.None
Nvidia driver version: None
****************************************

其他补充信息 Additional Supplementary Information

由于需求是想要尝试参与算子相关开发,因此尝试编译 develop 分支,当然从 PyPI 下载的我是可以用的,但那并不能解决我的需求

@paddle-bot-old
Copy link

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看官网API文档常见问题历史IssueAI社区来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

@SigureMo
Copy link
Member Author

抱歉,才发现提错类别的 issue 了,应当是 🗂 安装 Build/Installation Issue 类别,我补充了下模板里的运行 summary_env.py 的结果(不过对于本 issue 貌似并没啥有价值的内容)

@SigureMo SigureMo changed the title M1 MacBook 无法编译 develop 分支 M1 MacBook 编译 develop 分支失败 Jun 23, 2022
@SigureMo
Copy link
Member Author

#43834 merge 后又试了下 a8113a6,直接用修改后的脚本 sh paddle/scripts/paddle_build.sh mac_m1_arm,结果依然是一样的报错诶……

@SigureMo SigureMo changed the title M1 MacBook 编译 develop 分支失败 macOS (M1) 编译 develop 分支失败 Jun 30, 2022
@SigureMo
Copy link
Member Author

SigureMo commented Aug 12, 2022

经测试,#42325 可解决本问题,期待 merge

本 issue 先 close 了

@luotao1 luotao1 added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Aug 15, 2022
@jzhang533
Copy link
Contributor

https://github.com/jzhang533/Paddle/blob/instructions-on-build-paddle-on-mac-m1/tools/instructions_build_paddle_on_mac.sh

我弄了个小脚本,可以帮忙搭建mac m1下的编译环境。

@SigureMo
Copy link
Member Author

SigureMo commented Aug 16, 2022

https://github.com/jzhang533/Paddle/blob/instructions-on-build-paddle-on-mac-m1/tools/instructions_build_paddle_on_mac.sh

我弄了个小脚本,可以帮忙搭建mac m1下的编译环境。

感谢,我测试了下按照指引使用输出后的命令可以编译成功

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/new-issue 新建 type/bug-report 报bug
Projects
None yet
Development

No branches or pull requests

4 participants