fair-acc / gnuradio4

Prototype implementations for a more compile-time efficient flowgraph API
GNU Lesser General Public License v3.0
22 stars 8 forks source link

Fix optional gcc dependency on TBB #365

Closed wirew0rm closed 2 weeks ago

wirew0rm commented 2 weeks ago

For implementing std::execution::par, gcc relies on the TBB library. On systems without TBB installed it falls back to the non-parallel implementation, but as soon as the TBB header is available it will try to use it and require linking against TBB. https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig#L874-L882 Since TBB is a bigger dependency, making it a required dependency is not an option, so this introduces the option ENABLE_TBB which by default is off but can be used to add the dependency.

The alternative would be to add TBB as a non-required dependency and only add the linker flag if it is found, following the approach from gcc. Would be one less cmake option but I think having it explicit is better allow reproduction between different systems.

fixes #361

sonarcloud[bot] commented 2 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud