Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does including <execution> require linking against tbb?

In my project on a Ubuntu 20 platform (with g++ 9.3.0), I use the following line

#include <execution>

to support parallel processing via standard library functions. I don't include anything from TBB, the parallel execution library from Intel. But then when I build the program I get the message:

/usr/bin/ld: CMakeFiles/probis.dir/src/probis.cpp.o: in function `tbb::interface7::task_arena::current_thread_index()':
/usr/include/tbb/task_arena.h:449: undefined reference to `tbb::interface7::internal::task_arena_base::internal_current_slot()'

This is easy enough to solve (as in: make the message go away) by adding -ltbb to the linker line. But then I have a dependency on libtbb that I did not count on.

Is this dependency expected? Is it possible to use parallel execution without installing tbb (but that tbb overrides the default setting when it is installed)?

like image 986
alle_meije Avatar asked Mar 16 '26 20:03

alle_meije


1 Answers

As @[n. 'pronouns' m.] rightly said, you may need libtbb in order to make your code work. You can download the Intel® oneAPI Base Toolkit which contains TBB as one of the components. Link to download Intel® oneAPI Base Toolkit: https://software.intel.com/content/www/us/en/develop/tools/oneapi/base-toolkit/download.html

like image 175
Goutham_Intel Avatar answered Mar 18 '26 10:03

Goutham_Intel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!