help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Some question about installing GLPK for Java in Linux


From: 周宗毅
Subject: Re: [Help-glpk] Some question about installing GLPK for Java in Linux
Date: Thu, 21 Jun 2012 19:43:11 +0800

Dear all ,

now I change the java version to sun-version 

java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)

and tried to re-installed libglpk-java.

But when I setuped configure , it occured that

checking jni.h usability... no
checking jni.h presence... no
checking for jni.h... no

Where does this file should be ?

I check in my java folder "/usr/java/jdk1.6.0_33/include" . 

It has this file and my JAVA_HOME also setuped this path.

Do I miss something here? Or I made other stupid mistake?

Thank you!

Best regards

Chung Yi


2012/6/21 周宗毅 <address@hidden>
Dear Author , 

I met some question about using this in server.

I followed the web page http://glpk-java.sourceforge.net/gettingStarted.html to get started.

However when I wanted to install this in Linux (Fedora 14 64bit), it failed again.

GLPK for Java

Download GLPK for Java from https://sourceforge.net/projects/glpk-java/files/.

Unzip the archive with:

 tar -xzf glpk-java-1.0.21.tar.gz

Make and install with:

 cd glpk-java-1.0.21
 ./configure
 make
 make check
 sudo make install
When I typed make , the information is below (It looks fine!)

address@hidden libglpk-java-1.0.21]$ make
make  all-recursive
make[1]: Entering directory `/home/mrcupids/libglpk-java-1.0.21'
Making all in doc
make[2]: Entering directory `/home/mrcupids/libglpk-java-1.0.21/doc'
gzip -c libglpk-java.3 > libglpk-java.3.gz
make[2]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21/doc'
Making all in swig
make[2]: Entering directory `/home/mrcupids/libglpk-java-1.0.21/swig'
mkdir -p target/classes
mkdir -p target/apidocs
mkdir -p src/c
mkdir -p src/main/java/org/gnu/glpk
cp *.java src/main/java/org/gnu/glpk
/usr/bin/swig -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib/jvm/java-1.6.0-openjdk.                                                                                                                                            x86_64/include/linux -I/usr/include -I/usr/local/include  -java -package org.gnu.glpk \
  -o src/c/glpk_wrap.c -outdir src/main/java/org/gnu/glpk glpk.i
/bin/sh ../libtool --mode=compile gcc -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib                                                                                                                                            /jvm/java-1.6.0-openjdk.x86_64/include/linux -I/usr/include -I/usr/local/include  -I. -c -fPIC \
  src/c/glpk_wrap.c
libtool: compile:  gcc -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib/jvm/java-1.6.0                                                                                                                                            -openjdk.x86_64/include/linux -I/usr/include -I/usr/local/include -I. -c -fPIC src/c/glpk_wrap.c                                                                                                                                              -fPIC -DPIC -o .libs/glpk_wrap.o
libtool: compile:  gcc -I/usr/lib/jvm/java-1.6.0-openjdk.x86_64/include -I/usr/lib/jvm/java-1.6.0                                                                                                                                            -openjdk.x86_64/include/linux -I/usr/include -I/usr/local/include -I. -c -fPIC src/c/glpk_wrap.c                                                                                                                                             -o glpk_wrap.o >/dev/null 2>&1
/bin/sh ../libtool --mode=link \
  gcc -version-info 32:0:32 -revision 1.0.21 \
  -g -O -o libglpk_java.la -rpath /usr/local/lib/jni glpk_wrap.lo -lglpk
libtool: link: rm -fr  .libs/libglpk_java.a .libs/libglpk_java.la .libs/libglpk_java.lai .libs/li                                                                                                                                            bglpk_java.so .libs/libglpk_java.so.0 .libs/libglpk_java.so.0.32.0
libtool: link: gcc -shared  .libs/glpk_wrap.o   -lglpk    -Wl,-soname -Wl,libglpk_java.so.0 -o .l                                                                                                                                            ibs/libglpk_java.so.0.32.0
libtool: link: (cd ".libs" && rm -f "libglpk_java.so.0" && ln -s "libglpk_java.so.0.32.0" "libglp                                                                                                                                            k_java.so.0")
libtool: link: (cd ".libs" && rm -f "libglpk_java.so" && ln -s "libglpk_java.so.0.32.0" "libglpk_                                                                                                                                            java.so")
libtool: link: ar cru .libs/libglpk_java.a  glpk_wrap.o
libtool: link: ranlib .libs/libglpk_java.a
libtool: link: ( cd ".libs" && rm -f "libglpk_java.la" && ln -s "../libglpk_java.la" "libglpk_jav                                                                                                                                            a.la" )
/usr/bin/javadoc -sourcepath ./src/main/java org.gnu.glpk -d ./target/apidocs
Loading source files for package org.gnu.glpk...
Constructing Javadoc information...
Standard Doclet version 1.6.0_20
Building tree for all the packages and classes...
Generating ./target/apidocs/org/gnu/glpk//_glp_arc.html...
Generating ./target/apidocs/org/gnu/glpk//_glp_graph.html...
Generating ./target/apidocs/org/gnu/glpk//_glp_java_arc_data.html...
Generating ./target/apidocs/org/gnu/glpk//_glp_java_vertex_data.html...
Generating ./target/apidocs/org/gnu/glpk//_glp_vertex.html...
Generating ./target/apidocs/org/gnu/glpk//glp_attr.html...
Generating ./target/apidocs/org/gnu/glpk//glp_bfcp.html...
Generating ./target/apidocs/org/gnu/glpk//glp_cpxcp.html...
Generating ./target/apidocs/org/gnu/glpk//glp_data.html...
Generating ./target/apidocs/org/gnu/glpk//glp_iocp.html...
Generating ./target/apidocs/org/gnu/glpk//glp_iptcp.html...
Generating ./target/apidocs/org/gnu/glpk//glp_long.html...
Generating ./target/apidocs/org/gnu/glpk//glp_mpscp.html...
Generating ./target/apidocs/org/gnu/glpk//glp_prob.html...
Generating ./target/apidocs/org/gnu/glpk//glp_smcp.html...
Generating ./target/apidocs/org/gnu/glpk//glp_tran.html...
Generating ./target/apidocs/org/gnu/glpk//glp_tree.html...
Generating ./target/apidocs/org/gnu/glpk//GLPK.html...
Generating ./target/apidocs/org/gnu/glpk//GlpkCallback.html...
Generating ./target/apidocs/org/gnu/glpk//GlpkCallbackListener.html...
Generating ./target/apidocs/org/gnu/glpk//GLPKConstants.html...
Generating ./target/apidocs/org/gnu/glpk//GlpkException.html...
Generating ./target/apidocs/org/gnu/glpk//GLPKJNI.html...
Generating ./target/apidocs/org/gnu/glpk//GlpkTerminal.html...
Generating ./target/apidocs/org/gnu/glpk//GlpkTerminalListener.html...
Generating ./target/apidocs/org/gnu/glpk//LPXKKT.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_double.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_f_p_glp_tree_p_void__void.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_f_p_q_const__char_v_______void.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_f_p_void__void.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_f_p_void_p_q_const__char__int.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_int.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_p__glp_vertex.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_va_list.html...
Generating ./target/apidocs/org/gnu/glpk//SWIGTYPE_p_void.html...
Generating ./target/apidocs/org/gnu/glpk//package-frame.html...
Generating ./target/apidocs/org/gnu/glpk//package-summary.html...
Generating ./target/apidocs/org/gnu/glpk//package-tree.html...
Generating ./target/apidocs/constant-values.html...
Generating ./target/apidocs/serialized-form.html...
Building index for all the packages and classes...
Generating ./target/apidocs/overview-tree.html...
Generating ./target/apidocs/index-all.html...
Generating ./target/apidocs/deprecated-list.html...
Building index for all classes...
Generating ./target/apidocs/allclasses-frame.html...
Generating ./target/apidocs/allclasses-noframe.html...
Generating ./target/apidocs/index.html...
Generating ./target/apidocs/help-doc.html...
Generating ./target/apidocs/stylesheet.css...
/usr/bin/jar cf glpk-java-javadoc.jar -C ./target/apidocs .
/usr/bin/jar cf glpk-java-sources.jar -C ./src/main/java .
/usr/bin/javac -source 1.6 -target 1.6 -classpath ./src/main/java \
  -d ./target/classes *.java
/usr/bin/jar cf glpk-java.jar -C ./target/classes .
make[2]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21/swig'
make[2]: Entering directory `/home/mrcupids/libglpk-java-1.0.21'
make[2]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21'
make[1]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21'

But when I typed "make check" , it occured error like this.

address@hidden libglpk-java-1.0.21]$ make check
Making check in doc
make[1]: Entering directory `/home/mrcupids/libglpk-java-1.0.21/doc'
if test ! -f glpk-java.pdf;then echo glpk-java.pdf not found;exit 1; fi
make[1]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21/doc'
Making check in swig
make[1]: Entering directory `/home/mrcupids/libglpk-java-1.0.21/swig'
cd ../examples/java;/usr/bin/javac -source 1.6 -target 1.6 \
  -classpath ../../swig/glpk-java.jar Gmpl.java
cd ../examples/java;java -Djava.library.path=../../swig/.libs \
  -classpath ../../swig/glpk-java.jar:. Gmpl marbles.mod
The dynamic link library for GLPK for Java could not beloaded.
Consider using
java -Djava.library.path=
The current value of system property java.library.path is:
../../swig/.libs
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/mrcupids/libglpk-java-1.0.21/swig/.libs/libglpk_java.so.0.32.0: libglpk.so.0: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1675)
        at java.lang.Runtime.loadLibrary0(Runtime.java:840)
        at java.lang.System.loadLibrary(System.java:1047)
        at org.gnu.glpk.GLPKJNI.<clinit>(GLPKJNI.java:25)
        at org.gnu.glpk.GLPK.glp_term_hook(GLPK.java:869)
        at org.gnu.glpk.GlpkTerminal.<clinit>(GlpkTerminal.java:25)
        at Gmpl.solve(Gmpl.java:27)
        at Gmpl.main(Gmpl.java:12)
make[1]: *** [check] Error 1
make[1]: Leaving directory `/home/mrcupids/libglpk-java-1.0.21/swig'
make: *** [check-recursive] Error 1


And here is my other configure about this computer:

 glpsol --version
GLPSOL: GLPK LP/MIP Solver, v4.47

Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009, 2010, 2011 Andrew Makhorin, Department for Applied Informatics,
Moscow Aviation Institute, Moscow, Russia. All rights reserved.

This program has ABSOLUTELY NO WARRANTY.

This program is free software; you may re-distribute it under the terms
of the GNU General Public License version 3 or later.

 $JAVA_HOME/bin/javac -version
javac 1.6.0_20

java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.10) (fedora-55.1.9.10.fc14-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)

 swig -version

SWIG Version 2.0.1

Compiled with g++ [x86_64-redhat-linux-gnu]

Configured options: +pcre

Do I miss something here? Or I made other stupid mistake?

Best regards

Chung Yi

--
周宗毅 Chung-Yi Chou
SCOPELab, CS Department NTHU
Hsin-Chu, Taiwan, R.O.C
E mail : address@hidden





--
周宗毅 Chung-Yi Chou
SCOPELab, CS Department NTHU
Hsin-Chu, Taiwan, R.O.C
E mail : address@hidden



reply via email to

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