librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

can't finish LibUVC install on Raspberry Pi 4

Open GOBish opened this issue 7 years ago • 27 comments

Required Info
Camera Model { D435 }
Firmware Version (newest)
Operating System & Version Raspbian buster
Kernel Version (Linux Only) 4.19
Platform Raspberry Pi
SDK Version {
Language { }
Segment

Issue Description

I'm trying to install LibUVC on a raspberry pi 4, but when I try ./libuvc_installation.sh I get to 66% of the process and get the error

[ 60%] Linking CXX shared library librealsense2-gl.so [ 60%] Built target realsense2-gl make: *** [Makefile:130: all] Error 2 pi@raspberrypi:~ $

I would love some help! I have tried sudo apt-get update && sudo apt-get upgrade && sudo apt-dist-upgrade -y

GOBish avatar Sep 28 '19 03:09 GOBish

Are you using the script from libuvc_installation.md?

dorodnic avatar Sep 29 '19 06:09 dorodnic

https://github.com/IntelRealSense/librealsense/blob/master/doc/libuvc_installation.md

@dorodnic I am using all the instructions there, do you have any other advice? thanks.

GOBish avatar Sep 29 '19 12:09 GOBish

I'm waiting to get my Rpi4 to try the installation on. First steps of the script set-up swap file, without which installation fails due to lack of memory. If this is not the reason, I suspect something to do with OpenGL and graphics drivers. For Ubuntu 18 we ask to run: sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev Probably something similar needs to be done on the Pi.

dorodnic avatar Oct 02 '19 08:10 dorodnic

I got it working. Just add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -latomic") to the CMakeLists.txt file and compile.

AnupamYedida avatar Oct 05 '19 02:10 AnupamYedida

@AnupamYedida I really appreciate your help! Could you walk through the steps for me a little more clearly? I apologize, I don't have a ton of experience with this. How do I get to the cmakelists.txt file?

GOBish avatar Oct 05 '19 02:10 GOBish

It's in the librealsense-master directory. (Provided you ran the script)

AnupamYedida avatar Oct 05 '19 02:10 AnupamYedida

Hmm, I still get the same error at 60%. [ 60%] Linking CXX shared library librealsense2-gl.so [ 60%] Built target realsense2-gl make: *** [Makefile:130: all] Error 2

@AnupamYedida are you using Raspbian Buster?

GOBish avatar Oct 06 '19 00:10 GOBish

I tried it again, making all the changes to cmake files as described here (by @SirDifferential):

https://github.com/IntelRealSense/librealsense/issues/4375#issuecomment-509968417

and still could not complete the compile, got this error at 58%

make[2]: *** [examples/software-device/CMakeFiles/rs-software-device.dir/build.make:63: examples/software-de/github.com/IntelRealSense/librealsense/issues/4375#issuecomment-509968417vice/CMakeFiles/rs-software-device.dir/rs-software-device.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:511: examples/software-device/CMakeFiles/rs-software-device.dir/all] Error 2 make: *** [Makefile:130: all] Error 2

GOBish avatar Oct 06 '19 15:10 GOBish

It's the CMakeLists.txt file in the folder librealsense

AnupamYedida avatar Oct 06 '19 16:10 AnupamYedida

Thanks @AnupamYedida -- I did that in https://github.com/IntelRealSense/librealsense/issues/4950#issuecomment-538701444 and was still unsuccesful. Where in the CMakeLists.txt file did you put that line of code? Also, I just ran sudo apt-get install libatomic-ops-dev and I am re-compiling to see if that addresses my issue.

GOBish avatar Oct 06 '19 16:10 GOBish

I kept it in the top. It fixed the issue for me. I'm running it on 4.19 kernel, Raspberry Pi4, Debian Buster

AnupamYedida avatar Oct 06 '19 16:10 AnupamYedida

@AnupamYedida I don't know, I can't get it to work no matter what I try.

GOBish avatar Oct 06 '19 17:10 GOBish

This is what worked for me. Your mileage may vary. 4.19 kernel, Raspberry Pi4, Debian Buster with Neural Computer Stick 2

First run: sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev

Per the LibUVC installation instructions wget https://github.com/IntelRealSense/librealsense/raw/master/scripts/libuvc_installation.sh chmod +x ./libuvc_installation.sh ./libuvc_installation.sh

It will error at: [ 60%] Linking CXX shared library librealsense2-gl.so [ 60%] Built target realsense2-gl

find the location of your librealsense_build directory: pwd ~/librealsense_build

in my case it was /home/pi/librealsense_build

nano libuvc_installation.sh or edit with whatever editor you like

In libuvc_installation.sh change this: sudo rm -rf ./librealsense_build mkdir librealsense_build && cd librealsense_build

to this: #sudo rm -rf ./librealsense_build cd /home/pi/librealsense_build

*replace /home/pi/librealsense_build with your librealsense_build location

Find the CMakesLists.txt file in the librealsense-master directory Add set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -latomic") to the top of the CMakeLists.txt file.

Run: sudo ./libuvc_installation.sh

w3bm0nk3y avatar Oct 06 '19 22:10 w3bm0nk3y

@w3bm0nk3y I appreciate the help - but I still get the error at 60% in the compile even following the steps you outlined.

GOBish avatar Oct 07 '19 02:10 GOBish

OK, finally got it! I had to follow all the steps from both @AnupamYedida and @w3bm0nk3y . Thank you all for your help, very much appreciated.

GOBish avatar Oct 07 '19 03:10 GOBish

OK, finally got it! I had to follow all the steps from both @AnupamYedida and @w3bm0nk3y . Thank you all for your help, very much appreciated.

I realized I forgot to add the steps from @AnupamYedida to my response. I edited accordingly.

w3bm0nk3y avatar Oct 07 '19 15:10 w3bm0nk3y

Thanks for adding that @w3bm0nk3y ! Did you have any issues running the examples (i.e. rs-enumerate-devices, realsense-viewer, etc) after completing the compile? I am having errors in that it can't find the header info when I try to run anything even though I see the folders right there in the correct directory. Thanks!

GOBish avatar Oct 07 '19 23:10 GOBish

Which example are you attempting? I'll try to run it on my side and see if it works.

On Mon, Oct 7, 2019, 4:53 PM GOBish [email protected] wrote:

Thanks for adding that @w3bm0nk3y https://github.com/w3bm0nk3y ! Did you have any issues running the examples after completing the compile? I am having errors in that it can't find the header info when I try to run anything even though I see the folders right there in the correct directory. Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/IntelRealSense/librealsense/issues/4950?email_source=notifications&email_token=AAE7WCSBRPUTHHTJYDMO6GTQNPDXRA5CNFSM4I3MSUAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEASFSZQ#issuecomment-539253094, or mute the thread https://github.com/notifications/unsubscribe-auth/AAE7WCSDGKAHTWYGMKVEGLLQNPDXRANCNFSM4I3MSUAA .

w3bm0nk3y avatar Oct 08 '19 01:10 w3bm0nk3y

sorry, added to my post later -- any of the examples, like rs-enumerate-devices or realsense-viewer. I think there is just some path I have to add somewhere, I just can't figure out where. If you could copy here how you are running those examples as well (how you are running it in the shell) that may be helpful for me as well.

rs-hello-realsense.cpp:4:10: fatal error: librealsense2/rs.hpp: No such file or directory #include <librealsense2/rs.hpp> // Include RealSense Cross Platform API

GOBish avatar Oct 08 '19 01:10 GOBish

I start with a fresh Rasbian on Raspberry pi 4, 4gb RAM start with install opencv and then follow Raspbian(RaspberryPi3) Installation

also adding set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -latomic") to CMAKELIST.txt and it worked with build from source, not the Libuvc

I remember seeing a method putting -D___CXX_FLAGS-latomic can also work, which is giving variable in the terminal, but I can'T find it now

soarwing52 avatar Oct 08 '19 10:10 soarwing52