PX4-Autopilot: latest tbb is causing `make px4_sitl gazebo` failed

Describe the bug

the newest tbb has removed tbb::task api, gazebo11 homebrew bottle depends on tbb@2020 as a workaround, but make px4_sitl gazebo still use header file in /usr/local/include/tbb which is the latest tbb.

To Reproduce brew tap PX4/px4 brew install px4-dev python3 -m pip install --user pyserial empy toml numpy pandas jinja2 pyyaml pyros-genmsg packaging brew install --cask xquartz brew install px4-sim-gazebo

Expected behavior

/usr/local/include/gazebo-11/gazebo/transport/Node.hh:39:58: error: expected class name
    class GZ_TRANSPORT_VISIBLE PublishTask : public tbb::task
                                                         ^
/usr/local/include/gazebo-11/gazebo/transport/Node.hh:54:20: error: no type named 'task' in namespace 'tbb'
      public: tbb::task *execute()
              ~~~~~^
/usr/local/include/gazebo-11/gazebo/transport/Node.hh:162:52: error: no member named 'allocate_root' in namespace 'tbb::v1::task'
                PublishTask *task = new(tbb::task::allocate_root())
                                        ~~~~~~~~~~~^
/usr/local/include/gazebo-11/gazebo/transport/Node.hh:165:17: error: no type named 'enqueue' in namespace 'tbb::v1::task'; did you mean 'ifqueue'?
                tbb::task::enqueue(*task);
                ^~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/net/if_var.h:229:9: note: 'ifqueue' declared here
struct  ifqueue {
        ^
8 errors generated.
ninja: build stopped: subcommand failed.

Additional context homebrew related issue #issue1477

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 33 (15 by maintainers)

Commits related to this issue

Most upvoted comments

The fix for this (on a Mac and for the time being) is to remove the symlink for tbb so:

rm /usr/local/include/tbb

Then add a new symlink to tbb@2020_u3:

ln -s /usr/local/Cellar/tbb@2020_u3/2020_U3/include/tbb /usr/local/include/tbb

Then sitl gazebo runs fine

Without the workaround and just using brew install tbb I get px4/sitl/src/sitl_led.c:53:23: fatal error: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] when running make px4_sitl gazebo though not sure if the error is related to this particular issue.

@shivam5594 try installing it like this:

HOMEBREW_NO_INSTALL_FROM_API=1 brew install tbb@2020 

The fix for this (on a Mac and for the time being) is to remove the symlink for tbb so:

rm /usr/local/include/tbb

Then add a new symlink to tbb@2020_u3:

ln -s /usr/local/Cellar/tbb@2020_u3/2020_U3/include/tbb /usr/local/include/tbb

Then sitl gazebo runs fine

I could archive the same result with following commands:

brew unlink tbb
brew link tbb@2020

@shivam5594 Did @ch-greams suggestion work? I think this is trying to install without fetching the latest from the developers pushes, but rather from local versions to the homebrew site (or something along those lines).

If that doesn’t work, if any tbb was installed in the past, homebrew can sometimes keep a local cache of the homebrew formula, and will automatically used the cached version instead of the front facing version you edited.

Therefore, try to clear the homebrew cache, and reinstall like this:

rm -rf $(brew --cache)/tbb@2020--* brew install ./tbb@2020.rb

@julianoes, no problem! I created a pull request for the “tbb@2020 not installing” problem here: https://github.com/PX4/PX4-user_guide/pull/2617

That is actually a something that needs to be done in the setup, so that pull request went to the PX4-user_guide repo.

I encounter same problem, did you fix it ?

building for macOS (using macOS Ventura) I get : Error: tbb@2020 has been disabled because it is not supported upstream! cannot find a workaround