SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.67k stars 525 forks source link

TBB does not have `tbb_stddef.h` anymore #469

Closed goekce closed 2 years ago

goekce commented 2 years ago

Required Info:

Steps to reproduce issue

Compilation

Expected behavior

Compilation succeeds

Actual behavior

I get the following error during compilation

CMake Error at CMake/FindTBB.cmake:400 (file):                                                                                                                                                                                               
  file STRINGS file "/usr/include/tbb/tbb_stddef.h" cannot be read.                                                                                                                                                                          
Call Stack (most recent call first):                                                                                                                                                                                                         
  lib/karto_sdk/CMakeLists.txt:15 (find_package)

Additional information

https://github.com/SteveMacenski/slam_toolbox/blob/8b251f1a4c8bb84b9dc3376cd8c3511826dd4e9b/CMake/FindTBB.cmake#L399-L403

Intel TBB does not seem to have tbb_stddef.h anymore since version 2021.1 [1]. I have the version 2021.5.0.

SteveMacenski commented 2 years ago

We don’t specifically support Arch. Happy to have a PR that would enable it, but that isn’t a target platform for ROS2 (yet) so we have no explicit expectation of support out of the box

goekce commented 2 years ago

Thanks Steve, I also do not expect that ROS supports Archlinux :) I thought Ubuntu will probably also update libtbb-dev in the next months so it is better to include the patch. Then it is better to wait for Ubuntu to update the package.

m2-farzan commented 2 years ago

For future reference:

  1. The new version of TBB (>= 2021.1) comes with cmake discovery included. So we no longer need FindTBB.cmake file. We just have to use find_package(TBB REQUIRED) and target_link_libraries(... TBB::tbb)
  2. TBB (>= 2021.1) has retired some of its functions but there are close equivalents for all of our use cases.

Based on these points I have put together a patch that makes slam_toolbox compile against the new version of tbb but I don't know tbb so I'm not sure about correctness of my patch. Plus, ubuntu still has the old version (even 22.04 comes with 2018.12) so I guess there's no point in making a PR now...

SteveMacenski commented 2 years ago

Got it! Thanks for the detail, I imagine we’ll be needing it shortly for the 22.04 update when Humble testing starts in April. I’ve pinned this to my calendar around then!

Thanks for the debugging time and it will definitely be made use of in the near future

goekce commented 2 years ago

... (even 22.04 comes with 2018.12)

You have a tiny typo, libbtbb is Bluetooth lib :)

Ubuntu 22.04 currently has TBB 2020.3.

samuk commented 2 years ago

Trying to use this script https://raw.githubusercontent.com/milq/milq/master/scripts/bash/install-opencv.sh

To compile OpenCV on 22.04 / Humble I get

/home/ubuntu/OpenCV/modules/core/src/parallel.cpp:104:14: fatal error: tbb/tbb_stddef.h: No such file or directory
  104 |     #include "tbb/tbb_stddef.h"
afrixs commented 2 years ago

Ubuntu 22.04 has currently moved to TBB 2021.5 so this should be reopened. Approving that @m2-farzan 's patch builds successfully and mapping seems to work like before.

SteveMacenski commented 2 years ago

Sure! Can someone submit the patch? I'll pull in updates and test that it still turns over fine