L.S.,
I am experimenting with the new Foreign Function and Memory API in Java 21/22. As a test case I am trying to reimplement one of the GLS examples (finding the roots of an order-5 polynomial). The example compiles and runs just fine in pure C (using-lgsl -lgslcblas -lm flags), but when I try to run it with my Java code, I get the following:
Exception in thread "main" java.lang.UnsatisfiedLinkError: /usr/lib64/libgsl.so.27.0.0: /usr/lib64/libgsl.so.27.0.0: undefined symbol: cblas_ctrmv
Which indicates that it cannot properly link when loading libgsl.
I am explicitly loading the libraries in this order:
System.loadLibrary("m");
System.loadLibrary("gslcblas");
System.loadLibrary("gsl");
And using nm I can find the “missing” symbol in libgslcblas.so. But when I run ldd against libgsl.so (as advised by the all-knowing Google) I get this:
# ldd libgsl.so
linux-vdso.so.1 (0x00007ffc51eea000)
libm.so.6 => /lib64/libm.so.6 (0x00007f8b27746000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8b27000000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8b27849000)
Now, I can´t claim to be a C hero by any means. But the Google soothsayer tells me there have been problems in the past on different distro’s (including OpenSuSE) with libgsl not being linked against libgslcblas when it was compiled. Could that be the case here? And if so, any ideas on a workaround?
Thanks in advance,
Ben.