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,