JOGL on AMD64

Hi, I’ve searched this forum, but I wasn’t lucky enough. I am trying to compile JOGL on my system, here the specs:
Debian GNU/Linux Unstable for AMD64
Sun JDK 5.0
Gcc 4.0.3
But at the end of the process I get:
c.build:
[echo] Output lib name = jogl
[cc] Starting dependency analysis for 10 files.
[cc] 10 files are up to date.
[cc] 0 files to be recompiled from dependency analysis.
[cc] 0 total files to be compiled.
[cc] Starting link
[cc] /usr/bin/ld: /usr/X11R6/lib64/libGL.a(glapi.o): relocation R_X86_64_32 against `a local symbol’ can not be used when making a shared object; recompile with -fPIC
[cc] /usr/X11R6/lib64/libGL.a: could not read symbols: Bad value
[cc] collect2: ld returned 1 exit status

I checked build.xml but under linux.amd64 configuration there is -fPIC, so I don’t know where this error is generating from…!
Please someone can help?
Best regards

The linux.amd64 build works fine for me on a relatively old SuSE Linux 8 SP3 dual Opteron machine with gcc 3.2.2. Maybe the command line arguments you need to pass to gcc changed in gcc 4.0. I would recommend running ant -v linux.amd64 to see exactly the command line arguments being passed to gcc to compile and link the JOGL native code. I would then suggest trying to compile and link those files by hand to figure out either what command line arguments are missing or which need to be added. If you can figure this out we’ll try to modify either the JOGL build.xml or cpptasks code to fix this build problem.

BTW, I would think you should be able to run the 32-bit JOGL Linux/x86 binaries on that machine. Does that not work?

I downloaded latest snapshot but nothing changed. However it seems that fPIC is there.

c.build:
[echo] Output lib name = jogl
[cc] 5 total files to be compiled.
[cc] gcc -fPIC -c -fno-rtti -fPIC -I/home/v0n0/Progetti/Ingegneria/jogl-nightly/jogl/make/stub_includes/opengl -I/usr/lib/j2sdk1.5-sun/include -I/usr/lib/j2sdk1.5-sun/include/linux /home/v0n0/Progetti/Ingegneria/jogl-nightly/jogl/build/gensrc/native/jogl/GLXExtImpl_JNI.c /home/v0n0/Progetti/Ingegneria/jogl-nightly/jogl/src/native/jogl/InternalBufferUtils.c /home/v0n0/Progetti/Ingegneria/jogl-nightly/jogl/build/gensrc/native/jogl/GLX_JNI.c /home/v0n0/Progetti/Ingegneria/jogl-nightly/jogl/build/gensrc/native/jogl/GLImpl_JNI.c /home/v0n0/Progetti/Ingegneria/jogl-nightly/jogl/build/gensrc/native/jogl/GLU_JNI.c
[cc] Starting link
[cc] gcc -shared -o libjogl.so jogl/GLXExtImpl_JNI.o jogl/InternalBufferUtils.o jogl/GLX_JNI.o jogl/GLImpl_JNI.o jogl/GLU_JNI.o -L/usr/X11R6/lib64 -lGL -lGLU -lX11

But I don’t understand why it’s called twice. Also -fno-rtti gives a lot of warnings because in C it is not used, in fact (from gcc manual):
-fno-rtti
Disable generation of information about every class with virtual functions for use by
the C++ runtime type identification features (dynamic_cast and typeid). If you don’t
use those parts of the language, you can save some space by using this flag. Note that
exception handling uses the same information, but it will generate it as needed.

Any hints? Could you try sending me your binaries? I don’t know if they will work, but I can try. I’ve not set up a chroot so I can’t run 32bit version (I could set up emulation but it’s a lot of time).

I’ve put the native libraries in the Temporary Files folder on the JOGL home page under " jogl-natives-linux-amd64.jar". You should be able to unjar this jar file and put the directory containing the .so’s in your LD_LIBRARY_PATH and use this along with the current nightly build’s jogl.jar. Let me know whether this appears to work.

Thanks

I was able to get the latest source to build running the current Debian Etch for AMD64. There are a few additional steps needed to compile JOGL for this architecture.

First you must install libglu1-mesa and libglu1-mesa-dev.

apt-get install libglu1-mesa
apt-get install libglu1-mesa-dev

You must also modify the build.xml file, here is the part I changed, notice line 725 points to /usr/X11R6/lib not /usr/X11R6/lib64.

724 -
725-
726-
727-

This will compile successfully, however the latest release won’t run properly. I get the following errors.

Exception in thread “main” javax.media.opengl.GLException: glXGetConfig failed: error code GLX_BAD_SCREEN

I’m so sad about this, if anyone out there knows how to fix this it would make my day!

Sorry about the breakage. I think I broke something relatively recently in the 64-bit ports with a refactoring of the autogenerated glue code accessors for structs like XVisualInfo.

Since you have a working build setup, could you help debug this a little? Could you insert some code just above the point where the exception is thrown? Something like


  System.err.println("info.visual = 0x" + Long.toHexString(info.visual());
  System.err.println("info.visualid = 0x" + Long.toHexString(info.visualid());
  System.err.println("info.screen = " + info.screen());
  System.err.println("info.depth = " + info.depth());

and also print the iteration counter (i in the loop in chooseGraphicsConfiguration)? Could you post the output?

Thanks.

I did as you said and here is the full output. I hope it helps, is there anything more I can do?

< begin >

chooseGraphicsConfig() line 125: int i = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
glXGetConfig() line 455: info.visual = 0xfffffffffb65f1a0
glXGetConfig() line 455: info.visualid = 0x2aaa
glXGetConfig() line 455: info.screen = 33
glXGetConfig() line 455: info.depth = 0
chooseGraphicsConfig() line 125: int i = 1
glXGetConfig() line 455: info.visual = 0xff00
glXGetConfig() line 455: info.visualid = 0x0 // Is this the problem???
glXGetConfig() line 455: info.screen = 255
glXGetConfig() line 455: info.depth = 0
Exception in thread “main” javax.media.opengl.GLException: glXGetConfig failed: error code GLX_BAD_SCREEN
at com.sun.opengl.impl.x11.X11GLDrawableFactory.glXGetConfig(X11GLDrawableFactory. java:462)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.xvi2GLCapabilities(X11GLDrawableFa ctory.java:279)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.chooseGraphicsConfiguration(X11GLD rawableFactory.java:128)
at javax.media.opengl.GLCanvas.(GLCanvas.java:110)
at javax.media.opengl.GLCanvas.(GLCanvas.java:82)
at new3d.glengine.Test.main(Test.java:116)

< end >

Thanks for this logging output. I’ve identified and fixed some problems with the glue code generation on 64-bit platforms. The 64-bit XVisualInfo struct accessor generated by GlueGen now looks correct again. I’m not sure however that this will completely fix the problems you’re seeing. Could you try doing a cvs update, rebuilding and retesting?

I did a cvs checkout ‘jogl’ from cvs.dev.java.net/cvs. Bad news, still doesn’t seem to work :’(. Here’s the output.

anthony@amd64:~/work/new3d/dist$ java new3d.glengine.Test
main cbuffer 255
chooseGraphicsConfig() line 127: int i = 0
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
glXGetConfig() line 457: info.visual = 0x2aaafb4b30d0
glXGetConfig() line 457: info.visualid = 0x21
glXGetConfig() line 457: info.screen = 0
glXGetConfig() line 457: info.depth = 24
chooseGraphicsConfig() line 127: int i = 1
glXGetConfig() line 457: info.visual = 0xff00
glXGetConfig() line 457: info.visualid = 0xff
glXGetConfig() line 457: info.screen = 256
glXGetConfig() line 457: info.depth = 8
Exception in thread “main” javax.media.opengl.GLException: glXGetConfig failed: error code GLX_BAD_SCREEN
at com.sun.opengl.impl.x11.X11GLDrawableFactory.glXGetConfig(X11GLDrawableFactory.java:466)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.xvi2GLCapabilities(X11GLDrawableFactory.java:280)
at com.sun.opengl.impl.x11.X11GLDrawableFactory.chooseGraphicsConfiguration(X11GLDrawableFactory.java:129)
at javax.media.opengl.GLCanvas.(GLCanvas.java:110)
at javax.media.opengl.GLCanvas.(GLCanvas.java:82)
at new3d.glengine.Test.main(Test.java:116)

Thanks for trying it. I’ve fixed another couple of problems in the generated glue code and think it should be working now. Could you please do another cvs update and try it again?

;D Bingo! Did a fresh checkout and compile just in case. Everything seems to work now, thanks for the support!

-Anthony