Hello Guest

How do I setup the native libraries with maven?

  • 32 Replies
  • 8058 Views
*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #15 on: September 15, 2015, 10:01:05 »
Thanks, I might have an idea for a fix, but will have to wait for a new build.

There are two new links:
Code: [Select]
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?

*

Offline doev

  • *
  • 22
Re: How do I setup the native libraries with maven?
« Reply #16 on: September 15, 2015, 10:08:20 »
- 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
« Last Edit: September 15, 2015, 10:13:07 by doev »

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #17 on: September 15, 2015, 10:24:48 »
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).

*

Offline doev

  • *
  • 22
Re: How do I setup the native libraries with maven?
« Reply #18 on: September 15, 2015, 10:51:24 »
/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

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #19 on: September 15, 2015, 11:00:12 »
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.

*

Offline doev

  • *
  • 22
Re: How do I setup the native libraries with maven?
« Reply #20 on: September 15, 2015, 11:23:21 »
Ok, thx. :)

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #21 on: September 15, 2015, 14:26:50 »
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.
« Last Edit: September 15, 2015, 14:28:24 by spasi »

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #22 on: September 19, 2015, 21:52:03 »
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).

Re: How do I setup the native libraries with maven?
« Reply #23 on: September 21, 2015, 06:43:50 »
Ok, Be aware. DO NOT CALL the example SharedLibraryLoader.load() if you are using the nightly. It breaks everything.

*

Offline doev

  • *
  • 22
Re: How do I setup the native libraries with maven?
« Reply #24 on: September 22, 2015, 09:13:10 »
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)
« Last Edit: September 22, 2015, 09:15:35 by doev »

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #25 on: September 22, 2015, 09:31:24 »
What's the output if you run it with -Dorg.lwjgl.util.Debug=true?

*

Offline doev

  • *
  • 22
Re: How do I setup the native libraries with maven?
« Reply #26 on: September 22, 2015, 09:57:20 »
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
« Last Edit: September 22, 2015, 10:02:50 by doev »

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #27 on: September 22, 2015, 11:26:06 »
A new build is up (#33), could you try again please?

*

Offline doev

  • *
  • 22
Re: How do I setup the native libraries with maven?
« Reply #28 on: September 22, 2015, 11:36:58 »
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)

*

Offline spasi

  • *****
  • 2191
    • WebHotelier
Re: How do I setup the native libraries with maven?
« Reply #29 on: September 22, 2015, 11:42:03 »
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.