如何在我的情况下生成Python Swig包装器而不需要任何源文件?

huangapple go评论78阅读模式
英文:

How python swig wrappers were generated without any source files in my case?

问题

I was researching using C++ in Python with SWIG. I came across this repo. I installed as recommended with python -m pip install tesseract-robotics. I expected it to download C++ source code, generate .cpp files from .i files and only then build .dlls. But, it seems it only installed _packageX.pyd, packageX.py and corresponding .dll file for each package.

How this even possible? Doesn't SWIG need the .i and C++ source files to generate the code to build for a specific platform? Or, was all this built somewhere on the cloud (maybe even in https://pypi.org/) and pip install did not actually build anything, but just downloaded pre-built platform-specific .dll and .py files?

如何在我的情况下生成Python Swig包装器而不需要任何源文件?

英文:

I was researching using C++ in Python with SWIG. I came across this repo. I installed as recommended with python -m pip install tesseract-robotics. I expected it to download C++ source code, generate .cpp files from .i files and only then build .dlls. But, it seems it only installed _packageX.pyd, packageX.py and corresponding .dll file for each package.

How this even possible? Doen't SWIG needs the .i and C++ source files to generate the code to build for specific platform? Or, was all this built somewhere on the cloud (maybe even in https://pypi.org/) and pip install did not actually build anything, but just downloaded pre-built platfrom specific .dll and .py files?

如何在我的情况下生成Python Swig包装器而不需要任何源文件?

答案1

得分: 0

根据user17732522的评论提到,tesseract-robotics的本地组件已编译并打包成Python轮子。这些预编译的轮子适用于Windows和最新的Linux x64版本,适用于Python 3.7及更高版本。为此包编译所有内容非常复杂,不应该期望用户能够完成。

如果您有兴趣查看其工作方式,可以在以下GitHub工作流程中找到进行编译的详细信息:https://github.com/tesseract-robotics/tesseract_python/blob/master/.github/workflows/wheels.yml

英文:

As mentioned in user17732522's comment, the tesseract-robotics native components are compiled and packed into Python wheels. These precompiled wheels are available for Windows and recent Linux x64 releases, for Python 3.7 and greater. Compiling everything for this package is extremely complicated, and is not something a user can be expected to accomplish.

The GitHub workflow that does the compilation can be found here if you are interested in seeing how it works: https://github.com/tesseract-robotics/tesseract_python/blob/master/.github/workflows/wheels.yml

huangapple
  • 本文由 发表于 2023年7月18日 05:51:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76708297.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定