strayrobots / 3d-annotation-tool

A graphical user interface to annotate point clouds and 3D data.
MIT License
76 stars 8 forks source link

Add glfw as submodule and link it statically #37

Closed kekeblom closed 2 years ago

kekeblom commented 2 years ago

Link glfw statically. Couldn't figure out how to link the system glfw statically, but managed to do it from source. I think the library that is installed by the libglfw-dev apt package is only the dynamically linked library and therefore it can't be linked statically. Baking it in like this seems to work.

This is the output of ldd studio after the changes:

linux-vdso.so.1 (0x00007ffdfed81000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f42dd61b000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f42dd5e7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f42dd5c4000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f42dd5be000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f42dd3dc000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f42dd28d000)
libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f42dd249000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f42dd22e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f42dd03c000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f42dd012000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f42dcf5a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f42ddd21000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f42dcf52000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f42dcf4a000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f42dcf30000)

Still need to test on mac if this builds and runs.

Also fixed a segfault on linux which is caused by glfw close being called before bgfx::shutdown.

kekeblom commented 2 years ago

Works on macOS too :+1: