-
Notifications
You must be signed in to change notification settings - Fork 978
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
bug fix - When TBB_USE_EXCEPTIONS is disabled task_dispatcher fails to link #864
base: master
Are you sure you want to change the base?
Conversation
When TBB_USE_EXCEPTIONS is disabled task_dispatcher fails to compile
Hi @fran6co, could you provide the steps to reproduce it? |
Just try to compile with TBB_USE_EXCEPTIONS disabled |
I successfully built and linked library with TBB_USE_EXCEPTIONS=0 using such command |
That wouldn't work because the CMake define will not be translate to a C++ preprocessor define. You need to pass it like this:
|
I built it with verbose and define was there also I add something like "dsadasd not compile" under macro and it not compiled with enabled macro and compiled with disabled |
There is no difference between -DCMAKE_CXX_FLAGS='-DTBB_USE_EXCEPTIONS=0' and -DCMAKE_CXX_FLAGS=-DTBB_USE_EXCEPTIONS=0. |
@fran6co please share more info about configuration you are facing that issue on (OS, compiler, etc)? |
Hi @fran6co, any updates? |
Sorry, I didn't have time to check it out. Over the weekend I should be able to |
So, for some reason it's not enough to pass it to
|
In my project TBB is part of the build so I just have a |
For the sake of completeness: OS: Ubuntu 22.04 |
@fran6co do you add oneTBB as subdirectory ( |
Yes, but even when I build the TBB project standalone I get the same linking error:
|
I'm actually surprised that it builds for you, because |
According to specification https://spec.oneapi.io/versions/latest/elements/oneTBB/source/configuration/feature_macros.html:
Is there some special usecase where you need to compile oneTBB library (not your program using oneTBB) without exceptions? |
|
Should this try/catch block be guarded by |
I also ran in to this problem, which I mention in this issue and was directed to this (thanks, @isaevil). I wonder if others have an explanation for what seems to be needlessly elaborate/complicated existing code, which I hope could be cleaner and simpler and also fix this particular issue. Since a throw from a noexcept function will (by definition) result in a std::terminate() then any existing call to There are only 2 places where
What benefit is there in I'd also argue that doing so fixes the problem mentioned here with fairly minimal changes, allows us to remove the slightly odd |
Description
When TBB_USE_EXCEPTIONS is disabled task_dispatcher fails to link.
Type of change
Tests
Documentation
Breaks backward compatibility