Hello Sylvain, ./configure --help
proposes: --enable-libpath load GLPK library from java.library.path [[default=no]] So what you want to do is: ./configure --enable-libpath I will not make this switch default to yes because at least Debian requires a different layout: /usr/lib: glpk.so /usr/lib/jni: glpk_java.so /usr/share/java: glpk-java.jar Best regards Heinrich Schuchardt On 03.12.2015 17:13, Sylvain Fournier wrote: > Hi Heinrich, > > No problem, I just asked out of curiosity. It is indeed pretty > straightforward to compile the code and build the libraries. > > Testing a little more, I noted a same kind of behaviour in Linux as the > one on Windows I previously reported. > I copied both GLPK libraries libglpk_java.so and libglpk.so (using the > -L option from the cp command) from the corresponding .libs directories > after compilation. I placed them in the same directory and added this > directory to the LD_LIBRARY_PATH. It is working all right unless I > remove the glpk libraries from the directories where they were compiled > (running for example "make clean"). In this case I get the following > error when I try to run my program: > java.lang.UnsatisfiedLinkError: (...)/libglpk_java.so: libglpk.so.36: > 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:1938) > at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854) > at java.lang.Runtime.loadLibrary0(Runtime.java:870) > at java.lang.System.loadLibrary(System.java:1122) > at org.gnu.glpk.GLPKJNI.<clinit>(GLPKJNI.java:29) > at org.gnu.glpk.GLPKConstants.<clinit>(GLPKConstants.java:12) > The result of command "ldd libglpk_java.so" contains the following > line: libglpk.so.36 => not found > On the other hand, if the original libraries still exist (before "make > clean"), this line gives, instead of "not found", the path to the > directory where "libglpk.so.36" (why not "libglpk.so" by the way?) was > compiled. > To prevent the UnsatisfiedLinkError from occuring without relying on the > original libraries, I then have to add a System.loadLibrary("glpk") in > Linux before calling the GLPK methods. > Did I miss something, such as a compilation parameter that would help > me? If not, wouldn't it possible to add (also for Linux) > this System.loadLibrary("glpk") before > the System.loadLibrary("glpk_java") in glpk.i? > > I am not sure I was very clear... But I hope you understood anyway! > Regards, > > *Sylvain Fournier* > > 2015-12-01 10:55 GMT-02:00 Heinrich Schuchardt <xypron.g...@gmx.de > <mailto:xypron.g...@gmx.de>>: > > Hello Sylvain, > > Linux libraries are provided by Debian, Ubuntu, Mint. Builing them > yourself just requires the standard procedure > ./configure > make > sudo make install > sudo ldconfig > > Hence I do not plan to provide Linux binaries. > > Best regards > > Heinrich Schuchardt > > http://www.xypron.de > > Am 01.12.15 um 13:42 schrieb Sylvain Fournier > > > Thanks Heinrich! > > > > http://sourceforge.net/projects/winglpk/ still contains the old > libraries, > > > > right? I'll test it after the next update and let you know if there is > any > > > > problem. > > > > And what about providing the Linux libraries in the next releases? > > > > > > > > *Sylvain Fournier* > > > > > > > > 2015-11-30 18:54 GMT-02:00 Heinrich Schuchardt <xypron.g...@gmx.de > <mailto:xypron.g...@gmx.de>>: > > > > > > > > > Hello Sylvain, > > > > > > > > > > I just released GLPK for Java 1.3.1 which fixes the error. > > > > > > > > > > Best regards > > > > > > > > > > Heinrich Schuchardt > > > > > > > > > > On 30.11.2015 19:26, Sylvain Fournier wrote: > > > > > > Hi Heinrich, > > > > > > > > > > > > I recently updated GLPK for Java to version 4.57 and I'd like > to share > > > > > > some considerations I had for the next versions. > > > > > > > > > > > > First, in my Windows application, I don't install GLPK for > Java in the > > > > > > system but instead I link directly to the .dll libraries > provided in the > > > > > > link you sent. When I try to execute my project, I get an > unsatisfied > > > > > > link error ("Can't find dependent libraries"), which enforces > me to load > > > > > > the GLPK library in my application using the following command: > > > > > > System.loadLibrary("glpk_4_57"); > > > > > > This line must be changed at each new GLPK version. On the > other hand, > > > > > > in my Linux application, I don't need to load this library: it > seems > > > > > > that the .so management is more "clever" on Linux and manages to > > > > > > automatically link to the right dependent library. > > > > > > My suggestion for the next GLPK for Java releases is to add > this library > > > > > > loading, if possible, just before the glpk_4_57_java library > loading in > > > > > > glpk.i. Or did I miss some explanation why it hasn't been done > until now? > > > > > > > > > > > > Finally, is there some reason why the Linux libraries (.so) > are not > > > > > > provided in any of the releases of GLPK or GLPK for Java? I > don't mind > > > > > > compiling the libraries when I have to update GLPK, but then > I'd like to > > > > > > understand why the libraries are given for Windows and not for > Linux. > > > > > > > > > > > > Regards, > > > > > > > > > > > > *Sylvain Fournier* > > > > > > > > > > > > 2015-11-08 23:27 GMT-02:00 Heinrich Schuchardt > <xypron.g...@gmx.de <mailto:xypron.g...@gmx.de> > > > > > > <mailto:xypron.g...@gmx.de <mailto:xypron.g...@gmx.de>>>: > > > > > > > > > > > > GLPK for Windows 4.57 has been released. It provides 32 > and 64 bit > > > > > > binaries for Windows. The project is located at > > > > > > http://winglpk.sourceforge.net . > > > > > > > > > > > > GLPK for Windows 4.57 includes GLPK for Java 1.3.0 and > GLPK for > > > > > C#/CLI > > > > > > 1.1.0. > > > > > > > > > > > > GLPK for Java provides a Java binding for the GLPK > library. The > > > > > project > > > > > > is located at http://glpk-java.sourceforge.net . > > > > > > > > > > > > GLPK for C#/CLI provide a Common Language Interface > binding for the > > > > > GLPK > > > > > > library it allows to use all programming languages > supported by Mono > > > > > and > > > > > > .NET together with GLPK, e.g. C#, Visual Basic .NET, and > F#. The > > > > > project > > > > > > is located at http://glpk-cli.sourceforge.net . The Git > repository > > > > > is > > > > > > located at https://github.com/xypron/glpk-cli . > > > > > > > > > > > > Best regards > > > > > > > > > > > > Heinrich Schuchardt > > > > > > > > > > > > _______________________________________________ > > > > > > Help-glpk mailing list > > > > > > Help-glpk@gnu.org <mailto:Help-glpk@gnu.org> > <mailto:Help-glpk@gnu.org <mailto:Help-glpk@gnu.org>> > > > > > > https://lists.gnu.org/mailman/listinfo/help-glpk > > > > > > > > > > > > > > > > > > > _______________________________________________ Help-glpk mailing list Help-glpk@gnu.org https://lists.gnu.org/mailman/listinfo/help-glpk