java.lang.UnsatisfiedLinkError within one Java environment, not another

470 views
Skip to first unread message

Garrett Smith

unread,
Mar 8, 2016, 8:25:38 AM3/8/16
to jblas-users
Hello, jblas world:

I'm trying to run jblas in some unit tests within Teamcity (a build server).  There is something about the environment that is causing jblas to not work, whereas on the same host from the command line jblas works fine.

My native fu isn't strong; where should I be looking to resolve this issue?  The key error message, I believe, is:
ERROR Couldn't load copied link file: java.lang.UnsatisfiedLinkError: /tmp/jblas3234226563864457130/libjblas_arch_flavor.so: libquadmath.so.0: cannot open shared object file: No such file or directory.

The first transcript below is a test and its failing output.  The second is the successful jblas main() being run from the command line.and some OS/java details.

    @Test
    public void testBuild() {
        System.out.println("825972948724");
        runAndOutput(new String[]{"cat", "/etc/redhat-release"});

        try {
            org.jblas.benchmark.Main.main(new String[]{});
        } catch (java.lang.UnsatisfiedLinkError e) {
            e.printStackTrace();
        }
        System.out.println("825972948724");
    }

Gives:
   
825972948724
CentOS release 6.5 (Final)
Simple benchmark for jblas

Running sanity benchmarks.
-- org.jblas INFO jblas version is 1.2.4
checking vector addition... ok

-- org.jblas CONFIG BLAS native library not found in path. Copying native library from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG ArchFlavor native library not found in path. Copying native library libjblas_arch_flavor from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG Loading libjblas_arch_flavor.so from /lib/static/Linux/amd64/, copying to libjblas_arch_flavor.so.
-- org.jblas ERROR Couldn't load copied link file: java.lang.UnsatisfiedLinkError: /tmp/jblas3234226563864457130/libjblas_arch_flavor.so: libquadmath.so.0: cannot open shared object file: No such file or directory.

On Linux 64bit, you need additional support libraries.
You need to install libgfortran3.

For example for debian or Ubuntu, type "sudo apt-get install libgfortran3"

For more information, see https://github.com/mikiobraun/jblas/wiki/Missing-Libraries
java.lang.UnsatisfiedLinkError: org.jblas.NativeBlas.dgemm(CCIIID[DII[DIID[DII)V
  at org.jblas.NativeBlas.dgemm(Native Method)
  at org.jblas.SimpleBlas.gemm(SimpleBlas.java:247)
  at org.jblas.DoubleMatrix.mmuli(DoubleMatrix.java:1781)
  at org.jblas.DoubleMatrix.mmul(DoubleMatrix.java:3138)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:483)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)


From the command line:   

$ cat /etc/redhat-release
CentOS release 6.5 (Final)

$ uname -a
Linux xxx 2.6.32-431.5.1.el6.x86_64 #1 SMP Wed Feb 12 00:41:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ /site/apps/jdk1.8.0_20/bin/java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
$ /site/apps/jdk1.8.0_20/bin/java -jar jblas-1.2.4.jar
-- org.jblas INFO jblas version is 1.2.4
Simple benchmark for jblas

Running sanity benchmarks.

checking vector addition... ok
-- org.jblas CONFIG BLAS native library not found in path. Copying native library from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG ArchFlavor native library not found in path. Copying native library libjblas_arch_flavor from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH).
-- org.jblas CONFIG Loading libjblas_arch_flavor.so from /lib/static/Linux/amd64/, copying to libjblas_arch_flavor.so.
-- org.jblas CONFIG Loading libjblas.so from /lib/static/Linux/amd64/sse3/, copying to libjblas.so.
checking matrix multiplication... ok
checking existence of dsyev...... ok
[-0.210656, -0.640445, -0.451188; -0.509085, -0.116445, 0.796815; -0.807515, 0.407556, -0.398408; 0.210656, 0.640445, -0.052780]
[17.233688; 1.414214; 0.000000]
[-0.470605, 0.782218, 0.408248; -0.571449, 0.082339, -0.816497; -0.672293, -0.617540, 0.408248]
[17.233688; 1.414214; 0.000000]
checking existence of dgesvd...... ok
Checking complex return values... (z = -21.0 + 88.0i)
Check whether we're catching XERBLA errors. If you see something like "** On entry to DGEMM  parameter number  4 had an illegal value", it didn't work!
checking XERBLA... ok
Sanity checks passed.

Each benchmark will take about 5 seconds...

Running benchmark "Java matrix multiplication, double precision".
n = 10   :  1.669 GFLOPS (4172042 iterations in 5.0 seconds)
n = 100  :  2.432 GFLOPS (6081 iterations in 5.0 seconds)
n = 1000 :  2.443 GFLOPS (7 iterations in 5.7 seconds)

Running benchmark "Java matrix multiplication, single precision".
n = 10   :  1.977 GFLOPS (4942166 iterations in 5.0 seconds)
n = 100  :  1.735 GFLOPS (4338 iterations in 5.0 seconds)
n = 1000 :  1.998 GFLOPS (5 iterations in 5.0 seconds)

Running benchmark "native matrix multiplication, double precision".
n = 10   :  1.597 GFLOPS (3991623 iterations in 5.0 seconds)
n = 100  :  6.260 GFLOPS (15650 iterations in 5.0 seconds)
n = 1000 :  6.217 GFLOPS (16 iterations in 5.1 seconds)

Running benchmark "native matrix multiplication, single precision".
n = 10   :  1.568 GFLOPS (3919306 iterations in 5.0 seconds)
n = 100  : 11.342 GFLOPS (28354 iterations in 5.0 seconds)
n = 1000 : 18.669 GFLOPS (47 iterations in 5.0 seconds)
-- org.jblas INFO Deleting /tmp/jblas4500506499425567230/libjblas_arch_flavor.so
-- org.jblas INFO Deleting /tmp/jblas4500506499425567230/libjblas.so
-- org.jblas INFO Deleting /tmp/jblas4500506499425567230

Mikio Braun

unread,
Mar 8, 2016, 10:46:02 AM3/8/16
to jblas...@googlegroups.com
Hi Garrett,

it seems libquadmath.so is not installed on the teamcity server.

According to this https://www.centos.org/forums/viewtopic.php?t=3237
CentOS 6 is using an old version of gcc which does not yet have the
corresponding library. It suggest upgrading to a newer version or
another operating system.

What suprises me a bit is that I'm actually rebuilding the final jblas
on a VM'ed CentOS to get the older dependencies... .

Hope this helps,

Mikio
> --
> You received this message because you are subscribed to the Google Groups
> "jblas-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jblas-users...@googlegroups.com.
> To post to this group, send email to jblas...@googlegroups.com.
> Visit this group at https://groups.google.com/group/jblas-users.
> For more options, visit https://groups.google.com/d/optout.



--
Mikio Braun - http://blog.mikiobraun.de, http://twitter.com/mikiobraun

Garrett Smith

unread,
Mar 9, 2016, 11:23:46 AM3/9/16
to jblas-users
Hi Mikio,

Once I pointed the LD_LIBRARY_PATH to a different gcc version all was well.

Thanks,
Garrett
Reply all
Reply to author
Forward
0 new messages