building jogl (JSR-231) 1.0 on linux

I’m attempting to build the 1.0 version of JOGL (JSR-231) and am running into issues on linux (both a64 and x86)
I’ve tried using Ant 1.7 as well as Ant 1.6.5 and 1.6.3 and Antlr 2.7.7 and 2.7.5

I’ve noticed that if I repeat the build command it seems to get further along, and if I run it a 3rd time it completes successfully.

I set my PATH to include both Ant and Java, unset CLASSPATH and launch Ant from the jogl/make directory with this command


/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/install/unknown/share/ant/bin/ant --execdebug   -Duser.home=/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231 linux.amd64

I get the following (abbreviated) output when trying to build JOGL on linux a64 (and similar messages on linux x86)

BUILD FAILED
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/jogl/make/build.xml:1591: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/jogl/make/build.xml:1518: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/jogl/make/build.xml:496: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/make/build.xml:121: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/make/build.xml:94: ANTLR signaled an error: ANTLR Parser Generator   Version 2.7.7 (20070414)   1989-2005
error: cannot find/copy importVocab file /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/gensrc/java/com/sun/gluegen/cgram/STDCTokenTypes.txt

The first time I run the build I see the following (abbreviated output):

antlr.jar.validate:

java.class.path.validate:

validate:
    [mkdir] Created dir: /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/gensrc/java
    [mkdir] Created dir: /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/classes

gluegen.build:
    [mkdir] Created dir: /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/gensrc/java/com/sun/gluegen/cgram
     [copy] Copying 5 files to /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/gensrc/java/com/sun/gluegen/cgram

generate.c.grammar:
Warning: Reference antlr.classpath has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
 referencing ids defined in non-executed targets.
    [antlr] ANTLR Parser Generator   Version 2.7.7 (20070414)   1989-2005
...
generate.c.grammar.glib:
Warning: Reference antlr.classpath has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
 referencing ids defined in non-executed targets.
    [antlr] ANTLR Parser Generator   Version 2.7.7 (20070414)   1989-2005
    [antlr] error: cannot find/copy importVocab file /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/gensrc/java/com/sun/gluegen/cgram/STDCTokenTypes.txt
...

The second invocation gets further, but still fails when processing generate.c.grammar.glib:

...
generate.c.grammar.glib:
Warning: Reference antlr.classpath has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support
 referencing ids defined in non-executed targets.
    [antlr] ANTLR Parser Generator   Version 2.7.7 (20070414)   1989-2005
    [antlr] warning: rule HeaderParser.declSpecifiers has different signature than GnuCTreeParser.declSpecifiers
    [antlr] warning: rule HeaderParser.storageClassSpecifier has different signature than GnuCTreeParser.storageClassSpecifier
    [antlr] warning: rule HeaderParser.functionStorageClassSpecifier has different signature than GnuCTreeParser.functionStorageClassSpecifier
    [antlr] warning: rule HeaderParser.typeQualifier has different signature than GnuCTreeParser.typeQualifier
...
    [antlr] warning: rule HeaderParser.parameterDeclaration has different signature than GnuCTreeParser.parameterDeclaration
    [antlr] warning: rule HeaderParser.nonemptyAbstractDeclarator has different signature than GnuCTreeParser.nonemptyAbstractDeclarator
    [antlr] error: cannot find/copy importVocab file 
...

BUILD FAILED
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/jogl/make/build.xml:1591: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/jogl/make/build.xml:1518: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/jogl/make/build.xml:496: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/make/build.xml:135: The following error occurred while executing this line:
/mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/make/build.xml:94: ANTLR signaled an error: ANTLR Parser Generator   Version 2.7.7 (20070414)   1989-2005
warning: rule HeaderParser.declSpecifiers has different signature than GnuCTreeParser.declSpecifiers
warning: rule HeaderParser.storageClassSpecifier has different signature than GnuCTreeParser.storageClassSpecifier
warning: rule HeaderParser.functionStorageClassSpecifier has different signature than GnuCTreeParser.functionStorageClassSpecifier
warning: rule HeaderParser.typeQualifier has different signature than GnuCTreeParser.typeQualifier
...
warning: rule HeaderParser.parameterTypeList has different signature than GnuCTreeParser.parameterTypeList
warning: rule HeaderParser.parameterDeclaration has different signature than GnuCTreeParser.parameterDeclaration
warning: rule HeaderParser.nonemptyAbstractDeclarator has different signature than GnuCTreeParser.nonemptyAbstractDeclarator
error: cannot find/copy importVocab file /mathworks/devel/sandbox/rquist/Amake.3p-tmw/3p/derived/glnxa64/JSR-231/gluegen/build/gensrc/java/com/sun/gluegen/cgram/GnuCTreeParserTokenTypes.txt
...

The third time I run the command it completes successfully.

Any ideas?
Is there a “known good” combination of Ant, Antlr, etc to build the 1.0 version of JSR-231?

Thanks in advance

The build process should work with the latest Ant. The issue is probably the newer ANTLR. antlr-2.7.5.jar is known to work.

Thanks Ken,

I thought I’d tried that already, but I’ll go back and do it again.

No luck with the earlier version of Antlr, and I’m seeing the same issue on solaris and mac (both power-pc and intel).
Windows (win32 and win64) builds fine first time through.

At this point I can live with the behavior, but it is odd.

Thanks again.

Did you properly set up gluegen.properties and jogl.properties in your home directory?

I checked and I’ve been using Ant 1.6.5; not sure whether I’ve tested with 1.7 yet.

Aside from that JOGL should build cleanly on all platforms. Note that the build is intended to be executed from within jogl/make, but it looks like you’re already doing that. If you can get away from setting user.home and check to see that the environment variable JAVA_HOME is unset then our setups should be identical. I’m also assuming you’re using the Sun JDK?

Also, please always use the latest sources either from CVS or the latest nightly build unless there’s a good reason for you to build an earlier version of JOGL. This may be something we’ve sinced fixed in the build files.

The latest release version build succeeds the first time, so the issue has been fixed and when we upgrade to that release I’ll be able to remove my “build it 3 times” hack.

Thanks again.

I am also having trouble building. I am using the latest version of ant (1.7, release in 12/06). The gluegen jar builds but I get the following in my build of jogl. I do an “ant” in the ~/jogl/make directory and at the end get:


java.generate.gl:
     [echo] Generating GL interface and implementation
  [gluegen] WARNING: unable to find #include file "inttypes.h"
  [gluegen] WARNING: unable to find #include file "inttypes.h"
  [gluegen] WARNING: unable to find #include file "stdint.h"
  [gluegen] WARNING: unable to find #include file "stdint.h"

java.generate.gl.nsig:
     [echo] Generating platform-specific OpenGL extension class
  [gluegen] WARNING: unable to find #include file "inttypes.h"
  [gluegen] WARNING: unable to find #include file "inttypes.h"
  [gluegen] WARNING: unable to find #include file "stdint.h"
  [gluegen] WARNING: unable to find #include file "stdint.h"
  [gluegen] java.lang.RuntimeException: Please port StructLayout to your OS (linux) and CPU (x86)
  [gluegen]     at com.sun.gluegen.StructLayout.createForCurrentPlatform(StructLayout.java:146)
  [gluegen]     at com.sun.gluegen.JavaEmitter.getLayout(JavaEmitter.java:1206)
  [gluegen]     at com.sun.gluegen.JavaEmitter.layoutStruct(JavaEmitter.java:648)
  [gluegen]     at com.sun.gluegen.GlueGen.run(GlueGen.java:257)
  [gluegen]     at com.sun.gluegen.GlueGen.main(GlueGen.java:297)
  [gluegen] Exception occurred while generating glue code. Exiting.

BUILD FAILED
/home/nisha/jogl/make/build.xml:1561: The following error occurred while executing this line:
/home/nisha/jogl/make/build.xml:566: GlueGen returned: 1

I then do second “ant” in the ~/jogl/make directory and get:


java.compile.firstpass:
    [javac] Compiling 1 source file to /home/nisha/jogl/build/classes

java.generate.composable.pipeline.check:

java.generate.composable.pipeline:

java.compile.secondpass:
    [javac] Compiling 159 source files to /home/nisha/jogl/build/classes
    [javac] /home/nisha/jogl/build/gensrc/classes/com/sun/opengl/impl/x11/GLXExt.java:149: <identifier> expected
    [javac]   public static f
    [javac]                  ^
    [javac] 1 error

BUILD FAILED
/home/nisha/jogl/make/build.xml:1561: The following error occurred while executing this line:
/home/nisha/jogl/make/build.xml:708: Compile failed; see the compiler error output for details.

And it’s clear why because the file just stops with that last line in it.

I am trying to use the IBM JRE as a test. I am compiling it with an IBM JRE because trying to run with the jogl.jar that is distributed is currently failing with the IBM JRE.

Ken, I noticed that you said:

Could that be the source of my problem? I do not have JAVA_HOME set.

Thanks,
Nisha

I’ve checked in a fix to StructLayout.java which should get you past this build problem. Take an update and try again. If you build with the Sun JDK I can pretty much guarantee that the build will work.

That fixed that problem. I got a lot further but it still doesn’t build with the IBM JDK. It does build with the Sun JDK.
Now I see:


c.build:
     [echo] Output lib name = jogl_awt
       [cc] 5 total files to be compiled.
       [cc] cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
       [cc] In file included from /home/nisha/jogl/build/gensrc/native/jogl/JAWT_DrawingSurface_JNI.c:8:
       [cc] /opt/ibm/java2-i386-50/include/jawt.h:302: error: syntax error before "jboolean"
       [cc] cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
       [cc] cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
       [cc] In file included from /home/nisha/jogl/build/gensrc/native/jogl/JAWT_X11DrawingSurfaceInfo_JNI.c:8:
       [cc] /opt/ibm/java2-i386-50/include/jawt.h:302: error: syntax error before "jboolean"
       [cc] cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
       [cc] In file included from /home/nisha/jogl/build/gensrc/native/jogl/JAWTFactory_JNI.c:8:
       [cc] /opt/ibm/java2-i386-50/include/jawt.h:302: error: syntax error before "jboolean"
       [cc] cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C
       [cc] In file included from /home/nisha/jogl/build/gensrc/native/jogl/JAWT_JNI.c:8:
       [cc] /opt/ibm/java2-i386-50/include/jawt.h:302: error: syntax error before "jboolean"

BUILD FAILED

I compared the two jawt.h files (ibm and sun) and they have the same code. I guess it just doesn’t build with the ibm jdk. I’ll put a note in the ibm jdk forums.

java -version

java version “1.5.0”
Java™ 2 Runtime Environment, Standard Edition (build pxi32dev-20070511(SR5))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20070426 (JIT enabled)
J9VM - 20070420_12448_lHdSMR
JIT - 20070419_1806_r8
GC - 200704_19)
JCL - 20070511

Thanks for your help and especially for the quick turn around time.

– Nisha