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

Unable to find shared libraries after installing DeepLabel #39

Closed
absagargupta opened this issue Mar 3, 2023 · 15 comments
Closed

Unable to find shared libraries after installing DeepLabel #39

absagargupta opened this issue Mar 3, 2023 · 15 comments
Labels

Comments

@absagargupta
Copy link

Hi there
After the build as soo as I tried running it from the terminal with ./DeepLabel.pro, I would get an error
"/DeepLabel.pro: line 7: QT: command not found
./DeepLabel.pro: line 9: syntax error near unexpected token QT_MAJOR_VERSION,' ./DeepLabel.pro: line 9: greaterThan(QT_MAJOR_VERSION, 4): QT += widgets'
"
Also I have already installed QT and is working on Ubuntu20.04. Any help will be appreciated

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Mar 3, 2023

That's just a configuration file. When you build the program you'll get a binary file. Did you compile deeplabel?

@absagargupta
Copy link
Author

It says "Project MESSAGE: Linux"

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Mar 3, 2023

Apologies I misunderstood, see above. To run deeplabel once you've compiled it, a new executable will be created. The Pro file is for configuration, it's not the program.

Do you see a folder called release anywhere?

@absagargupta
Copy link
Author

Yes there is folder called release. As I try to run ./deeplabel in it, it shows me another error of "./deeplabel: error while loading shared libraries: libopencv_core.so.4.5: cannot open shared object file: No such file or directory" even though I had installed Opencv.

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Mar 3, 2023

Can you paste the output from ldd deeplabel?

But that is indeed the file. You can also try to double check by opening the Pro file in Qt Creator and trying to run it through there.

It sounds like you need to set up your PATH to include the OpenCV libraries.

@absagargupta
Copy link
Author

Here is the output of the same

linux-vdso.so.1 (0x00007ffd99cd3000)
/usr/local/lib/AppProtection/libAppProtection.so (0x00007fd2b4d2f000)
libprotobuf.so.17 => /lib/x86_64-linux-gnu/libprotobuf.so.17 (0x00007fd2b4a16000)
libopencv_core.so.4.5 => not found
libopencv_imgproc.so.4.5 => not found
libopencv_imgcodecs.so.4.5 => not found
libopencv_tracking.so.4.5 => not found
libopencv_video.so.4.5 => not found
libopencv_videoio.so.4.5 => not found
libopencv_dnn.so.4.5 => not found
libQt5Widgets.so.5 => /lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007fd2b4379000)
libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007fd2b3d8e000)
libQt5Sql.so.5 => /lib/x86_64-linux-gnu/libQt5Sql.so.5 (0x00007fd2b3d3e000)
libQt5Concurrent.so.5 => /lib/x86_64-linux-gnu/libQt5Concurrent.so.5 (0x00007fd2b3d35000)
libQt5Xml.so.5 => /lib/x86_64-linux-gnu/libQt5Xml.so.5 (0x00007fd2b3cf3000)
libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007fd2b37aa000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fd2b35c8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd2b3479000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fd2b345c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd2b326a000)
/lib64/ld-linux-x86-64.so.2 (0x00007fd2b5087000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd2b3247000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd2b3241000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fd2b3104000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fd2b30da000)
libXi.so.6 => /lib/x86_64-linux-gnu/libXi.so.6 (0x00007fd2b30c6000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fd2b30aa000)
libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fd2b3022000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fd2b2fea000)
libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fd2b2ee6000)
libicui18n.so.66 => /lib/x86_64-linux-gnu/libicui18n.so.66 (0x00007fd2b2be5000)
libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007fd2b29ff000)
libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007fd2b297b000)
libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007fd2b2965000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fd2b283c000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fd2b2834000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fd2b282c000)
libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007fd2b2817000)
libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fd2b275f000)
libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fd2b272b000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fd2b266c000)
libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fd2b263d000)
libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007fd2b0b7c000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fd2b0b09000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fd2b0aef000)

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Mar 3, 2023

Ok, couple of follow ups:

  1. Where is OpenCV installed? Did you install it from source, or via a package manager?
  2. What does your PATH variable contain (the problem seems to be that OpenCV is not on your path)

@absagargupta
Copy link
Author

Sure:

  1. I used the code given from the repo itself:
    `git clone https://github.com/opencv/opencv
    git clone https://github.com/opencv/opencv_contrib
    cd opencv && git checkout 4.5.3 && cd ../
    cd opencv_contrib && git checkout 4.5.3 && cd ../

cd opencv
mkdir build && cd build
cmake .. -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules
make -j8
sudo make install`
2. I am unable to find the PATH variable. I had installed it inside the deeplabel.

@jveitchmichaelis
Copy link
Owner

PATH is a system variable - it doesn't have anything to do with deelabel. It's where Linux will look for libraries when a program runs. http://www.linfo.org/path_env_var.html

Can you confirm where the OpenCV library is installed to? (something like /usr/local) and what your PATH variable contains? (echo $PATH)

@jveitchmichaelis jveitchmichaelis changed the title Issue in running the DeepLabel.pro Unable to find shared libraries after installing DeepLabel Mar 3, 2023
@absagargupta
Copy link
Author

absagargupta commented Mar 3, 2023

Ohh okay.
My PATH variable does not contain any opencv related variable. Here is the output to echo $PATH "/home/sagar/.pyenv/plugins/pyenv-virtualenv/shims:/home/sagar/.pyenv/bin:/home/sagar/miniconda3/condabin:/home/sagar/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
"

While searching online I found a way:
I search using sudo find / -name "libopencv_core.so.4.5*"
It gave me back the response as "/media/auto-annotation/deeplabel/opencv/build/lib/libopencv_core.so.4.5.3"

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Mar 3, 2023 via email

@absagargupta
Copy link
Author

absagargupta commented Mar 3, 2023

Thanks so much it got resolved. I set the path using the LD_LIBRARY_PATH. But Now I am getting another error of "./deeplabel: symbol lookup error: ./deeplabel: undefined symbol: _ZN2cv3dnn14dnn4_v202106083Net20setPreferableBackendEi" on running it. Should I open another issue or continue here ?

@jveitchmichaelis
Copy link
Owner

jveitchmichaelis commented Mar 3, 2023

We can still continue here, that looks like we can't find some function in opencv (part of the DNN module). Can you run the build script for opencv and paste the output of cmake? It should list which modules were built.

It's possible that you're missing some dependency for opencv that caused it to skip some module. See here for the options that are used on GitHub actions:

https://github.com/jveitchmichaelis/deeplabel/blob/master/.github/workflows/build_ubuntu.yml

@absagargupta
Copy link
Author

Sorry My bad. Actually I had earlier same version of openCV installed in another path and that was in my LD_LIBRARY. I unset the variables and gave the path of the openCV that you gave along with it. It started working after that. Thank you so much. You are a saviour. Coffee is on me if and when we meet.

@jveitchmichaelis
Copy link
Owner

Fantastic. Please feel free to post another issue if you run into trouble :)

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

2 participants