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: glpk xypron
Subject: Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8
Date: Wed, 01 Feb 2012 05:02:57 +0100

Hello Ricardo,

> I've to force gcc to compile for 64 bits by setting -m64 option  
m64 is a flag needed to force gcc to build 64bit binaries on a 32bit operating 
system. You will not be able to run a 64bit library on a 32bit kernel. For 
starting OS X with a 64bit Kernel see
http://support.apple.com/kb/HT3773

If you are already running a 64bit kernel, check that you installed a 64bit 
version of GCC.

Please, check that you can run 64bit programs by compiling and running the 
following program:

#include <stdio.h>
#include <stdlib.h>
int main() {
  int i = sizeof(void *) * 8;
  printf("Running in %dbit mode.\n", i);
  return 0;
}

> javac: invalid source release: 1.6
This implies that the invoked javac is not version 1.6 or above. Check your 
file paths, you may have multiple JDKs installed.

The current version of Java is 1.7.

> Exception in thread "main" java.lang.UnsatisfiedLinkError:  
If make check does not work this has to be fixed before you install GLPK for 
Java and try to create your own programs.

The bitness of your Java runtime has to be 64bit if you want to use 64bit JNI 
libraries. You can determine the bitness of your runtime with the following 
code:

public class Bitness{
    public static void main(String[] args) {
        String bits = null;
        bits = System.getProperty("com.ibm.vm.bitmode");
        if (bits == null) {
            bits = System.getProperty("sun.arch.data.model");
        }
        System.out.println( bits );
    }
}

Best regards

Xypron



-------- Original-Nachricht --------
> Datum: Tue, 31 Jan 2012 09:24:16 +0100
> Von: ""Ricardo J. Rodríguez"" <address@hidden>
> An: glpk xypron <address@hidden>
> CC: ""Ricardo J. Rodríguez"" <address@hidden>, address@hidden
> Betreff: Re: [Help-glpk] GLPK-Java JNI in Mac OS X 10.5.8

> Hi Xypron,
> 
> On 31 Jan 2012, at 07:34, glpk xypron wrote:
> 
> > Hello Ricardo,
> >
> > java.lang.UnsatisfiedLinkError means that the native library *.dylib  
> > either could not be loaded or did not contain the C function needed.
> >
> > It is necessary that the *.dylib files are in the library search  
> > path. For glpk_java.dylib this can be achieved by setting  
> > java.library.path when invoking the Java runtime.
> >
> > When compling you will have run
> > ./configure
> > make
> > make check
> >
> > Did you get the same error when executing "make check"?
> >
> 
> Yes, sorry, I forgot to tell it the first time. This is the error I'm  
> getting:
> 
> 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)
>       at org.gnu.glpk.GLPK.glp_term_hook(GLPK.java:721)
>       at org.gnu.glpk.GlpkTerminal.<clinit>(GlpkTerminal.java:13)
>       at Gmpl.solve(Gmpl.java:27)
>       at Gmpl.main(Gmpl.java:12)
> make: *** [check] Error 1
> 
> It's not *exactly* the same unsatisfied link error, it's in another  
> function but it's the same issue I guess
> 
> > By the way did you have to make any changes to the configuration  
> > script to get it running on OX X? I do not have access to an Apple  
> > myself.
> 
> :)
> Yes, I've to force gcc to compile for 64 bits by setting -m64 option  
> when invoking gcc compiler (CC, CPP variables), and I've to remove any  
> reference to target/source specific when invoking JAVAC (i.e., I've  
> removed the parameters -source 1.6 -target 1.6), because javac returns  
> me an error when compiling:
> 
> javac: invalid source release: 1.6
> 
> My javac version is
> $ javac -version
> javac 1.6.0_26
> 
> Any idea for fixing it?
> 
> 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]