From 23e4ecdf0f101741b1f22ece50a10ae27cd26b3e Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Sun, 12 Dec 2021 14:14:43 +0100 Subject: [PATCH] Follow-up to c772d28070dec458d73488c52c2ae8b6d2755fb6 Support for oneTBB from oneAPI, where Intel reworked and deprecated some interfaces. Implements some of TBB universal fix (2020/2021 fixes) #7332 This one adds TBB_HAS_GLOBAL_CONTROL for the up to date oneTBB. --- src/libslic3r/GCode.cpp | 5 ++--- src/libslic3r/utils.cpp | 10 ++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index a8c30ef5c80..bd14e0a0bb5 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -36,15 +36,14 @@ #include +// Intel redesigned some TBB interface considerably when merging TBB with their oneAPI set of libraries, see GH #7332. +// We are using quite an old TBB 2017 U7. Before we update our build servers, let's use the old API, which is deprecated in up to date TBB. #if ! defined(TBB_VERSION_MAJOR) #include #endif - #if ! defined(TBB_VERSION_MAJOR) static_assert(false, "TBB_VERSION_MAJOR not defined"); #endif - -// Intel redesigned some TBB interface considerably when merging TBB with their oneAPI set of libraries, see GH #7332. #if TBB_VERSION_MAJOR >= 2021 #include using slic3r_tbb_filtermode = tbb::filter_mode; diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index efffcfe247a..7e4b281fdb3 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -47,6 +47,16 @@ // We are using quite an old TBB 2017 U7, which does not support global control API officially. // Before we update our build servers, let's use the old API, which is deprecated in up to date TBB. +#include +#if ! defined(TBB_VERSION_MAJOR) + #include +#endif +#if ! defined(TBB_VERSION_MAJOR) + static_assert(false, "TBB_VERSION_MAJOR not defined"); +#endif +#if TBB_VERSION_MAJOR >= 2021 + #define TBB_HAS_GLOBAL_CONTROL +#endif #ifdef TBB_HAS_GLOBAL_CONTROL #include #else