-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TBB universal fix (2020/2021 fixes) #7332
Conversation
- Retrieved from [1], SHA: 172e85feaf7cd36533012d66fb12a8942888d61d on 2021-05-26 - [1]: https://gitlab.kitware.com/vtk/vtk/blob/master/CMake/FindTBB.cmake
- Protect against the case when the user has multiple installs of TBB in their search paths and the first install does not contain debug libraries. In this case it is possible to get mismatched versions of TBB inserted into TBB_LIBRARIES. - Also suppresses warning about use of TBB_ROOT on modern versions of CMake due to CMP0074. Copied from ceres-solver/ceres-solver@4e69a47
Hi, I can't apply this PR patch to PrusaSlicer-2.3.3, so there must have been changes in FindTBB.cmake between the release and current master. But as your patch entirely replaces FindTBB.cmake, I did just the same with 2.3.3. The cmake runs fine but it fails at some include:
This line is not in master anymore, so I suspect 2.4.0 will not have the problem. |
Update: with above mentioned PR backported to 2.3.3, it builds. |
yeah thats entirely expected. you won't be able to build with my PR here on 2.3.3. You need all the other changes after that for it to work. Its based on master. |
https://build.opensuse.org/request/show/933584 by user bnavigator + dimstar_suse - Make compatible with TBB 2021 * add FindTBB.cmake -- gh#prusa3d/PrusaSlicer#7332 * add PrusaSlicer-pr6590-updateTBB.patch gh#prusa3d/PrusaSlicer#6590
I am trying to compile latested git on Arch Linux, that PR applied fine but the build still fails:
|
I suppose you need a newer TBB. Static compilation against the dependencies produced by our deps script as described in our wiki should work. |
https://archlinux.org/packages/extra/x86_64/tbb/ |
It's the other way round, TBB 2021.4 does not have For the latter, you are somehow in the wrong branch here: PrusaSlicer/src/libslic3r/utils.cpp Lines 48 to 54 in f033a79
For the former, ae7d6db made PrusaSlicer incompatible with TBB 2021. https://www.intel.com/content/www/us/en/developer/articles/technical/tbb-revamp.html
|
I will just use latest AppImage for now and wait for the issue here to resolve, looks like the TBB stuff needs still some work. Thanks! |
I managed to make 2.4.0-beta4 compile on Arch using the diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp
index cddb506c2..7da94aeb4 100644
--- a/src/libslic3r/GCode.cpp
+++ b/src/libslic3r/GCode.cpp
@@ -35,7 +35,7 @@
#include "SVG.hpp"
#include <tbb/parallel_for.h>
-#include <tbb/pipeline.h>
+#include <tbb/parallel_pipeline.h>
#include <Shiny/Shiny.h>
@@ -1500,7 +1500,7 @@ void GCode::process_layers(
{
// The pipeline is variable: The vase mode filter is optional.
size_t layer_to_print_idx = 0;
- const auto generator = tbb::make_filter<void, GCode::LayerResult>(tbb::filter::serial_in_order,
+ const auto generator = tbb::make_filter<void, GCode::LayerResult>(tbb::filter_mode::serial_in_order,
[this, &print, &tool_ordering, &print_object_instances_ordering, &layers_to_print, &layer_to_print_idx](tbb::flow_control& fc) -> GCode::LayerResult {
if (layer_to_print_idx == layers_to_print.size()) {
fc.stop();
@@ -1514,16 +1514,16 @@ void GCode::process_layers(
return this->process_layer(print, layer.second, layer_tools, &layer == &layers_to_print.back(), &print_object_instances_ordering, size_t(-1));
}
});
- const auto spiral_vase = tbb::make_filter<GCode::LayerResult, GCode::LayerResult>(tbb::filter::serial_in_order,
+ const auto spiral_vase = tbb::make_filter<GCode::LayerResult, GCode::LayerResult>(tbb::filter_mode::serial_in_order,
[&spiral_vase = *this->m_spiral_vase.get()](GCode::LayerResult in) -> GCode::LayerResult {
spiral_vase.enable(in.spiral_vase_enable);
return { spiral_vase.process_layer(std::move(in.gcode)), in.layer_id, in.spiral_vase_enable, in.cooling_buffer_flush };
});
- const auto cooling = tbb::make_filter<GCode::LayerResult, std::string>(tbb::filter::serial_in_order,
+ const auto cooling = tbb::make_filter<GCode::LayerResult, std::string>(tbb::filter_mode::serial_in_order,
[&cooling_buffer = *this->m_cooling_buffer.get()](GCode::LayerResult in) -> std::string {
return cooling_buffer.process_layer(std::move(in.gcode), in.layer_id, in.cooling_buffer_flush);
});
- const auto output = tbb::make_filter<std::string, void>(tbb::filter::serial_in_order,
+ const auto output = tbb::make_filter<std::string, void>(tbb::filter_mode::serial_in_order,
[&output_stream](std::string s) { output_stream.write(s); }
);
@@ -1546,7 +1546,7 @@ void GCode::process_layers(
{
// The pipeline is variable: The vase mode filter is optional.
size_t layer_to_print_idx = 0;
- const auto generator = tbb::make_filter<void, GCode::LayerResult>(tbb::filter::serial_in_order,
+ const auto generator = tbb::make_filter<void, GCode::LayerResult>(tbb::filter_mode::serial_in_order,
[this, &print, &tool_ordering, &layers_to_print, &layer_to_print_idx, single_object_idx](tbb::flow_control& fc) -> GCode::LayerResult {
if (layer_to_print_idx == layers_to_print.size()) {
fc.stop();
@@ -1557,16 +1557,16 @@ void GCode::process_layers(
return this->process_layer(print, { std::move(layer) }, tool_ordering.tools_for_layer(layer.print_z()), &layer == &layers_to_print.back(), nullptr, single_object_idx);
}
});
- const auto spiral_vase = tbb::make_filter<GCode::LayerResult, GCode::LayerResult>(tbb::filter::serial_in_order,
+ const auto spiral_vase = tbb::make_filter<GCode::LayerResult, GCode::LayerResult>(tbb::filter_mode::serial_in_order,
[&spiral_vase = *this->m_spiral_vase.get()](GCode::LayerResult in)->GCode::LayerResult {
spiral_vase.enable(in.spiral_vase_enable);
return { spiral_vase.process_layer(std::move(in.gcode)), in.layer_id, in.spiral_vase_enable, in.cooling_buffer_flush };
});
- const auto cooling = tbb::make_filter<GCode::LayerResult, std::string>(tbb::filter::serial_in_order,
+ const auto cooling = tbb::make_filter<GCode::LayerResult, std::string>(tbb::filter_mode::serial_in_order,
[&cooling_buffer = *this->m_cooling_buffer.get()](GCode::LayerResult in)->std::string {
return cooling_buffer.process_layer(std::move(in.gcode), in.layer_id, in.cooling_buffer_flush);
});
- const auto output = tbb::make_filter<std::string, void>(tbb::filter::serial_in_order,
+ const auto output = tbb::make_filter<std::string, void>(tbb::filter_mode::serial_in_order,
[&output_stream](std::string s) { output_stream.write(s); }
);
diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp
index efffcfe24..7a8cfa0fe 100644
--- a/src/libslic3r/utils.cpp
+++ b/src/libslic3r/utils.cpp
@@ -45,6 +45,8 @@
#include <boost/nowide/convert.hpp>
#include <boost/nowide/cstdio.hpp>
+#define TBB_HAS_GLOBAL_CONTROL
+
// 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.
#ifdef TBB_HAS_GLOBAL_CONTROL Passes tests (now that #7291 is merged), and seems to launch and work just fine. |
some interfaces. Implements some of TBB universal fix (2020/2021 fixes) #7332
I have added a compile time switch for tbb::filter_mode |
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.
This one 23e4ecd |
Unfortunately this script is not compatible with the old TBB. I am getting the following error when trying to run CMake on PrusaSlicer source base (this one was on Windows):
Thus we will not merge this pull request either until the issue is resolved or until we upgrade to oneTBB. |
Should be fixed for good by @tamasmeszaros, see |
@bubnikv @tamasmeszaros not fixed, as seen by my comment here: #6355 (comment) |
I have decided to close this PR: #7149 since I do not have control over it and some changes had to be made. Should fix issues seen here: #6355
I've tested this PR on bionic with TBB 2017. The changes should allow TBB 2020/TBB 2021 to build but I still need confirmation from @bnavigator on TBB 2021 as well as testing myself on hirsute with TBB 2020