Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ? How do you Build JOGL from sources ?  (Read 1490 times)
0 Members and 1 Guest are viewing this topic.
Offline Z-Knight

Senior Member


Medals: 1



« Posted 2009-08-21 15:09:37 »

I'm trying to build JOGL from sources but I'm getting an incomplete build that is missing Windows and MacOS references.  I'm having to build JOGL on a Linux 64 bit platform because I was not compatible with any of the provided binaries.  When doing this I can SUCCESSFULLY create the libraries (jogl.jar and gluegen-rt.jar) and all static libraries as well and it works great. 

The main issue is that the jogl.jar does not include the windows or macos libraries and I'm not sure which flag or setting I'm missing that would enable me to build it with these included.

Again, note that I'm SUCCESSFUL in Linux and I can get JOGL to work but if I wanted to use these same .jars in Windows/MacOS I can't because of the missing platform references.  I don't know if this is even possible to do from a single platform or if I have to build jogl separately on each platform and then combine the resulting JARS together...I hope not.  Can someone help?

Below I'm attaching my notes and what I do step by step when building.  They are based in part on this link:

https://jogl.dev.java.net/source/browse/*checkout*/jogl/trunk/doc/HowToBuild.html

Quote
   ###############################################################################
   # First, the following utilities are required for successful compilation
   # Download them and save them to your compilation folder for ease of use:
   ###############################################################################

         apache-ant version 1.7.0 or greater
            source: http://ant.apache.org/bindownload.cgi
            direct link: http://mirror.olnevhost.net/pub/apache/ant/binaries/apache-ant-1.7.0-bin.tar.gz

         antlr version 2.7.2 (specifically this version, not any other!!!!!) 
            source: http://www.antlr2.org/download.html   
            direct link: http://www.antlr2.org/download/antlr-2.7.2.tar.gz
 

   # Obtain the latest (or desired) JOGL sources for glugen and jogl from here:
       https://jogl.dev.java.net/servlets/ProjectDocumentList

       # You will want to retrieve the 'src' package (for example:  jogl-1.1.1-src.zip)
       # Expand/Unzip this package into your compilation folder and it will create two
       # directories:  jogl/ and gluegen/

   # Now you are ready to compile...begin with gluegen compilation first and then move on to jogl

   ###############################################################################
   # Gluegen Compilation
   ###############################################################################
         # Go into the 'gluegen/make/' folder and edit the 'gluegen.properties' file
               cd gluegen/make
               nano gluegen.properties   (or use vi, or favorite editor)

         # Update the location of 'antlr.jar' to the one that you downloaded above
         # basically point to the antrl.jar path that you downloaded
               e.g.:   antlr.jar=/antlr-2.7.2/antlr.jar

         # Comment out the references to win32 and macosx, etc since we are in Linux

         # Copy the 'gluegen.properties' file to your home directory
         # Not sure if this is necessary per se, but do it anyway:
               cp gluegen/make/gluegen.properties ~/

         # Now you are ready to compile it by using 'ant'...use the version that you
         # downloaded in apache 1.7.0 or greater:
         # Change into the gluegen/make directory
               cd gluegen/make

         # Beging the compilation of gluegen
               apache-ant-1.7.0/bin/ant

         # When complete, the compilation will place the gluegen files in the
         # gluegen/build/ folder...check that these exist to make sure compilation
         # was successful:
               gluegen/build/gluegen.jar
               gluegen/build/gluegen-rt.jar
               gluegen/build/obj/libgluegen-rt.so

   ###############################################################################
   # JOGL Compilation
   ###############################################################################
         # Go into the 'jogl/make/' folder and edit the 'jogl.properties' file
               cd jogl/make
               nano jogl.properties   (or use vi, or favorite editor)

         # Update the location of 'java.home.dir' to the one that contains
         # the 64 bit linux libraries (when doing 64 bit linux)
               java.home.dir=/jdk1.6.0_02

         # Comment out the references to win32 and macosx, etc since we are in Linux
         # These are commented out because we are NOT compiling on Windows or Mac a
         # and don't have the Visual C++ Compiler, etc that would be needed.  Is this wrong?


         # Copy the 'jogl.properties' file to your home directory:
               cp jogl/make/jogl.properties ~/

         # Clear your CLASSPATH variable so that it does not include references
         # to old jogl or gluegen jars/libraries,
               export CLASSPATH=""
          
    # Clear out JAVA_HOME variable as well:
          export JAVA_HOME=""

         # Now you are ready to compile it by using 'ant'...use the version that you
         # downloaded in apache 1.7.0 or greater:
               apache-ant-1.7.0/bin/ant

         # When complete, the compilation will place the jogl files in the
         # jogl/build/ folder:
               jogl/build/jogl.jar
               jogl/build/obj/libjogl_awt.so
               jogl/build/obj/libjogl.so

   ###############################################################################
   # Compilations are complete so now you can copy the required jar files
   # and static libraries to a preferred location...these make up the files
   # needed to successful use of JOGL.  Add the location of these files to
   # your CLASSPATH
   ###############################################################################
               gluegen/build/gluegen.jar
               gluegen/build/gluegen-rt.jar
               gluegen/build/obj/libgluegen-rt.so
               jogl/build/jogl.jar
               jogl/build/obj/libjogl_awt.so
               jogl/build/obj/libjogl.so
         
         # The following is an example of how I add the files above to my CLASSPATH
         # I edit my .bashrc file to point to the jogl library folder called: jogl_lib
 
            JOGL=/jogl_lib
            export CLASSPATH=$CLASSPATH:$JOGL/jogl.jar:$JOGL/gluegen-rt.jar
            export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JOGL

         # the 'jogl_lib' folder is where I copied all of the above files to.  It
         # might be a good idea to create a separate folder for each version of jogl
         # you have an then link to that folder instead of just using jogl_lib as the
         # name....for example, copy all of the files to a folder called:  jogl_v1.1.1
               mkdir jogl_v1.1.1
               cp * jogl_v1.1.1

         # now create a symbolic link to the jogl_v1.1.1 folder:
               ln -s jogl_v1.1.1 jogl_lib         

         # In the future you would just change the sybolic link to the new version of jogl

         # in addition, I would suggest creating an alias to the 64 bit version of Java (when
         # compiling for 64) in your .bashrc file:
            alias java64=/jdk1.6.0_02/bin/java


   ###############################################################################
   # TESTING JOGL
   ###############################################################################
         # Get the jogl demos source files for testing:
            https://jogl.dev.java.net/servlets/ProjectDocumentList

         # Unzip the sources and go into the jogl-demos/make directory:
            cd jogl-demos/make

         # Use ANT to compile the demos:
            apache-ant-1.7.0/bin/ant

         # Go into the jogl-demos/build to test JOGL...test using the JGears example:
         # First you must make sure your CLASSPATH points to the jogl and gluegen
         # jars (as was instructed to do in the section above)...if not then you
         # will have to include them all in your path by hand....if instead you
         # did have them added to the CLASSPATH variable then you should be able to
         # type:
              java64 -classpath $CLASSPATH:jogl-demos.jar demos.jgears.JGears

         # else you might need to do something like this:
               /jdk1.6.0_02/bin/java
                  -classpath .:/jogl_lib/jogl.jar:/jogl_lib/gluegen-rt.jar:
                  jogl-demos.jar demos.jgears.JGears

Offline Z-Knight

Senior Member


Medals: 1



« Reply #1 - Posted 2009-08-25 15:07:11 »

No reply....really?!?!  I know the main JOGL people have to know how to do this...I mean, you put out composite binaries for all platforms so you have some process to do this.  I really need an answer as soon as you can.  Thanks.
Offline bienator

Senior Member




OutOfCoffeeException


« Reply #2 - Posted 2009-08-25 18:37:33 »

Hi, I can't answer your question since I only build on linux but...
I don't know if this is even possible to do from a single platform or if I have to build jogl separately on each platform and then combine the resulting JARS together...I hope not.
The current build setup does not look like it would be possible to crossbuild to N platforms from a single host platform.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline shatterblast

Senior Newbie




Noobier Than Thou


« Reply #3 - Posted 2009-08-25 19:34:41 »

I'm trying to build JOGL from sources but I'm getting an incomplete build that is missing Windows and MacOS references.  I'm having to build JOGL on a Linux 64 bit platform because I was not compatible with any of the provided binaries.  When doing this I can SUCCESSFULLY create the libraries (jogl.jar and gluegen-rt.jar) and all static libraries as well and it works great. 

The main issue is that the jogl.jar does not include the windows or macos libraries and I'm not sure which flag or setting I'm missing that would enable me to build it with these included.

I have a similar issue with LWJGL that I got around by using its Ant script file.  I haven't spent enough time to examine what to put into a non-Ant build yet, but it is possible to compile the natives for other operating systems on a single platform without tweaking much.  Anyhow, I suggest checking for the existence of an Ant script for JOGL.

Offline Z-Knight

Senior Member


Medals: 1



« Reply #4 - Posted 2009-09-25 15:42:01 »

I was hoping someone from the JOGL "office", that creates the downloadable distributions, would answer this question for me.

bienator, are you saying that your ANT script allows you to compile JOGL and create the JOGL JAR files that include references for all distributions?  For example, you look into jogl.jar right now and it is broken out by linux, windows, macos folders. On the other hand if I download the JOGL sources and follow the steps I detailed, there is no place I see in my process to tell it to include both windows and macos when doing my linux build and hence my final jogl.jar does not include the corresponding windows/macos references and hence it doesn't work on those platforms.

Do the official JOGL people just compile JOGL on all 3 platforms separately, and then extract the 3 jogl.jars (from linux, windows, macos) and then recombine them into one version that covers all the platforms?


btw, I realize there might be linux-32, linux-64, etc...I'm just being simple by limiting my point to "linux", "windows" and "macos".
Offline bienator

Senior Member




OutOfCoffeeException


« Reply #5 - Posted 2009-09-26 20:52:25 »

bienator, are you saying that your ANT script allows you to compile JOGL and create the JOGL JAR files that include references for all distributions?
no, the build script i committed to the JOGL and GlueGen repos only maps the build targets to a netbeans project ant script. You can now open the project in netbeans and press clean, build etc. I haven't changed anything else in the build.

...can't help you with the cross platform build issue

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (24 views)
2014-09-19 03:14:18

Dwinin (39 views)
2014-09-12 09:08:26

Norakomi (68 views)
2014-09-10 13:57:51

TehJavaDev (93 views)
2014-09-10 06:39:09

Tekkerue (47 views)
2014-09-09 02:24:56

mitcheeb (68 views)
2014-09-08 06:06:29

BurntPizza (51 views)
2014-09-07 01:13:42

Longarmx (38 views)
2014-09-07 01:12:14

Longarmx (44 views)
2014-09-07 01:11:22

Longarmx (40 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!