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

Port boost::python functionality over to pybind11 #283

Closed
wants to merge 9 commits into from

Conversation

mjcarroll
Copy link
Contributor

@mjcarroll mjcarroll commented Jul 10, 2019

This should potentially alleviate some of our porting headaches to other platforms.

Addresses #281

@mjcarroll
Copy link
Contributor Author

mjcarroll commented Jul 10, 2019

And for giggles:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Signed-off-by: Michael Carroll <[email protected]>
@mjcarroll mjcarroll added the ros2 label Jul 10, 2019
Signed-off-by: Michael Carroll <[email protected]>
@mjcarroll
Copy link
Contributor Author

With correct library paths for tests:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

@mjcarroll
Copy link
Contributor Author

macOS fails because of using OpenCV 4.

Windows fails because no boost/endian header.

@maxtong9
Copy link

Hey, I am trying to compile your branch on Windows 10 and I am getting this error:
fatal error C1083: Cannot open include file: 'numpy/ndarrayobject.h': No such file or directory
Am I missing some dependency? I have numpy installed via pip.
Great work on everything you've done! Windows 10 support seems to be lacking still for ROS 2 packages.

@mjcarroll
Copy link
Contributor Author

I have to admit that I haven't sufficiently tested this on Windows. It may be that a numpy include path isn't getting picked up correctly on Windows? It would either be in the cmake logic here or in https://github.com/ros2/pybind11_vendor

@maxtong9
Copy link

Thank you for the quick response! I located where the header should be. I'm going to try and find a way to link it now!

@mjcarroll
Copy link
Contributor Author

Rebuild macOS with OpenCV4 fix: Build Status

@jnoyola
Copy link
Contributor

jnoyola commented Sep 6, 2019

Just noticed you ran into the same issue as me on Windows (#289). Would you happen to know why this isn't an issue on the other OS's? Because the Boost include was removed altogether.

@jnoyola
Copy link
Contributor

jnoyola commented Sep 30, 2019

Is removing the version from OpenCV's find_package the only change needed to support OpenCV 4? Can we pull that into a separate PR to get it in faster?

@klintan
Copy link

klintan commented Oct 12, 2019

Just noticed you ran into the same issue as me on Windows (#289). Would you happen to know why this isn't an issue on the other OS's? Because the Boost include was removed altogether.

I'm on Mac Mojave, and I got that exact issue as well for this branch
vision_opencv/cv_bridge/src/ndarray_converter.cpp:24:10: fatal error: 'numpy/ndarrayobject.h' file not found

I think except for that (if that is an issue here somewhere, it would be awesome to get this PR in to vision_opencv, support for opencv4 etc etc.

edit: fixing it for mac is fairly straightforward, just create a symlink for the numpy include headers to the user/local/include/ folder.

sudo ln -s /usr/local/Cellar/numpy/1.17.1/lib/python3.7/site-packages/numpy/core/include/numpy /usr/local/include/numpy

I'm not sure this is an issue in the CMakeLists file though ?
Tried to update the cmakelists like here ros2/rosidl_python#66 to no avail.

edit2:

After building it seems the library is missing, might just be me again, but I had to add

install(TARGETS ${PROJECT_NAME}
        RUNTIME DESTINATION bin
        ARCHIVE DESTINATION lib
        LIBRARY DESTINATION lib
)

To the cv_bridge cmakelists.txt file to actually export the library (it seems only the py-bindings get exported)

@ijnek
Copy link
Member

ijnek commented Sep 4, 2022

@mjcarroll Considering this PR has been untouched for almost 3 years, I'm thinking of closing it out, but keeping the issue open.

Are you fine with this?

@mjcarroll
Copy link
Contributor Author

Yep. Still would be nice to do, but it's been on the backburner for long enough that this is no longer relevant.

@mjcarroll mjcarroll closed this Sep 6, 2022
@mjcarroll mjcarroll deleted the port_pybind11 branch September 6, 2022 15:16
@ijnek
Copy link
Member

ijnek commented Sep 6, 2022

Thanks @mjcaroll

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

Successfully merging this pull request may close these issues.

5 participants