I don’t like having to manually set the various properties in order to get a TBB program to compile. So I built a Visual C++ 2005 project template that does it for me. All I have to do is click on the New Project button, select Win32 as the project type and Win32 Console Application using TBB as the template. That automatically sets the properties to use TBB and presents a top-level .cpp file that already contains the TBB include files.
You can download the installer for the TBB project template here.
By default, the project template expects that you have modified the PATH environment variable to include the directory where the DLLs are stored: %TBB20_INSTALL_DIR%\ia32\vc8\bin. If you want to use the method where the TBB DLLs are copied to the application directory before it is run, then you can uncomment lines 46, 51-52, 57 and 62-63 in the file default.js at C:\Program Files\Microsoft Visual Studio 8\VC\VCWizards\AppWiz\Generic\ApplicationTBB\scripts\1033.
If you want to know how to make or modify a VC++ project template, this is a good place to start.
[...] thanks to Dave Vanden Bout, owner of the /// Parallelism Panorama /// blog. In his latest entry, “Making TBB a bit easier…”, Dave talks about and offers for download a TBB project template for Visual C++ 2005. Using the [...]
Pingback by IntelĀ® Software Network Blogs » Threading Building Blocks Template for Visual Studio Now Available — February 25, 2008 @ 10:28 pm
Sure, you can post it anywhere you like.
I’m not sure about the compiler settings in the template. The defaults seem to give OK performance. If someone has made a comparative study, then I should probably update the template to use the best compiler settings.
It would also be nice if the template let you select a particular construct (e.g. parallel_for) and then would place a code skeleton for that construct into the main C++ file. I can see how the template mechanism allows that, but I’m not expert enough in the TBB constructs to do that for each one. Perhaps someone else is already doing that.
Comment by llpanorama — February 25, 2008 @ 10:16 pm
I think it would be great to make this available for download on the Threading Building Blocks Sourceforge site (we use that for TBB “accessories”). Let me know if I can post it for download there.
Comment by kfarnham — February 25, 2008 @ 8:29 pm