eaplatanios / tensorflow_scala

TensorFlow API for the Scala Programming Language
http://platanios.org/tensorflow_scala/
Apache License 2.0
939 stars 95 forks source link

Unsatisfied link error - Shipped JNI linking on CentOS #168

Closed ashwinravishankar closed 4 years ago

ashwinravishankar commented 5 years ago

Surprisingly, I'm currently facing this same issue as this error #29 . A program which works well on my mac, throws this same error when I run on a CentOS 7 machine. I'm using JDK 11, and the precompiled binaries - 0.4.1 of artifact tensorflow_2.21. I update the flag to linux-cpu-x86_64 on mac, use Maven to package it to a JAR, then ship to CentOS7.

StackTrace:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/tensorflow_scala_native_libraries8675119614557414070/libtensorflow_jni.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /tmp/tensorflow_scala_native_libraries8675119614557414070/libtensorflow_jni.so)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
    at java.lang.Runtime.load0(Runtime.java:809)
    at java.lang.System.load(System.java:1086)
    at org.platanios.tensorflow.jni.TensorFlow$.$anonfun$load$4(TensorFlow.scala:95)
    at org.platanios.tensorflow.jni.TensorFlow$.$anonfun$load$4$adapted(TensorFlow.scala:93)
    at scala.Option.foreach(Option.scala:274)
    at org.platanios.tensorflow.jni.TensorFlow$.load(TensorFlow.scala:93)
    at org.platanios.tensorflow.jni.TensorFlow$.<init>(TensorFlow.scala:155)
    at org.platanios.tensorflow.jni.TensorFlow$.<clinit>(TensorFlow.scala)
    at org.platanios.tensorflow.jni.Tensor$.<init>(Tensor.scala:24)
    at org.platanios.tensorflow.jni.Tensor$.<clinit>(Tensor.scala)
    at org.platanios.tensorflow.api.tensors.Tensor$.fill(Tensor.scala:835)
    at org.platanios.tensorflow.api.tensors.Tensor$.zeros(Tensor.scala:726)
    at com.cambridgesemantics.anzograph.tf.TFVersion.apply(TFVersion.scala:37)
    at Test.main(Test.java:9)

To get more insight on what dependencies am missing, I tried:

[ashwinravishankar@ash-test-00 so]$ ldd libtensorflow_jni.so
ldd: warning: you do not have execution permission for `./libtensorflow_jni.so'
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./libtensorflow_jni.so)
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/ashwinravishankar/so/./libtensorflow.so)
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/ashwinravishankar/so/./libtensorflow.so)
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/ashwinravishankar/so/./libtensorflow.so)
./libtensorflow_jni.so: /lib64/libm.so.6: version `GLIBC_2.23' not found (required by /home/ashwinravishankar/so/./libtensorflow.so)
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/ashwinravishankar/so/./libtensorflow_framework.so)
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/ashwinravishankar/so/./libtensorflow_framework.so)
./libtensorflow_jni.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /home/ashwinravishankar/so/./libtensorflow_framework.so)
    linux-vdso.so.1 =>  (0x00007ffc72fd8000)
    libtensorflow.so => /home/ashwinravishankar/so/./libtensorflow.so (0x00007f5e79fde000)
    libtensorflow_framework.so => /home/ashwinravishankar/so/./libtensorflow_framework.so (0x00007f5e79204000)
    libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f5e78efd000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f5e78ce7000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f5e7891a000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f5e78716000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f5e784fa000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f5e781f8000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f5e77ff0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f5e821d4000)
eaplatanios commented 4 years ago

Sorry for the late response. This looks like you're probably using an older version of GLIBC. I'll close this because it's not a TF Scala bug, but if you're still interested / having issues, I'm happy to try and help.