Ask Your Question

Compiling ROS on raspberry pi 4 with Buster, problem with libboost1.58

asked 2019-07-02 09:18:33 -0500

kwint gravatar image


I'm following this guide from the wiki:

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: But i'm still getting errors regarding libboost, what am I missing?

edit retag flag offensive close merge delete


Facing a similar problem on pi 3 with Buster. Near the end, in rosout build, I get some warnings like, needed by /opt/ros/kinetic/lib/, may conflict with

And then the following errors:

/usr/bin/ld: /opt/ros/kinetic/lib/ undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
/usr/bin/ld: /opt/ros/kinetic/lib/ undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/rosout.dir/build.make:103: /home/pi/ros_catkin_ws/devel_isolated/rosout/lib/rosout/rosout] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/rosout.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

If I install libboost1.58, the versions in the warning swap places.

jesusrubio gravatar imagejesusrubio ( 2019-07-04 12:36:11 -0500 )edit

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 ...(more)

kwint gravatar imagekwint ( 2019-07-04 14:01:53 -0500 )edit

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.

FPSychotic gravatar imageFPSychotic ( 2019-07-18 16:47:57 -0500 )edit

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:

sudo apt-get install libboost1.58-dev
sudo apt-get install libboost1.58-tools-dev

I still end up getting the same boost/tr1/unordered_set.hpp error message!

Stigma gravatar imageStigma ( 2019-08-02 20:20:47 -0500 )edit

@Stigma: I believe you're running into #q328303.

gvdhoorn gravatar imagegvdhoorn ( 2019-08-03 05:37:39 -0500 )edit

I am unable to add the ROS Kinetic repo...get the same error as :

How did you manage to install Ros?

bobsaccamano gravatar imagebobsaccamano ( 2019-08-03 19:17:50 -0500 )edit

This is not an answer. If you have a question, please post it as a question.

ahendrix gravatar imageahendrix ( 2019-08-03 20:20:08 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-08-27 05:54:57 -0500

chubbyk gravatar image

updated 2019-08-27 21:29:37 -0500

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 ~

edit flag offensive delete link more


This worked for me very well! Thanks for your help!

stoianovici gravatar imagestoianovici ( 2019-09-10 17:57:44 -0500 )edit

Me too! You're a genius!

Old_Forester gravatar imageOld_Forester ( 2019-09-11 19:11:30 -0500 )edit

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
gonzalocasas gravatar imagegonzalocasas ( 2019-09-21 18:03:48 -0500 )edit

Somebody with rights to do so ought to add this part of the installation to the buster section of the official tutorial.

MoffKalast gravatar imageMoffKalast ( 2019-10-17 09:53:33 -0500 )edit

@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.

gvdhoorn gravatar imagegvdhoorn ( 2019-10-18 04:29:00 -0500 )edit

answered 2019-08-04 05:40:52 -0500

FPSychotic gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-07-02 09:18:33 -0500

Seen: 863 times

Last updated: Aug 27