swri-robotics / mapviz

Modular ROS visualization tool for 2D data.
BSD 3-Clause "New" or "Revised" License
387 stars 146 forks source link

(Mapviz doesn't build on ARM64) Glew error __glewVertexBindingDivisor #660

Open waddellt15 opened 4 years ago

waddellt15 commented 4 years ago

I get this error when trying catkin_make, not sure what the root of it is.

In file included from /home/badgerboat/catkin_ws/src/mapviz/mapviz/src/map_canvas.cpp:31:0: /usr/include/GL/glew.h:17830:46: note: previous declaration ‘void (* glewVertexAttribBinding)(GLuint, GLuint)’ GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC glewVertexAttribBinding; ^~~~~~~~~ In file included from /usr/include/aarch64-linux-gnu/qt5/QtGui/qopengl.h:105:0, from /usr/include/aarch64-linux-gnu/qt5/QtOpenGL/qgl.h:45, from /usr/include/aarch64-linux-gnu/qt5/QtOpenGL/QGLWidget:1, from /home/badgerboat/catkin_ws/src/mapviz/mapviz/include/mapviz/map_canvas.h:42, from /home/badgerboat/catkin_ws/src/mapviz/mapviz/src/map_canvas.cpp:35: /usr/include/GLES3/gl31.h:1520:88: error: ‘void __glewVertexBindingDivisor(GLuint, GLuint)’ redeclared as different kind of symbol void GL_APIENTRY glVertexBindingDivisor (GLuint bindingindex, GLuint divisor);

pjreed commented 4 years ago

From your include paths, I'm guessing you're building on an ARM64 architecture? Unfortunately, mapviz doesn't currently build on ARM64; also see the build job on the official build farm: http://build.ros.org/job/Mbin_ubv8_uBv8__mapviz__ubuntu_bionic_arm64__binary/

I believe it's due to QtOpenGL using OpenGL APIs that aren't supported on the platform, but I don't have access to a platform I can test it on. If there is anybody out there who could get it working, it would be greatly appreciated.

danthony06 commented 4 years ago

I've got an Odroid and RPi at home that I can try it out on. It would be helpful to know which exact platform you're using, and whether you're building the entire ROS stack from source from it, or installing it using debs.

waddellt15 commented 4 years ago

I am using a Jetson Nano with their unique ubuntu 16.0.4 kernel if that helps? Let me know if there is anything I can to do help. I am also building from the source

danthony06 commented 4 years ago

Okay, we've got one of those. I'll try to find some time to work on it.

danthony06 commented 4 years ago

Sorry for the delayed response, I tried getting ROS going on my Pi this weekend and had some issues that I'm working through. I haven't forgotten about this problem.

On Tue, Nov 26, 2019 at 11:58 AM Taylor Waddell notifications@github.com wrote:

I am using a Jetson Nano with their unique ubuntu 16.0.4 kernel if that helps? Let me know if there is anything I can to do help

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/swri-robotics/mapviz/issues/660?email_source=notifications&email_token=ABBZWHEAMKQWG6RJA6CCKYTQVVPVTA5CNFSM4JRTOCZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFG5ESQ#issuecomment-558748234, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBZWHDXFSYQV5GXATP4XFTQVVPVTANCNFSM4JRTOCZA .

waddellt15 commented 4 years ago

Awesome thank you!

danthony06 commented 4 years ago

build_log.txt

For reference, here is the compete output when the build fails on my Odroid running 18.04 and ROS Melodic.

danthony06 commented 4 years ago

@pjreed I think the only reasonable solution to this is to remove GLEW and use Qt's OpenGL support instead. It's likely to be a substantial change, and maybe we want to open up an issue specific to that instead.

matt-attack commented 4 years ago

Theoretically it should just be changing some include file names. It seems that the Qt one is already being included somehow, so it could just be deleting the GLEW includes.

matt-attack commented 4 years ago

So, deleting the includes mostly works in that spot. Though, we are apparently using an OpenGL extension so we might have to manually import those functions or find them in the mess that is Qt's approach of importing OpenGL https://www.kdab.com/opengl-in-qt-5-1-part-1/

matt-attack commented 4 years ago

After poking around, it seems this extension isn't needed on OpenGL >= 2.1. So we could just do a version check and use the normal functions.

https://stackoverflow.com/questions/23020292/does-qtquick-2-support-glbindbuffer Also seems relevant.


After testing this resolves most of the issue, but not the gl(Un)MapBuffer calls. Those functions aren't in the default OpenGL functions Qt binds.

As a quick way out we could always disable this functionality on these platforms, which seems to only be used to (theoretically) accelerate screenshot taking anyways.

matt-attack commented 4 years ago

@danthony06 you could try this branch https://github.com/matt-attack/mapviz/tree/remove-extension-test

It needs cleaning up, but doesn't seem to break anything (other than the extensions which are just disabled atm) and avoids the double declaration issue. Was only able to try it on WSL Ubuntu on my laptop so someone would need to try it on a Pi

danthony06 commented 4 years ago

Trying the build now. I'm not sure what the best way to test everything is, other than to see if it runs. I don't have many bag files at home that would be useful for testing this on, but I can bring in my Odroid tomorrow.

On Sun, Jan 19, 2020 at 9:15 PM Matthew notifications@github.com wrote:

@danthony06 https://github.com/danthony06 you could try this branch https://github.com/matt-attack/mapviz/tree/remove-extension-test

It needs cleaning up, but doesn't seem to break anything (other than the extensions which are just disabled atm) and avoids the double declaration issue. Was only able to try it on WSL Ubuntu on my laptop so someone would need to try it on a Pi

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/swri-robotics/mapviz/issues/660?email_source=notifications&email_token=ABBZWHCVRAURO7JFYWZOJGTQ6UJO3A5CNFSM4JRTOCZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJLG33A#issuecomment-576089580, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBZWHA4F6G7LDGCJYYYUWLQ6UJO3ANCNFSM4JRTOCZA .

danthony06 commented 4 years ago

Never mind, it's failing to build. Attaching the build output. build_fail.txt

danthony06 commented 4 years ago

I started including GL/gl.h, and it's fixing some build errors, but it looks like all of the plugins will need a corresponding change to at least build.

danthony06 commented 4 years ago

@matt-attack I forked your repo into my account and added various includes. I'm still getting the following build errors, but I'll try to look at it again later. It looks like we're not linking against the correct OpenGL libs now.

/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_widget.so: undefined reference to `glLoadIdentity'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_image.so: undefined reference to `glVertex2f'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_image.so: undefined reference to `glEnd'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_image.so: undefined reference to `glBegin'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_widget.so: undefined reference to `glMatrixMode'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_widget.so: undefined reference to `glOrtho'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_image.so: undefined reference to `glTexCoord2f'
/home/danthony/src/mapviz/devel/.private/multires_image/lib/libmultires_widget.so: undefined reference to `glColor4f'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/danthony/src/mapviz/devel/.private/multires_image/lib/multires_image/multires_view_node] Error 1
make[1]: *** [CMakeFiles/multires_view_node.dir/all] Error 2
make: *** [all] Error 2
danthony06 commented 4 years ago

Okay, it's building now. @pjreed @matt-attack what do you think of these changes? https://github.com/danthony06/mapviz

JeremieBourque1 commented 4 years ago

@danthony06 Is there any way this can work with melodic as well?

danthony06 commented 4 years ago

We're working on getting in running on both Kinetic and Melodic at the present. I don't want to promise anything, but I think we'll get it fixed.

On Wed, Jan 22, 2020 at 8:45 PM Jérémie Bourque notifications@github.com wrote:

@danthony06 https://github.com/danthony06 Is there any way this can work with melodic as well?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/swri-robotics/mapviz/issues/660?email_source=notifications&email_token=ABBZWHDWBWMVLPPINUFYHODQ7EAGDA5CNFSM4JRTOCZKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJV2KSQ#issuecomment-577480010, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBZWHHW7C53FPLY533NEMDQ7EAGDANCNFSM4JRTOCZA .