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

Cannot open shared object file: No such file or directory... part 2 #42

Open
zmajew opened this issue Jan 28, 2022 · 4 comments
Open

Cannot open shared object file: No such file or directory... part 2 #42

zmajew opened this issue Jan 28, 2022 · 4 comments

Comments

@zmajew
Copy link

zmajew commented Jan 28, 2022

I have followed the instructions from issue and still have:
/tmp/go-build1465283250/b001/exe/main: error while loading shared libraries: libtensorflowlite_c.so: cannot open shared object file: No such file or directory
exit status 127

I put the libtensorflowlite_c.so into the /usr/local/lib and export LD_LIBRARY_PATH=/usr/local/lib and in /etc/environment but does not help.
I am trying to run esrgan example.

tflite.go has:
/*
#ifndef GO_TFLITE_H
#include "tflite.go.h"
#endif
#cgo LDFLAGS: -ltensorflowlite_c
#cgo android LDFLAGS: -ldl
#cgo linux,!android LDFLAGS: -ldl -lrt
*/`
I am using Go 1.17

@mattn
Copy link
Owner

mattn commented Jan 28, 2022

What do you get:

$ ldd /usr/local/lib/libtensorflowlite_c.so

@zmajew
Copy link
Author

zmajew commented Jan 29, 2022

I have followed this instruction and solved the problem.
Now, on:
$ ldd /usr/local/lib/libtensorflowlite_c.so
I got:
linux-vdso.so.1 (0x00007ffcfc7f8000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f09843cd000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f098427e000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f098425b000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0984255000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f098424a000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f098422f000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f098403b000) /lib64/ld-linux-x86-64.so.2 (0x00007f0984889000)
But I still do not know where was the problem. On go get github.com/mattn/go-tflite it saw the usr/local/lib/libtensorflowlite_c.so but when I compiled the example it threw a "Cannot open shared object file..." error

@zmajew
Copy link
Author

zmajew commented Jan 29, 2022

I was trying to trace from where the path usr/local/lib was taken but I did not manage to find that.

@SpAndrea117
Copy link

I've had the same issue, and the problem was about the env var LD_LIBRARY_PATH that was empty. I've copied the .so file to /usr/local/lib and typed the following command -> export $LD_LIBRARY_PATH=/usr/local/lib and this fixed the problem. Don't if this solution can be helpful, anyway i've obtained the following output, launching the main.go (go run main.go) -> 85: peacock: 0.976471

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

No branches or pull requests

3 participants