How do I setup the native libraries with maven?

Started by doev, September 14, 2015, 08:38:44

Previous topic - Next topic

spasi

Thanks, I might have an idea for a fix, but will have to wait for a new build.

Quote from: doev on September 15, 2015, 09:50:23There are two new links:
lrwxrwxrwx 1 root root 13 Mär 11  2015 /usr/lib/x86_64-linux-gnu/libGL.so -> mesa/libGL.so
lrwxrwxrwx 1 root root 14 Mär 11  2015 /usr/lib/x86_64-linux-gnu/mesa/libGL.so -> libGL.so.1.2.0

Those shouldn't affect LWJGL, because we load libGL.so.1 (with the .1 postfix). In theory, if you remove those symlinks manually, LWJGL will still fail. Could you confirm please?

doev

- Example is working
- Install libgl1-mesa-dev
- Example fail
- mv /usr/lib/x86_64-linux-gnu/libGL.so /usr/lib/x86_64-linux-gnu/libGL.so_backup
- mv /usr/lib/x86_64-linux-gnu/mesa/libGL.so /usr/lib/x86_64-linux-gnu/mesa/libGL.so_backup
- Example is working

spasi

OK, that's weird and very helpful. Thanks for taking the time to test!

More info: LWJGL tries to load libGL.so.1 first, if that fails, it loads libGL.so. I can't check right now, but last time I did on an Ubuntu/Nvidia machine, libGL.so.1 was working fine and loaded the Nvidia implementation. Could you please search if libGL.so.1 is available anywhere? It must be, otherwise GLFW wouldn't work either (it tries libGL.so.1 only).

doev

/usr/lib/nvidia-346/libGL.so.1 -> libGL.so.346.82
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 -> libGL.so.1.2.0

spasi

So, there indeed is a mesa symlink for libGL.so.1. Not sure if this is fixable, but I'll let you know when a new build is up to test.


spasi

The new build is up (3.0.0b #27), could you try again please?

edit: If it fails again, please add "-Dorg.lwjgl.util.Debug=true" to the command line and post the output here.

spasi

Hey doev, did you have a chance to try it out?

Also, the latest build (3.0.0b #28) includes the SharedLibraryLoader and you don't have to call it explictly, the native libraries are extracted automatically (as long as the JAR that contains them is in the classpath).

huhlig

Ok, Be aware. DO NOT CALL the example SharedLibraryLoader.load() if you are using the nightly. It breaks everything.

doev

I don't know how to use a specific snapshot version. If I use "3.0.0b-SNAPSHOT" (think that is the latest) the example runs without libgl1-mesa-dev installed but not otherwise.

Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.system.Checks.checkPointer(Checks.java:80)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:278)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:230)
   at Lwjgl3Test.loop(Lwjgl3Test.java:113)
   at Lwjgl3Test.run(Lwjgl3Test.java:28)
   at Lwjgl3Test.main(Lwjgl3Test.java:135)

spasi

What's the output if you run it with -Dorg.lwjgl.util.Debug=true?

doev

Cause I actually don't know a better way, I started the test with:

java -Dorg.lwjgl.util.Debug=true -cp lwjgl3-tests-1.0-SNAPSHOT-jar-with-dependencies.jar Lwjgl3Test

Lwjgl3Test
[LWJGL] Version 3.0.0b | Linux | amd64
[LWJGL] Loaded library from org.lwjgl.librarypath: liblwjgl.so
Hello LWJGL 3.0.0b!
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loaded native library: /tmp/lwjgldoev/d0227e9/libjemalloc.so
[LWJGL] MemoryUtil allocator: JEmallocAllocator
[LWJGL] Loaded native library: /tmp/lwjgldoev/d0227e9/libglfw.so
[LWJGL] Loaded native library: /usr/lib/x86_64-linux-gnu/libGL.so
Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.system.Checks.checkPointer(Checks.java:80)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:278)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:230)
   at Lwjgl3Test.loop(Lwjgl3Test.java:113)
   at Lwjgl3Test.run(Lwjgl3Test.java:28)
   at Lwjgl3Test.main(Lwjgl3Test.java:135)


The output if libgl1-dev is not installed:

Lwjgl3Test
[LWJGL] Version 3.0.0b | Linux | amd64
[LWJGL] Loaded library from org.lwjgl.librarypath: liblwjgl.so
Hello LWJGL 3.0.0b!
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loaded native library: /tmp/lwjgldoev/d0227e9/libjemalloc.so
[LWJGL] MemoryUtil allocator: JEmallocAllocator
[LWJGL] Loaded native library: /tmp/lwjgldoev/d0227e9/libglfw.so
[LWJGL] Loaded native library: libGL.so.1
[LWJGL] Failed to locate address for GL function glNamedBufferPageCommitmentARB
[LWJGL] Failed to locate address for GL function glVertexWeighthNV
[LWJGL] Failed to locate address for GL function glVertexWeighthvNV

spasi

A new build is up (#33), could you try again please?

doev

Can I be sure that it is the new build if I have done a clean+build?



[LWJGL] Version 3.0.0b | Linux | amd64
[LWJGL] Loaded library from org.lwjgl.librarypath: liblwjgl.so
Hello LWJGL 3.0.0b!
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loaded native library: /tmp/lwjgldoev/d0227e9/libjemalloc.so
[LWJGL] MemoryUtil allocator: JEmallocAllocator
[LWJGL] Loaded native library: /tmp/lwjgldoev/d0227e9/libglfw.so
[LWJGL] Loaded native library: /usr/lib/x86_64-linux-gnu/libGL.so
Exception in thread "main" java.lang.NullPointerException
   at org.lwjgl.system.Checks.checkPointer(Checks.java:80)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:278)
   at org.lwjgl.opengl.GL.createCapabilities(GL.java:230)
   at Lwjgl3Test.loop(Lwjgl3Test.java:113)
   at Lwjgl3Test.run(Lwjgl3Test.java:28)
   at Lwjgl3Test.main(Lwjgl3Test.java:135)

spasi

Based on the output, this appears to not be the latest build. I'll try to include the build number in the version string in future builds.