Compiling ROS on raspberry pi 4 with Buster, problem with libboost1.58
Hi,
I'm following this guide from the wiki: http://wiki.ros.org/ROSberryPi/Installing%20ROS%20Kinetic%20on%20the%20Raspberry%20Pi
It says the following:
On Raspbian Buster the compilation may fail with "'boost/tr1/unordered_set.hpp' file not found". This is because rospack version used in Kinetic is dependent on boost 1.58. To fix this error try installing boost 1.58 manually.
I've installed libboost 1.58 manually with this guide, chapter 5.1: https://www.boost.org/doc/libs/1_58_0/more/getting_started/unix-variants.html But i'm still getting errors regarding libboost, what am I missing?
Asked by kwint on 2019-07-02 09:18:33 UTC
Answers
I got finally install ROS Melodic+navigatiion+perception+navigation+opencv3.4.6. I only could not install gazebo 9 and ros_controls totally, I got it only partial. Sadly the proccess was crazy, and I couldn't document it, but I helped to get it to other person that kept the process and in the next days he tild going to open a github with the process. While that happens you can try the next: Forget kinetic, libboost1.58 and the official guide, mainly the part of the dependency collada. You must install Melodic from source.Install libboost1.65 and previous to the ros installation, and rosdep will do rest if some pkg must be upgraded to 1.67( as some 1.67 are needed for libogre and rviz). Before any compilation, you need find a alternative source of actionlib, as the official is broken and is the real problem. Afer make rosdep step,, put your alternative actionlib source (look for google results in korean or chinese and translate)and compile just action and its dependences with -- pkg option. If it doesn't compile, delete all except src folder, and try other different actionlib source. If it compile, just compile the rest as the tutorials
Feel free to contact with me or my FB group Raspberry Pi 4, the IMage will be posted there too, and I can try help you.
Asked by FPSychotic on 2019-08-04 05:40:52 UTC
Comments
@FPSychotic; I followed this post and successfully build most of the packages except 'rviz'. Could you please help me out? I am using libboost1.58 and gcc/g++ 5.0. If i update the libboost with 1.67, the build stops in starting at most of the packages. And as i followed up the ROS Kinetic RPi tutorial web, its mentioned to use gcc/g++ 5.0 and libboost1.58. here is the error log: https://pastebin.com/E4HRHZwu
Please help. Thanks.
Asked by Ashkr on 2019-10-30 04:11:27 UTC
@FPSychotic hi, so do u have the image of raspi with ros?
Asked by ridwan on 2020-08-18 11:54:54 UTC
I have a pi4b with buster, when I tried to install ros kinetic ,I just encountered the same problem, the reason seems to be that the C compiler (gcc-8) version is too high, and does not match boost1.58, I switched to gcc-5 and fortunately it worked, I've recorded my steps as follows:
1, uninstall libboost1.67-dev, and execute 'sudo apt autoremove' to clean up
2, install libboost1.58-dev and libboost1.58-all-dev
3, delete build_isolated and devel_isolated folders in the ~/ros_catkin_ws directory, you may need sudo to do this ( important!!! otherwise the compilation will still fail even if you've switched to gcc-5)
4, apt install gcc-5 and g++-5 and switch the default compiler to them(please Google how to switch)
5, gcc -v g++ -v to confirm that the version is 5.5.0, then the recompilation should be successful.
6, if you wish, switch back to gcc-8.
Good luck, and please tell me if it work on your pi4 ~
Asked by chubbyk on 2019-08-27 05:53:04 UTC
Comments
This worked for me very well! Thanks for your help!
Asked by stoianovici on 2019-09-10 17:57:44 UTC
Me too! You're a genius!
Asked by Old_Forester on 2019-09-11 19:11:30 UTC
For completeness, the following does exactly what @chubbyk suggested, including the switch to gcc-5
as default:
$ sudo apt remove libboost1.67-dev
$ sudo apt autoremove
$ sudo apt install libboost1.58-dev libboost1.58-all-dev
$ sudo apt install g++-5 gcc-5
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 10
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 10
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 20
$ sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
$ sudo update-alternatives --set cc /usr/bin/gcc
$ sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
$ sudo update-alternatives --set c++ /usr/bin/g++
$ sudo rm -rf ~/ros_catkin_ws/build_isolated
$ sudo rm -rf ~/ros_catkin_ws/devel_isolated
Asked by gonzalocasas on 2019-09-21 18:03:48 UTC
Somebody with rights to do so ought to add this part of the installation to the buster section of the official tutorial.
Asked by MoffKalast on 2019-10-17 09:53:33 UTC
@MoffKalast: that would be you, as a member of the community, after you register for an account on the wiki.
This is a community project.
There is no "official tutorial". Or at least, there is no official authority that keeps these things up-to-date or makes sure everything works "everywhere".
That would be you, me and the rest of the community.
So if you feel this requires changing, then please register for an account and update the tutorial.
Asked by gvdhoorn on 2019-10-18 04:29:00 UTC
I am very happy that my method has taken effect, but I still recommend that you compile and install melodic instead, which has no compiler problem. you can follow these steps in this website. https://www.seeedstudio.com/blog/2019/08/01/installing-ros-melodic-on-raspberry-pi-4-and-rplidar-a1m8/
Asked by chubbyk on 2019-10-24 04:02:24 UTC
Hi, i am facing the same erros ... I followed up the steps suggested by @chubbyk, @stoianovici, @Old_Forester and when recompile, it stuck at first package "catkin". Please help! Thanks. here is the error log: https://pastebin.com/KqFQvjgc Help Please!!
Asked by Ashkr on 2019-10-27 22:03:06 UTC
@gonzalocasas thank you very much for your code - I'm very new to linux/python. Do you or anyone know how to switch back to gcc 8? I don't want to break anything especially my now working ROS install trying to modify your gcc 5 code to revert back to 8.
Asked by cjk11091 on 2019-11-07 21:48:41 UTC
Comments
Facing a similar problem on pi 3 with Buster. Near the end, in rosout build, I get some warnings like
And then the following errors:
If I install libboost1.58, the versions in the warning swap places.
Asked by jesusrubio on 2019-07-04 12:36:11 UTC
I got the same errors. So I got this working in the end, but I'm not sure how. Here are the steps I toke, you might have some luck to: I installed and removed both versions of libboost via apt, I ended with having the newest version installed via apt, the older version manually (this took a bit less than an hour to install/compile). I then ran the command that is in the error message, it is something like
cd ***/independent-build/rosout && some other command
I ran that it got some permission error, so executed the second command with sudo. Reran the whole compilation and some other package had an error, did the same as with rosout. Then reran the whole compilation but still no luck. Finally I tried to run it with the-j2
argument, and then it somehow worked. I've spend almost a day playing and trying things, so I hope this gives you some things to work with and spare some time...Asked by kwint on 2019-07-04 14:01:53 UTC
same here I can get compile actionlib and rosbase installing libboost1.62, but this wil brake rviz because wont find libogre. -j2 I read that already in a couple of post with this related, try it. with buster you need install melodic no kinetic as they answered me here.
Asked by FPSychotic on 2019-07-18 16:47:57 UTC
Did anyone ever figure this problem out? "To fix this error try installing boost 1.58 manually." It seems like no one actually attempted to apply this fix and see that it actually doesn't work and also there are no instructions on how to install boost 1.58 on Raspberry Pi. I went ahead and did a manual install using:
I still end up getting the same boost/tr1/unordered_set.hpp error message!
Asked by Stigma on 2019-08-02 20:20:47 UTC
@Stigma: I believe you're running into #q328303.
Asked by gvdhoorn on 2019-08-03 05:37:39 UTC
I am unable to add the ROS Kinetic repo...get the same error as : https://answers.ros.org/question/329434/installing-ros-kinetic-on-the-raspberry-pi-no_pubkey-f42ed6fbab17c654/
How did you manage to install Ros?
Asked by bobsaccamano on 2019-08-03 19:17:50 UTC
This is not an answer. If you have a question, please post it as a question.
Asked by ahendrix on 2019-08-03 20:20:08 UTC