# TBB issues when building - both via build\_usd.py and manually

**URL:** <https://forum.aousd.org/t/tbb-issues-when-building-both-via-build-usd-py-and-manually/2392>\
**Category:** Build and Deployment\
**Created:** [April 22, 2025, 7:10pm UTC](https://forum.aousd.org/t/tbb-issues-when-building-both-via-build-usd-py-and-manually/2392 "2025-04-22T19:10:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robp\_sidefx](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/robp_sidefx/32/327_2.png) [@robp\_sidefx](https://forum.aousd.org/u/robp_sidefx)\
**Post date:** [April 22, 2025, 7:10pm UTC](https://forum.aousd.org/t/tbb-issues-when-building-both-via-build-usd-py-and-manually/2392/1 "2025-04-22T19:10:00Z")

</div>

The `build_usd.py` script downloads and builds a version of TBB, but it doesn’t seem like it’s being picked up during the build of USD itself.

Similarly, `BUILDING.md` suggests setting `-DTBB_ROOT_DIR` when invoking `cmake` but, when I do that, I get:

```auto
CMake Warning:
  Manually-specified variables were not used by the project:

    TBB_ROOT_DIR

```

All of this spawns from:

```auto
$ python3 build_scripts/build_usd.py -vv -j 1 /home/robp/dev/github/_usd

Building with settings:
  USD source directory /home/robp/dev/github/USD
  USD install directory /home/robp/dev/github/_usd
  3rd-party source directory /home/robp/dev/github/_usd/src
  3rd-party install directory /home/robp/dev/github/_usd
  Build directory /home/robp/dev/github/_usd/build
...
[26%] Building CXX object pxr/base/work/CMakeFiles/work.dir/detachedTask.cpp.o
In file included from /home/robp/dev/github/USD/pxr/base/work/detachedTask.h:15,
                 from /home/robp/dev/github/USD/pxr/base/work/detachedTask.cpp:9:
/home/robp/dev/github/USD/pxr/base/work/dispatcher.h: In constructor ‘pxrInternal_v0_25_5 __pxrReserved__ ::WorkDispatcher::_TaskGroup::_TaskGroup(tbb::detail::d1::task_group_context&)’:
/home/robp/dev/github/USD/pxr/base/work/dispatcher.h:205:71: error: no matching function for call to ‘tbb::detail::d1::task_group::task_group(tbb::detail::d1::task_group_context&)’
  205 | _TaskGroup(tbb::task_group_context& ctx) : tbb::task_group(ctx) {}
      | ^
In file included from /usr/include/tbb/task_group.h:17,
                 from /home/robp/dev/github/USD/pxr/base/work/dispatcher.h:24,
                 from /home/robp/dev/github/USD/pxr/base/work/detachedTask.h:15,
                 from /home/robp/dev/github/USD/pxr/base/work/detachedTask.cpp:9:
/usr/include/oneapi/tbb/task_group.h:621:5: note: candidate: ‘tbb::detail::d1::task_group::task_group()’
  621 | task_group() : task_group_base(task_group_context::concurrent_wait) {}
      | ^ ~~~~~~~~~
/usr/include/oneapi/tbb/task_group.h:621:5: note: candidate expects 0 arguments, 1 provided
gmake[2]: *** [pxr/base/work/CMakeFiles/work.dir/build.make:97: pxr/base/work/CMakeFiles/work.dir/detachedTask.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:4124: pxr/base/work/CMakeFiles/work.dir/all] Error 2

```

You can see how `task_group.h` is being picked up from `/usr/include` and not `/home/robp/dev/github/_usd`.

This is all using the 25.05rc1 tag, but perhaps this has been the case for longer.

---

<div class="post-metadata">

**Author:** ![robp\_sidefx](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/robp_sidefx/32/327_2.png) [@robp\_sidefx](https://forum.aousd.org/u/robp_sidefx)\
**Post date:** [April 22, 2025, 9:05pm UTC](https://forum.aousd.org/t/tbb-issues-when-building-both-via-build-usd-py-and-manually/2392/2 "2025-04-22T21:05:48Z")

</div>

I reverted to 25.02 and it looks like it’s properly picking up the local TBB - at least based on warnings like this:

```auto
[3862/4560] Building CXX object pxr/usd/usdMtlx/CMakeFiles/usdMtlx.dir/fileFormat.cpp.o
In file included from /home/robp/dev/github/USD/pxr/base/work/dispatcher.h:26,
                 from /home/robp/dev/github/USD/pxr/usd/sdf/layer.h:29,
                 from /home/robp/dev/github/USD/pxr/usd/pcp/types.h:13,
                 from /home/robp/dev/github/USD/pxr/usd/pcp/node.h:12,
                 from /home/robp/dev/github/USD/pxr/usd/usd/editTarget.h:14,
                 from /home/robp/dev/github/USD/pxr/usd/usd/stage.h:15,
                 from /home/robp/dev/github/USD/pxr/usd/usdMtlx/fileFormat.cpp:11:
/home/robp/dev/github/_usd/include/tbb/task.h:21:139: note: ‘#pragma message: TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.’
   21 | #pragma message("TBB Warning: tbb/task.h is deprecated. For details, please see Deprecated Features appendix in the TBB reference manual.")

```

---

<div class="post-metadata">

**Author:** ![robp\_sidefx](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.aousd.org/robp_sidefx/32/327_2.png) [@robp\_sidefx](https://forum.aousd.org/u/robp_sidefx)\
**Post date:** [April 23, 2025, 9:59am UTC](https://forum.aousd.org/t/tbb-issues-when-building-both-via-build-usd-py-and-manually/2392/3 "2025-04-23T09:59:29Z")

</div>

Okay, I managed to find the cause and logged it as a Github issue - [build\_usd.py favours system TBB over local one · Issue #3610 · PixarAnimationStudios/OpenUSD · GitHub](https://github.com/PixarAnimationStudios/OpenUSD/issues/3610)
