Skip to content

Fix builds with newer TBB versions - #2254

Open
mmalecki wants to merge 2 commits into
AcademySoftwareFoundation:masterfrom
mmalecki:include-tbb-version
Open

Fix builds with newer TBB versions#2254
mmalecki wants to merge 2 commits into
AcademySoftwareFoundation:masterfrom
mmalecki:include-tbb-version

Conversation

@mmalecki

@mmalecki mmalecki commented Jul 21, 2026

Copy link
Copy Markdown

Such as TBB_INTERFACE_VERSION.
Without it, the #else statement always triggers, breaking build for newer TBB version (albeit rare at this point).

@mmalecki
mmalecki requested a review from kmuseth as a code owner July 21, 2026 20:44
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 21, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: mmalecki / name: Maciej Małecki (b96c81d)

Such as `TBB_INTERFACE_VERSION`.
Without it, the `#else` statement always triggers, breaking build for
newer TBB version (albeit rare at this point).

Signed-off-by: Maciej Małecki <me@mmalecki.com>
@mmalecki
mmalecki force-pushed the include-tbb-version branch from b96c81d to 1ca9bb0 Compare July 21, 2026 20:47
@mmalecki mmalecki changed the title Include file containing TBB version information Fix builds with newer TBB versions Jul 22, 2026
Comment thread openvdb/openvdb/thread/Threading.h Outdated
/// software doesn't need to provide compile time defines.
#include <tbb/task_arena.h>
#include <tbb/task_group.h>
#include <tbb/version.h>

@Idclip Idclip Jul 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason we don't do this is to support older TBB versions which didn't deploy with the version header (see the comment above - our current minimum supported TBB version is 2020.3). However, as we are now a minimum C++17 project, we might be able to use the __has_include preproc directive to achieve this:

/// @warning  the below changes what includes are available from this header depending on whether version.h is available
#if __has_include(<tbb/version.h>)
    #include <tbb/version.h>
#else
    /// @note tbb/task_arena.h is the ONLY include that persists from TBB 2020
    ///   to TBB 2021 to TBB 2023 that itself includes the TBB specific version
    ///   header files.
    ///   In TBB 2020, the version header was called tbb/stddef.h. In 2021+, it's
    ///   called tbb/version.h. We include tbb/task_arena.h here to indirectly
    ///   access the version defines in a consistent way so that downstream
    ///   software doesn't need to provide compile time defines. 
    #include <tbb/task_arena.h>
#endif

#include <tbb/task_group.h>

Would this work in your case?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, reading comprehension when frantically trying to get something working: 1/10.
Apologies for the noise! I'll make this a conditional include - although most likely not today, but during the weekend.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, I've just made this change!

Signed-off-by: Nick Avramoussis <4256455+Idclip@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants