help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8


From:
Subject: Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8
Date: Thu, 2 Feb 2012 09:57:56 +0100

Hi again Xypron,

On 1 Feb 2012, at 18:22, glpk xypron wrote:

Hello Ricardo,

on a 64bit system you could install two different Java runtimes:
A 32bit runtime and a 64bit runtime.

A 64bit runtime can only load 64bit libraries.
A 32bit runtime can only load 32bit libraries.

Did you check the bitness of the GLPK library (glpk.dylib)?
The glpk_java.dylib will load glpk.dylib. The bitness must match.


Yes, they match.

wi-3-218:~ death$ lipo -info /usr/local/lib/libglpk.dylib
Non-fat file: /usr/local/lib/libglpk.dylib is architecture: x86_64

wi-3-218:~ death$ lipo -info Downloads/libglpk-java-1.0.19/swig/.libs/ libglpk_java.dylib Non-fat file: Downloads/libglpk-java-1.0.19/swig/.libs/ libglpk_java.dylib is architecture: x86_64

And the same error arises with 'make check':
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.gnu.glpk.GLPKJNI.glp_term_hook(JJ)V
        at org.gnu.glpk.GLPKJNI.glp_term_hook(Native Method)

I've tested compiling *without* -m64 flag both, glpk and libgplk-java, and again I obtain from Java the 'match-o, wrong architecture' error


For the bitness of GCC. Compile the proposed code with -m64 and check the output again.

It seems it compiles for x64:

wi-3-218:~ death$ gcc -m64 test.c -o test
wi-3-218:~ death$ ./test
Running in 64bit mode.

Quite odd, any further idea?

Regards,
Ricardo

Best regards

Xypron

-------- Original-Nachricht --------
Datum: Wed, 1 Feb 2012 11:00:20 +0100
Betreff: Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8

Dear Xypron,
OK, I've executed again the original ./configure and the original
Makefile without modifying anything.

/configure         CPPFLAGS=-I/System/Library/Frameworks/
JavaVM.framework/Headers         SWIGFLAGS=-I/System/Library/
Frameworks/JavaVM.framework/Headers JAVA_HOME=/System/Library/
Frameworks/JavaVM.framework/Versions/1.6.0/Home/

I've properly set JAVA_HOME avoiding the 'invalid source release',
thank you. I don't get why MacOS have all JavaVM installed by default
up to 1.6, and the 'Current' is linked to 1.5 by default ¿? anyway...

Setting all by default, as I said, without modifying anything, this is
the error I get when executing 'make check':
Exception in thread "main" java.lang.UnsatisfiedLinkError: /Users/
death/Downloads/libglpk-java-1.0.19/swig/.libs/libglpk_java.0.dylib:
no suitable image found.  Did find:  /Users/death/Downloads/libglpk-
java-1.0.19/swig/.libs/libglpk_java.0.dylib: mach-o, but wrong
architecture

I've been googling, and I found that it seems that Java is not able to
load a 32bit library, even it should be:
$ lipo -info /usr/bin/java
Architectures in the fat file: /usr/bin/java are: ppc7400 i386 x86_64

And the GLPK-java library is:
$ lipo -info libglpk-java-1.0.19/swig/.libs/libglpk_java.dylib
Non-fat file: libglpk-java-1.0.19/swig/.libs/libglpk_java.dylib is
architecture: i386

That's the reason I added the flag -m64. By compiling it with such a
flag, I get the error I commented before:

Exception in thread "main" java.lang.UnsatisfiedLinkError:
org.gnu.glpk.GLPKJNI.glp_term_hook(JJ)V
        at org.gnu.glpk.GLPKJNI.glp_term_hook(Native Method)


About the architecture, I think (please correct me if I'm wrong) that
MacOS X 10.5.8 is 32bit kernel only.

I've checked with the source codes you've given to me and the results
are:

GCC: Running in 32bit mode.

Java: 64

So... I'm running a JavaVM 64bits in a computer running in 32bit
environment... interesting

Any further idea?

Best regards,
Ricardo


--
Follow me at http://twitter.com/#!/xypron

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de




reply via email to

[Prev in Thread] Current Thread [Next in Thread]