Hello Sylvain, Sylvain Fournier wrote: > > I then saw that there is a glpk_4_38_java library available ( > http://winglpk.sourceforge.net/), I tried it on Windows and it seems to > work > fine. But there is a problem of organization in my code, as I use a > different Java interface when running on Linux and when running on > Windows. > So finally, my question on this subject is: is there a Java interface > equivalent as the one found at http://winglpk.sourceforge.net/, but for > Linux? In other words, has the glpk_4_38_java.dll also been compiled under > Linux as a .so? >
The commands below can be used to create the libraries. Currently I am puzzled because the call to GLPK.glp_create_prob() works fine, while GLPK.glp_mpl_alloc_wksp() fails with java: symbol lookup error: /usr/local/lib/libglpk_4_38_java.so: undefined symbol: glp_mpl_alloc_wksp Best regards Xypron # download and unzip wget ftp://ftp.gnu.org/gnu/glpk/glpk-4.38.tar.gz tar -xzf glpk-4.38.tar.gz wget http://freefr.dl.sourceforge.net/sourceforge/winglpk/glpsol_dll-4.38-32bit.zip unzip -o glpsol_dll-4.38-32bit.zip # make and install glpk cd glpk-4.38 ./configure --enable-dl --enable-odbc sudo make install # create libraries with swig cd swig mkdir src mkdir src/java mkdir java mkdir java/org mkdir java/org/gnu mkdir java/org/gnu/glpk swig -c++ -java -package org.gnu.glpk -o src/java/glpk_wrap.c -outdir java/org/gnu/glpk glpk.i g++ -c -fpic src/java/glpk_wrap.c -I../include -I/usr/lib/jvm/java-6-sun/include -I/usr/lib/jvm/java-6-sun/include/linux g++ -shared glpk_wrap.o -lglpk -lltdl -lgmp -o libglpk_4_38_java.so sudo cp libglpk_4_38_java.so /usr/local/lib cd java/org/gnu/glpk javac *.java cd ../../.. jar cf glpk.jar * # make and try example cd ../../examples javac -cp ../swig/java/glpk.jar GLPKSwig.java java --cp ../swig/java/glpk.jar:. GLPKSwig -- View this message in context: http://www.nabble.com/GLPK-4.38-for-Java-under-Linux-tp23671681p23686380.html Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com. _______________________________________________ Help-glpk mailing list Help-glpk@gnu.org http://lists.gnu.org/mailman/listinfo/help-glpk