Yesterday, I had to use Threading Building Blocks (TBB), an Intel C++ template library to take advantage of multicore processors. But, I had some troubles to create an executable and I had difficulty to find the solution on Internet. So, I write this thread in order to help futur users of TBB on Mac.
Download and installation
After installing TBB library and its dependencies with the following command:
I got no error messages and I thought everything worked. Indeed, g++ has not problems to find TBB headers. I could compile this code without trouble:
Unfortunately, there are some errors which appears when we add -ltbb flag in previous command:
This flag allows to load the library files (not only headers). So, if we can not compile with this flag, TBB would be very limited.
In order to fix this error, type the following command:
Now, you can execute the compilation command with -ltbb flag. I hope it helps you to save a lot of time. If you still have some error, leave a comment and I will try to help you. In few weeks, I will probably talk about TBB more deeply that is to say how I used it in video processing.