-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Refactor the generation process of _swig_paddle.so #1083
Comments
4 tasks
@gangliao 问题不在于build出来那个so,而在于打包成wheel包。 我之前看wheel包似乎只能通过setup.py打包。不太清楚怎么把已经编译好的shared library加到setup.py里面。 |
setup(
...
package_data=[`_swig_paddle.so`]
) |
Closed
we already merge this feature into PaddlePaddle. So I closed this PR. |
wangxicoding
pushed a commit
to wangxicoding/Paddle
that referenced
this issue
Dec 9, 2021
Update comments of text classificaiton
lizexu123
pushed a commit
to lizexu123/Paddle
that referenced
this issue
Feb 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
来源:https://cmake.org/cmake/help/v3.2/module/UseSWIG.html
当前Paddle与swig的编译过程时写在paddle/api/paddle_ld_flags.py, setup.py.in 和 paddle/api/paddle_api_config.py.in里面,跨平台效果并不好,非常不方便进行维护。
具体做法:去掉paddle_api_config.py.in和paddle_ld_flags.py, 简化setup.py。
简单的说,完成这个过程我们只需要在CMake里面调两个函数就行了:
SWIG_ADD_MODULE(example python example.i example.cxx) SWIG_LINK_LIBRARIES(example ${PYTHON_LIBRARIES})
官方的说法:
The above example will generate native build files such as makefiles, nmake files and Visual Studio projects which will invoke SWIG and compile the generated C++ files into _example.so (UNIX) or _example.pyd (Windows). For other target languages on Windows a dll, instead of a .pyd file, is usually generated.
The text was updated successfully, but these errors were encountered: