Bug 528 - UnsatisfiedLinkError with gluegen-rt native library on Mac OS 10.5.8 with 64-bit processor
Summary: UnsatisfiedLinkError with gluegen-rt native library on Mac OS 10.5.8 with 64-...
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: macosx (show other bugs)
Version: 2
Hardware: All macosx
: --- normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2011-11-11 17:46 CET by Derek Manwaring
Modified: 2011-12-19 01:59 CET (History)
3 users (show)

See Also:
Type: ---
SCM Refs:
b3d5e20c04af353b246c9b2607c145f7dbd508dd
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Manwaring 2011-11-11 17:46:40 CET
An error is thrown when launching Java apps that use JOGL on Macbook Pros with Mac OS 10.5.8 and a 64-bit Intel processor. 

Here is an example of this error thrown an a Macbook Pro with Mac OS 10.5.8 and an Intel Core 2 Duo processor.

Caused by: java.lang.UnsatisfiedLinkError: /Users/[...]/Library/Caches/Java/cache/6.0/44/63fa7cec-5d364b7f-n/libgluegen-rt.jnilib:  no suitable image found.  Did find:  /Users/[...]/Library/Caches/Java/cache/6.0/44/63fa7cec-5d364b7f-n/libgluegen-rt.jnilib: unknown required load command 0x80000022

Later versions of Mac OS do not have this problem. There is a specific example of this problem along with discussion on possible fix ideas here:
http://forum.jogamp.org/Mac-Problem-unknown-required-load-command-0x80000022-td2692102.html#a3497600
Comment 1 Sven Gothel 2011-11-18 08:31:48 CET
In the forum thread you mentioned, Wade created custom binaries w/
the experimental linker flag '-no_compact_linkedit'.

It seems that nobody tested them, hence we have no progress in this regards,
since I only have a 10.6.4 and a 10.7 OS X machine available.

If nobody validates this issue .. we may can close this bug .. ?!
Comment 2 Derek Manwaring 2011-11-18 19:50:49 CET
I tested my JOGL application with the custom binaries Wade created (jogl-no-compact-linkedit.zip on the forum thread). I got it to run normally on Mac OS 10.6.8 with these binaries and classes. When I did the same on Mac OS 10.5.8, I got the same error as before:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /[...]/jogl-no-compact-linkedit/lib/libgluegen-rt.jnilib:  no suitable image found.  Did find:  /[...]/jogl-no-compact-linkedit/lib/libgluegen-rt.jnilib: unknown required load command 0x80000022

After examining the Stack Overflow question Wade referenced (http://stackoverflow.com/questions/1440456/static-libraries-in-version-cross-compiled-program), I wondered if the problem is that the binaries were compiled with the -no_compact_linkedit flag, but not the other flag from the question $CFLAGS = -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5.

I haven't tried building JOGL on the 10.5.8 machine yet.

Any thoughts on this, Wade?
Comment 3 Sven Gothel 2011-11-18 23:23:51 CET
Dennis, since you have such a machine w/ 10.5.8 - can't you just test it yourself ?
If you got something working - then we can try it on 10.6/10.7 and may merge it.

I just hope we don't need 2 binaries for OS X :)
Comment 4 Wade Walker 2011-11-18 23:40:52 CET
If Derek wants to try building JOGL on his OS X 10.6.8 machine with -mmacosx-version-min=10.5 set, he could then test it on his OS X 10.5.8 machine to see if it works. Build instructions are at http://jogamp.org/wiki/index.php/Building_JOGL_on_the_command_line.

Alternately, I can build JOGL on my OS X 10.7 machine with -mmacosx-version-min=10.5 set and mail the binaries to Derek for testing. Derek, just let me know which one you'd like to try.

As Sven says, hopefully there's some way to build on recent OS X versions and have it still work on older versions :)
Comment 5 Derek Manwaring 2011-11-22 20:29:59 CET
Wade, if you could build the binaries for me and send them I will try them out. I can test them on my 10.6.8 machine and the 10.5.8 machine so we can know if the same binaries will work for both.
Comment 6 Wade Walker 2011-11-23 03:42:00 CET
I downloaded the latest dev build, then in the file gluegen/make/gluegen-cpptasks-base.xml I added  

<compilerarg value="-mmacosx-version-min=10.5"/>

to the end of the

<compiler id="compiler.cfg.macosx" name="gcc">

block, and added

<linkerarg value="-mmacosx-version-min=10.5"/>

to the end of the 

<linker id="linker.cfg.macosx" name="gcc">

block. Then I recompiled gluegen and jogl, cut some extraneous stuff out of the build directories, and emailed the .tar.gz files to Derek.

Let me know if these work, and we can go from there.
Comment 7 Sven Gothel 2011-11-26 18:17:32 CET
Added Wade's suggested compiler/linker flag .. let's see.
Comment 8 Derek Manwaring 2011-12-06 18:09:35 CET
I finally got around to testing my program with the libraries Wade sent me. I got a different error this time. It looks like the native libraries do actually get loaded now on Mac OS 10.5.8. Before our program's window pops up the following exception is thrown:

Exception in thread "main" javax.media.opengl.GLException: Profile GL_DEFAULT is not available on MacOSXGraphicsDevice[type MacOSX, connection decon, unitID 0, handle 0x0], but: []
       at javax.media.opengl.GLProfile.get(GLProfile.java:602)
       at javax.media.opengl.GLProfile.getDefault(GLProfile.java:425)
       at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:233)
       at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:183)
       at javax.media.opengl.awt.GLCanvas.<init>(GLCanvas.java:173)
       at edu.byu.chem.boltzmann.view.maingui.components.GLPanel.<init>(GLPanel.java:226)
...

It's possible that there is a real problem with the machine's graphics card/configuration, but the machine will run old versions of our program built with the jogl binaries from a few years ago.

I'm sorry I can't spend much time digging into the jogl code and trying things out myself. I'm happy to test new builds or try different things and let you all know how it goes. I hope the information I've provided this far has been helpful.
Comment 9 Sven Gothel 2011-12-07 01:47:11 CET
As I mentioned w/ comment 7, it's included in RC4 already.

Maybe you can just test it online: 
  http://jogamp.org/deployment/jogamp-current/jogl-test-applets.html

Detailed bugreport:

DL http://jogamp.org/deployment/v2.0-rc4/archive/jogamp-macosx-universal.7z
7z x jogamp-macosx-universal.7z
cd jogamp-macosx-universal/
sh etc/test.sh
sh etc/test_dbg.sh

then .. send us the test.log and test_dbg.log file please.
Comment 10 Sven Gothel 2011-12-13 01:50:32 CET
So it looks like the UnsatisfiedLinkError is solved with the setting.
Nevertheless another issue (bug) prevents you from using JOGL.

Can you pls try 
http://jogamp.org/deployment/archive/master/gluegen_457-joal_251-jogl_579-jocl_495/archive/

DL http://jogamp.org/deployment/archive/master/gluegen_457-joal_251-jogl_579-jocl_495/archive/jogamp-macosx-universal.7z
7z x jogamp-macosx-universal.7z
cd jogamp-macosx-universal/
sh etc/test.sh
sh etc/test_dbg.sh

then .. attach the test.log and test_dbg.log file please.

Thank you.
Comment 11 Sven Gothel 2011-12-19 01:59:16 CET
UnsatisfiedLinkError with gluegen-rt .. on OSX 10.5.8 is solved.

If the 'remaining' bug still exists, pls open a new bug dedicated to it's behavior.
Nevertheless, I guess it's solved for now (-> latest builds).

Thank you.