# Current TBB 2021 is not supported by GCC 9 or 10 with \`std::execution\`

**URL:** <https://discourse.slicer.org/t/current-tbb-2021-is-not-supported-by-gcc-9-or-10-with-std-execution/24282>\
**Category:** Development\
**Created:** [July 12, 2022, 9:27am UTC](https://discourse.slicer.org/t/current-tbb-2021-is-not-supported-by-gcc-9-or-10-with-std-execution/24282 "2022-07-12T09:27:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [July 12, 2022, 9:27am UTC](https://discourse.slicer.org/t/current-tbb-2021-is-not-supported-by-gcc-9-or-10-with-std-execution/24282/1 "2022-07-12T09:27:17Z")

</div>

Hi,

Slicer recently moved to TBB 2021 version.  
I just figured out that this version is not compatible with neither GCC 9 or 10 ([issue link1](https://stackoverflow.com/questions/65521032/cant-run-c17-parallel-algorithms-with-gcc-on-linux) and [issue link2](https://community.intel.com/t5/Intel-oneAPI-Threading-Building/tbb-task-has-not-been-declared/td-p/1254418)) when using [std::execution](https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag) to paralelize `stl` algorithms.

As I know GCC 9.3 fully supports C++17 but if you decide to use `std::execution` within Slicer then you will likely get an error mentioned in the links above.  
As I understood GCC 11 and 12 support TBB 2021.

Maybe we should allow the developper to choose the desired TBB version? Like we had with VTK 8 and VTK 9.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [July 12, 2022, 8:13pm UTC](https://discourse.slicer.org/t/current-tbb-2021-is-not-supported-by-gcc-9-or-10-with-std-execution/24282/2 "2022-07-12T20:13:48Z")

</div>

Do you see any explanation in the commit that made the TBB library version hardcoded about why it was made? If no specific reason is given then most likely it was made to just make things simpler. If there is a confirmed need to make it more configurable then that can justify the additional complication.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 12, 2022, 8:19pm UTC](https://discourse.slicer.org/t/current-tbb-2021-is-not-supported-by-gcc-9-or-10-with-std-execution/24282/3 "2022-07-12T20:19:35Z")

</div>

> any explanation in the commit that made the TBB library version hardcoded about why it was made

For reference, see [COMP: Update TBB from 2019\_U9 to 2021.5.0 · Slicer/Slicer@3ea8ba4 · GitHub](https://github.com/Slicer/Slicer/commit/3ea8ba4b4e0981ea05677df65bc3e7c9819c1d5b)

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [July 12, 2022, 8:23pm UTC](https://discourse.slicer.org/t/current-tbb-2021-is-not-supported-by-gcc-9-or-10-with-std-execution/24282/4 "2022-07-12T20:23:10Z")

</div>

I see now.  
Probably it is worth to leave it as is.
