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

Enable the compilation of pybind11 bindings in CI when conda is used #937

Merged
merged 5 commits into from
Nov 11, 2021

Conversation

GiulioRomualdi
Copy link
Member

The first step towards #782

This depends on #936

@traversaro
Copy link
Member

Wow, you beat me by three minutes (see #938). Can you also enable the SWIG bindings while you are at it? It should be just necessary to also install swig, and pass -DIDYNTREE_USES_PYTHON:BOOL=ON to the configure step.

@traversaro
Copy link
Member

Also here the same problem of #867 appears, probably it is a problem of modern pybind11, not related to pip.

@traversaro
Copy link
Member

Indeed, SYSTEM is not a documented option of pybind11_add_module in latest pybind11, see https://pybind11.readthedocs.io/en/stable/compiling.html#pybind11-add-module, probably we can just remove it?

@traversaro
Copy link
Member

traversaro commented Nov 8, 2021

Indeed, SYSTEM was a completly documented and legal option in pybind11 2.4.3 (the version used in Ubuntu 20.04), see https://github.com/pybind/pybind11/blob/v2.4.3/docs/compiling.rst#pybind11_add_module . Perhaps we are witnessing a rare example of romanata in the wild? @francesco-romano

@traversaro
Copy link
Member

traversaro commented Nov 8, 2021

Perhaps we are witnessing a rare example of romanata in the wild? @francesco-romano

After thinking about it during dinner, I think it is not a romanata. A romanata is the use of a not strictly necessary (but fully documented and supported) feature that leads to a bug or problem due to some corner case behaviour. In this case, the SYSTEM keyword was deliberatly removed upstream in pybind11, so it is not a corner case behaviour. Furthermore, I guess SYSTEM was added to remove some warning due to pybind11, so probably it was not even not necessary.

@traversaro
Copy link
Member

Indeed, SYSTEM is not a documented option of pybind11_add_module in latest pybind11, see https://pybind11.readthedocs.io/en/stable/compiling.html#pybind11-add-module, probably we can just remove it?

Even if it is not documented, SYSTEM is a parsed option (see https://github.com/pybind/pybind11/blob/v2.8.1/tools/pybind11Tools.cmake#L148) so even if we use it it should not result in that error. However, according to pybind/pybind11#2338 :

CMake treats all IMPORTED targets as SYSTEM, so this was/is always on when using configuration mode.

So in any case (even with pybind11 2.4.3) it should not be necessary to use SYSTEM, so we can safely remove it.

@traversaro
Copy link
Member

traversaro commented Nov 8, 2021

A little bit of magic is still necessary for multi config generators, I can look into it.

@traversaro
Copy link
Member

A little bit of magic is still necessary for multi config generators, I can look into it.

The issue is a bit more complicated than I expected, for now I disabled the Python/pybind tests on Windows and I opened an issue #939 to keep track of this.

@GiulioRomualdi
Copy link
Member Author

Since #936 has been merged I think we should rebase the PR on devel

@traversaro
Copy link
Member

Since #936 has been merged I think we should rebase the PR on devel

Ack, I can do that.

@traversaro
Copy link
Member

Done!

@GiulioRomualdi
Copy link
Member Author

feel free to merge it :)

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

Successfully merging this pull request may close these issues.

2 participants