We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpIntegration › OPENGL mode and 64-bit Linux
Page Index Toggle Pages: 1
OPENGL mode and 64-bit Linux (Read 5871 times)
OPENGL mode and 64-bit Linux
Apr 13th, 2010, 12:33am
 
I am posting this here because I cannot login to the bug tracker.

Processing fails miserably[1] in 64-bit Linux since the jogl and gluegen binary that processing comes with is 32-bit. This is silly since the fix is very easy; replacing the files: libgluegen-rt.so, gluegen-rt.jar, gluegen.jar, libjogl.so, libjogl_awt.so, jogl.jar with a 64-bit compiled version fixes everything.

[1] java.lang.UnsatisfiedLinkError: /path/to/libgluegen-rt.so: /path/to/libgluegen-rt.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)

I can now run the OPENGL examples and all of them seems to be running fine from the latest SVN version.

I will see if I can hack build.xml to conditionally use the alternate version of these files if and detects it's compiling for amd64 Linux. For the meantime, if anyone is experiencing this problem and is unable to compile jogl and gluegen, here's mine: http://www.mediafire.com/file/dhu2qdyzy1f/jogl_gluegen_amd64.zip (WARNING: do not download files from unknown strangers in the internet, I am an unknown stranger. DISCLAIMER: these files works on my machine, I don't guarantee it works on yours, and I'm not responsible if you trashed your processing/machine because of them) (turns out there are precompiled binaries in ./libraries/opengl/library/*-natives-*.jar)
Re: OPENGL mode and 64-bit Linux
Reply #1 - Apr 13th, 2010, 7:47am
 
Turns out there is a precompiled binaries in there all along hidden in opengl/library/jogl-natives-linux-amd64.jar and opengl/library/gluegen-rt-natives-linux-amd64.jar files; and there is no 'ant' rule to decompress them and processing doesn't do anything to automatically select the binaries. I'm attaching a build.xml that uncompresses these arch binaries.

Code:

Index: build.xml
===================================================================
--- build.xml   (revision 6618)
+++ build.xml   (working copy)
@@ -113,6 +113,12 @@
    <copy todir="${target.path}/libraries/video">
      <fileset dir="../video" includes="library/**,src/**" />
    </copy>
+
+    <!-- Unzip architecture specific precompiled libraries -->
+    <unzip dest="${target.path}/libraries/opengl/library">
+      <fileset dir="../opengl" includes="library/*-natives-${platform}-${os.arch}.jar"/>
+    </unzip>
+    <delete dir="${target.path}/libraries/opengl/library/META-INF"/>
   
    <!-- Unzip documentation + examples -->
    <unzip dest="${target.path}" src="shared/examples.zip" overwrite="false"/>


Or would it be better if processing detected the System.getProperty("os.arch") at runtime/startup and decompress one appropriately?
Re: OPENGL mode and 64-bit Linux
Reply #2 - Apr 29th, 2010, 4:48pm
 
Hi im trying to use procesing-1.1 with OpenGL. On a 64 bit Linux (Ubuntu 9.10).
At first the program crashed with a strange error. I read you post and extract the 64 binaries in opengl/library/jogl-natives-linux-amd64.jar and opengl/library/gluegen-rt-natives-linux-amd64.jar to opengl/library
However when trying to run an example only get a grey screen and that's all. The programs don't crash but they are not doing anything.
I used the binary distribution. Do you have any sugestions?
Thanks in advance.
Re: OPENGL mode and 64-bit Linux
Reply #3 - May 1st, 2010, 1:03am
 
Are the normal programs (i.e. non-OpenGL) running well after you decompressed the 64-bit libs? Are you sure there's no other error message?

Can you run other OpenGL programs? Try opening a terminal and run the `glxgears` and `glxinfo` program, see if hardware acceleration is turned on (look on the lines of "direct rendering" it should say "yes"). What graphic driver are you using, nVidia or ATi or others?
Re: OPENGL mode and 64-bit Linux
Reply #4 - May 6th, 2010, 10:58am
 
Just for convenience here's a simple ruby script to backup the *.so and update them:

Code:

#!/usr/bin/env ruby

require 'fileutils'

# script to fix processing for 64-bit linux
processing_dir = "/local/processing-1.1"

library_dir = File.join(processing_dir,"libraries","opengl","library");
backup_dir = File.join(library_dir,"original-native");
unpack_dir = File.join(library_dir,"unpack-amd64");
Dir.mkdir backup_dir unless File.exists?(backup_dir)
Dir.mkdir unpack_dir unless File.exists?(unpack_dir)

jars = Dir.glob(File.join(library_dir,"*.jar")).select {|f| f =~ /linux-amd64/ }
jars.each do |jar_file|
 system "unzip -o #{jar_file} -d #{unpack_dir}"
end  

libraries = Dir.glob(File.join(unpack_dir,"*.so"))
libraries.each do |so_file|
 src = File.join(library_dir,File.basename(so_file))
 unless File.exists?(File.join(backup_dir,File.basename(so_file)))
   FileUtils.mv(src, backup_dir)
 end
 FileUtils.cp(so_file, library_dir)
end


change the processing_dir to where you have processing installed and it should swap the *.so files for you.
Re: OPENGL mode and 64-bit Linux
Reply #5 - May 10th, 2010, 7:53am
 
I've used the above script and 64 bit files are there (added verbosity for copy commands to highlight that) but still receiving the same error.

any other hint, please?

error:

Code:

processing.app.debug.RunnerException: UnsatisfiedLinkError: /home/htrex/sketchbook/libraries/opengl/library/libgluegen-rt.so: /home/htrex/sketchbook/libraries/opengl/library/libgluegen-rt.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)


that's the output of the script:

Code:

./fixProcessingOpenGLx64.sh
Archive:  /home/htrex/opt/processing-1.1/libraries/opengl/library/jogl-natives-linux-amd64.jar
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/META-INF/MANIFEST.MF  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/META-INF/JAVA_MED.SF  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/META-INF/JAVA_MED.RSA  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libjogl.so  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libjogl_awt.so  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libjogl_cg.so  
Archive:  /home/htrex/opt/processing-1.1/libraries/opengl/library/gluegen-rt-natives-linux-amd64.jar
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/META-INF/MANIFEST.MF  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/META-INF/JAVA_MED.SF  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/META-INF/JAVA_MED.RSA  
 inflating: /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libgluegen-rt.so  
cp /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libjogl.so /home/htrex/opt/processing-1.1/libraries/opengl/library
cp /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libjogl_cg.so /home/htrex/opt/processing-1.1/libraries/opengl/library
cp /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libgluegen-rt.so /home/htrex/opt/processing-1.1/libraries/opengl/library
cp /home/htrex/opt/processing-1.1/libraries/opengl/library/unpack-amd64/libjogl_awt.so /home/htrex/opt/processing-1.1/libraries/opengl/library

Re: OPENGL mode and 64-bit Linux
Reply #6 - May 10th, 2010, 8:06am
 
Nevermind, got it:

needed to copy those .so files in the sketchbook libraries folder too....

Re: OPENGL mode and 64-bit Linux
Reply #7 - May 15th, 2010, 6:37pm
 
Lie Ryan wrote on May 1st, 2010, 1:03am:
Are the normal programs (i.e. non-OpenGL) running well after you decompressed the 64-bit libs Are you sure there's no other error message

Can you run other OpenGL programs Try opening a terminal and run the `glxgears` and `glxinfo` program, see if hardware acceleration is turned on (look on the lines of "direct rendering" it should say "yes"). What graphic driver are you using, nVidia or ATi or others

Thanx Lie
You were right, my problem was not procesing but the OpenGL in general, (I couldn't run any OpenGL program: glxgears etc)
I just installed Ubuntu 10.4 and now everythinh including procesing OpenGL programs run fine.


Page Index Toggle Pages: 1