Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError: /tmp/javacpp4839791561492098/libjniopencv_core.so #436

Closed
surezsivam opened this issue Jun 21, 2016 · 9 comments
Labels

Comments

@surezsivam
Copy link

Hello,

I am trying deeplearning4j for Image Recognition, able to run the code in my local ubuntu(16.04) machine with no issues(using intelliJ). when i move the code to ubuntu(14.04) server, facing the below issue.

https://gist.github.com/surezsivam/a3557f4af6befd089d4da75f086aa34d

Using the same pom.xml without any modification from deeplearning4j examples.

@saudet
Copy link
Member

saudet commented Jun 22, 2016

Could you also provide the stack trace that comes with the exception?

@surezsivam
Copy link
Author

surezsivam commented Jun 22, 2016

Hi,

I have copied the stack trace in the provided gist link.

Please let me know if you have any problem accessing it.

Thanks

@saudet
Copy link
Member

saudet commented Jun 22, 2016

Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp4839791561492098/libjniopencv_core.so: libgomp.so.1: cannot open shared object file: No such file or directory

That means OpenMP is missing from your system, so try to install it.

@surezsivam
Copy link
Author

I am getting this now.

Caused by: java.lang.UnsatisfiedLinkError: /tmp/javacpp4923781916138838/libjnind4j.so: /usr/lib/x86_64-linux-gnu/libgomp.so.1: version `GOMP_4.0' not found (required by /tmp/javacpp4923781916138838/libnd4j.so)

my libraries are here
/usr/lib/gcc/x86_64-linux-gnu/4.8.4$ ls -l libgomp*
-rw-r--r-- 1 root root 121532 May 7 06:30 libgomp.a
lrwxrwxrwx 1 root root 38 May 7 06:30 libgomp.so -> ../../../x86_64-linux-gnu/libgomp.so.1
-rw-r--r-- 1 root root 165 May 7 06:29 libgomp.spec

AND

/usr/lib/gcc/x86_64-linux-gnu/4.8$ ls -l libgomp*
-rw-r--r-- 1 root root 121532 May 7 06:30 libgomp.a
lrwxrwxrwx 1 root root 38 May 7 06:30 libgomp.so -> ../../../x86_64-linux-gnu/libgomp.so.1
-rw-r--r-- 1 root root 165 May 7 06:29 libgomp.spec

@surezsivam
Copy link
Author

surezsivam commented Jun 22, 2016

Never mind, Got it fixed by installing gcc 5 version
Ref : http://askubuntu.com/questions/618474/how-to-install-the-latest-gcurrently-5-1-in-ubuntucurrently-14-04

Thanks for your support. Appreciated.

@saudet
Copy link
Member

saudet commented Jun 23, 2016

I see. I tried to bundle OpenMP, but since it's pretty much a system library, I think users will need to make sure to have it installed. It might not be something we can bundle after all...

@mavriksc
Copy link
Contributor

I had this same issue. Was working on Windows and it would run fine locally and from jar, but not on aws, all other features of the project worked but the opencv was failing with the same error. Turns out git installed lipgomp on windows and i'm sure on my Ubuntu box where it was working too.
to fix on AWS i ran apt-get install libgomp1 and yum install libgomp on AWS-ubuntu server and AWS-redhat respectively i'm sure i may be missing something in maven to get it to include that but this works and i'm sure it doesn't hurt for the environment to have that. my project that uses JavaCv Thanks for your hard work. this may be usefull for someone getting into template matching and uses Mat instead of ImImpl and can read image from resource stream from jar.

@saudet saudet added the bug label Sep 30, 2016
@saudet
Copy link
Member

saudet commented Sep 30, 2016

I confirmed that we can bundle libgomp.so.1 to fix this, so let's do that!

saudet added a commit to bytedeco/javacpp-presets that referenced this issue Sep 30, 2016
@saudet
Copy link
Member

saudet commented Dec 9, 2016

libgomp.so.1 now gets bundled starting with version 1.3, so this error should not happen anymore. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants