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

How I can compile g2o for Wayland (no X11) #573

Closed
pddl opened this issue Feb 20, 2022 · 4 comments
Closed

How I can compile g2o for Wayland (no X11) #573

pddl opened this issue Feb 20, 2022 · 4 comments

Comments

@pddl
Copy link

pddl commented Feb 20, 2022

How to can compile g2o on Linux for Wayland i.e. NOX (no X11)?
Have tried some patching. It looks like too many thing in g2o rely on X11.
Appreciate if you could send a recipe for conda build for g2o for Wayland/Linux.

@RainerKuemmerle
Copy link
Owner

I have not tried this myself. Where does it fail? Can you please give an example?

@pddl
Copy link
Author

pddl commented Feb 23, 2022

Here is cmake options:
cmake ${CMAKE_ARGS}
[...]
-DG2O_USE_OPENGL:BOOL=TRUE
-DOPENGL_USE_EGL=ON
..

The issue is with OPENGL_gl_LIBRARY which does not exist.
find . -type f -exec grep -niH -e OPENGL_gl_LIBRARY {} ;
./g2o/types/slam2d_addons/CMakeLists.txt:21: target_link_libraries(types_slam2d_addons ${OPENGL_gl_LIBRARY})
./g2o/types/slam3d_addons/CMakeLists.txt:26: target_link_libraries(types_slam3d_addons ${OPENGL_gl_LIBRARY} )
./g2o/types/slam3d/CMakeLists.txt:49: target_link_libraries(types_slam3d opengl_helper ${OPENGL_gl_LIBRARY} )
./g2o/types/sclam2d/CMakeLists.txt:16: target_link_libraries(types_sclam2d ${OPENGL_gl_LIBRARY})
./g2o/types/slam2d/CMakeLists.txt:26: target_link_libraries(types_slam2d opengl_helper ${OPENGL_gl_LIBRARY} )
./g2o/examples/slam2d/CMakeLists.txt:42: ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}

Fixed by applying patches like this:

--- g2o/types/sclam2d/CMakeLists.txt	2022-02-21 10:25:57.048311896 +0300
+++ g2o/types/sclam2d/CMakeLists.txt-new	2022-02-21 10:26:37.764747755 +0300
@@ -12,9 +12,9 @@
-if(G2O_HAVE_OPENGL)
-  target_link_libraries(types_sclam2d ${OPENGL_gl_LIBRARY})
-endif()
+#if(G2O_HAVE_OPENGL)
+#  target_link_libraries(types_sclam2d ${OPENGL_gl_LIBRARY})
+#endif()

@RainerKuemmerle
Copy link
Owner

Is there more? I created a commit where we do not use that variable.

@pddl
Copy link
Author

pddl commented Feb 24, 2022

Hi Rainer! 99% sure I have in-correct implementations of glvnd and mesa. Sorry and looks like your code is correct and no need to disable OPENGL_gl_LIBRARY. Once I've got g2o working in Waylanld, I'll let you know. Please close this issue.

@pddl pddl closed this as completed Feb 24, 2022
RainerKuemmerle added a commit that referenced this issue Feb 26, 2022
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

No branches or pull requests

2 participants