How to build GlueGen (original) (raw)

Platform and Component Requirements


Here is a list of platforms and components, we were able to build GlueGen on,
if not stated otherwise.
See JogAmp's Supported Platforms.

Replace jogamp with your user name.

CMake has been added here for JOAL and JOGL.

Additional platforms such as HP/UX are handled by the build system, but are not officially supported.

Build Steps


Here are the steps that are required in order to build GlueGen.

  1. Optain the source code using git:

It is crucial that you checkout the source code under a common root directory:
/home/dude/projects/jogamp> git clone --recurse-submodules git://jogamp.org/srv/scm/gluegen.git gluegen

Now you should have following directory structure:
/home/dude/projects/jogamp
/home/dude/projects/jogamp/gluegen

Note-1: The GlueGen source must be fetched using -recurse-submodules, which imports JCPP, now used as the default C preprocessor. 2. Unset your CLASSPATH environment variable:
The Ant build requires that the GlueGen jars not be visible on the classpath. On Unix, typeunsetenv CLASSPATH into a csh or tcsh shell, or unset CLASSPATH into a Bourne shell. On Windows, type set CLASSPATH= into a command prompt. 3. Optional Copy and edit gluegen.properties:
To specify different basic options for components and compilers,
copy gluegen/make/gluegen.properties into your home directory (pointed to by the Java system property user.home). 4. Build the source tree:
Open a command shell in the "gluegen/make" directory of the source tree and invoke ant with the given properties as follows
cd /home/dude/projects/jogamp/gluegen/make/
ant

Optionally you can also set certain build features via properites or environment variables
Feature Property or Environment Variable
developer-zip-archive: build.archiveon=true BUILD_ARCHIVE=true
Native Debug Code: c.compiler.debug=true
Java Debug Code: javacdebuglevel="source,lines,vars" 5. Test your build:
Stay in your command shell in the "gluegen/make" directory of the source tree and invoke ant with above properties or environment variables and use the target junit.run. 6. Build Javadoc:
Stay in your command shell in the "gluegen/make" directory of the source tree and invoke ant with above properties or environment variables and use the target doxygen.public or doxygen.all. This will produce the end-user documentation for GlueGen along with some auxiliary utility packages.

Note that there might be a few warnings produced by ANTLR about the C grammar and our modifications to some of the signatures of the productions; the C grammar warnings have been documented by the author of the grammar as having been investigated completely and harmless, and the warnings about our modifications are also harmless.

Common build problems

  1. Your CLASSPATH environment variable appears to be set (some GlueGen classes are currently visible to the build.), and $CLASSPATH isn't set. An older version of GlueGen was installed into the extension directory of the JDK you're using to build the current GlueGen. On Windows and Linux, delete any ANTLR jars from jre/lib/ext, and on Mac OS X, delete them from /Library/Java/Extensions. It is generally not a good idea to drop GlueGen directly into the extensions directory, as this can interfere with upgrades via Java Web Start.
  2. CharScanner; panic: ClassNotFoundException: com.jogamp.gluegen.cgram.CToken This occurs because ANTLR was dropped into the Extensions directory of the JRE/JDK. On Windows and Linux, delete any ANTLR jars from jre/lib/ext, and on Mac OS X, delete them from /Library/Java/Extensions. Use the antlr.jar property in the build.xml to point to a JRE-external location of this jar file.

- Christopher Kline and Kenneth Russell, June 2003 (revised November 2006)
- Sven Gothel and Michael Bien, May 2010
- Sven Gothel, March 2010 (Extracted version from JOGL)