Skip to content

Always link PYTHON_LIBRARIES to eager_generator #72333

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

Closed

Conversation

LittleHeroZZZX
Copy link
Contributor

@LittleHeroZZZX LittleHeroZZZX commented Apr 17, 2025

PR Category

User Experience

PR Types

Improvements

Description

在链接 eager_generator 时总是报错,已在多台设备上复现:

/usr/bin/ld: paddle/fluid/operators/libpy_func_op.a(py_func_op.cc.o): in function `pybind11::cast_error::set_error() const':
/work/PaddleCustomDevice/Paddle/build/third_party/pybind/src/extern_pybind/include/pybind11/detail/common.h:1040: undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: /work/PaddleCustomDevice/Paddle/build/third_party/pybind/src/extern_pybind/include/pybind11/detail/common.h:1040: undefined reference to `PyExc_RuntimeError'
/usr/bin/ld: /work/PaddleCustomDevice/Paddle/build/third_party/pybind/src/extern_pybind/include/pybind11/detail/common.h:1040: undefined reference to `PyErr_SetString'
/usr/bin/ld: paddle/fluid/operators/libpy_func_op.a(py_func_op.cc.o): in function `pybind11::pybind11_fail(char const*)':
/work/PaddleCustomDevice/Paddle/build/third_party/pybind/src/extern_pybind/include/pybind11/detail/common.h:1046: undefined reference to `PyErr_Occurred'
/usr/bin/ld: paddle/fluid/operators/libpy_func_op.a(py_func_op.cc.o): in function `pybind11::pybind11_fail(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':

使用的配置命令为:

cmake .. -GNinja -DPY_VERSION=3.10 -DWITH_GPU=OFF -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1

排查是 eager_generator 仅在启用 CINN 时才链接到 PYTHON 库

Copy link

paddle-bot bot commented Apr 17, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 17, 2025
@LittleHeroZZZX
Copy link
Contributor Author

/re-run sot

@co63oc
Copy link
Contributor

co63oc commented Apr 17, 2025

paddle/fluid/operators/CMakeLists.txt
image
启用WITH_PYTHON时,py_func_op 链接 python pybind

@LittleHeroZZZX
Copy link
Contributor Author

paddle/fluid/operators/CMakeLists.txt image 启用WITH_PYTHON时,py_func_op 链接 python pybind

我检查了一下 CMakeCache,WITH_PYTHON 是打开的

@co63oc
Copy link
Contributor

co63oc commented Apr 18, 2025

paddle/fluid/operators/CMakeLists.txt image 启用WITH_PYTHON时,py_func_op 链接 python pybind

我检查了一下 CMakeCache,WITH_PYTHON 是打开的

那这里的依赖是有什么不一样
target_link_libraries(eager_generator ${PYTHON_LIBRARIES})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants