-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Reconsider the use of SWIG #4486
Comments
If we use Boost for anything else, we should use Boost::Python without hesitation. The two options above are very, very similar otherwise, so I have no real preference. We have the long-standing Boost and MATLAB issues to consider, of course. |
The additional issue is whether you want the Matlab bindings to be identical to the Python bindings and how much work you want to do to make that happen. |
@mwoehlke-kitware is going to investigate this and post a proposal here for @david-german-tri, @rdeits, and others to review. Initial thoughts are that MATLAB bindings remaining SWIG are fine, and whether we use Boost::Python depends on whether MATLAB needs to be simultaneously enabled with the Python bindings, and to a lesser extent whether we bring in Boost for other reasons, e.g., OMPL. |
Bumping to high priority because it may be blocking #2482. From f2f discussion: We believe that |
@david-german-tri can you explain how it's blocking #2482? It's not obvious to me, since SWIG is unrelated to Pods. |
@jamiesnape's belief is that the remaining few lines of https://github.com/RobotLocomotion/drake/blob/master/cmake/pods.cmake, which fiddle with |
I see. But surely SWIG can be used just fine without pods, since that's widely done in practice. |
There are other issues. That is just the most pressing. |
@mwoehlke-kitware -- #4771 has a question about the roadmap here. I believe there is additional information and decisions made but not yet scribed to the issue. Could you post a write-up? |
We are going to use Boost::Python and the port will begin as soon as Director tests are up and running on CI, probably next week. |
TBH, I wish Shiboken wasn't so in flux at the moment; it's the only binding generator I can find that doesn't require duplicating the entire API you want to expose. On further investigation, between Boost::Python and pybind11, I'd actually rather use pybind11. The API is more modern and much less macro-heavy, the documentation seems easier to understand, how to integrate it into the build is much more obvious and better documented (Boost::Python basically says "use bjam or it will break"), and it just generally feels less brittle and better designed. |
We have to introduce Boost for #3413, so Boost::Python would be preferable than adding the additional dependency unless we really have to. |
TRI has Bazel build support for |
Linking to #1267. |
Problem Definition
Numerous oddities involving SWIG have cropped up:
Action Item
We should reconsider whether to continue using SWIG or switch to something else that is perhaps more target language specific. For example, for Python bindings, @jwnimmer-tri recommended Boost::Python and @jamiesnape recommended pybind11.
The text was updated successfully, but these errors were encountered: