How to install TBB?

How to install TBB?

Hello everyone!

I have a problem relating to TBB. I recently downloaded it (the Commercial-Aligned Open Source version) onto a Windows XP PC with Microsoft Visual Studio 2008 Express and Microsoft Visual Studio 2010 Express (All four products, Visual Basic, Visual C++, Visual C#, and Visual Web Developer for both installations). I found a tutorial (http://llpanorama.wordpress.com/tbb-tutorial/) but I dont have the required software (Microsoft Visual Studio 2005 Express, which is not supported anymore, or end-of-life, and which also cant be downloaded anymore). How can I install TBB with Visual Studio 2010 Express (or if I have to, Visual Studio 2008 Express)?

Thanks in advance!

Edit: I needed Microsoft Visual Studio 2005 Express for Microsoft Assembler

t3h p3ngu1nz 15 b4k
32 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

BTW, here are the specs of the system I am using for TBB (in case you need it):

CPU: AMD Phenom 9650 Quad-Core Processor (2.3 GHz) (TBB said in the release notes: "Non Intel processors compatible with the above processors"; with "above processors" it meant Intel processors)
RAM: 2 GB
Video Card: NVIDIA GeForce 9600 GSO

t3h p3ngu1nz 15 b4k

hi,you can use binary package of tbbto set environement you can start \bin\ia32\vc10\tbbvars.bat file in the vs 2010 express command line and then launch vs by issuing 'devenv /useenv' command. Or set %PATH%, %LIB%, %INCLUDE% pointing to appropriate folders in the vs2010 GUI.--Vladimir

Quoting Vladimir Polin (Intel)hi, you can use binary package of tbbto set environement you can start \bin\ia32\vc10\tbbvars.bat file in the vs 2010 express command line and then launch vs by issuing 'devenv /useenv' command. Or set %PATH%, %LIB%, %INCLUDE% pointing to appropriate folders in the vs2010 GUI.--Vladimir

Thanks! I'll tell you if it works! :-)

t3h p3ngu1nz 15 b4k

Quoting Tux, the Linux PenguinQuoting Vladimir Polin (Intel)hi, you can use binary package of tbbto set environement you can start \bin\ia32\vc10\tbbvars.bat file in the vs 2010 express command line and then launch vs by issuing 'devenv /useenv' command. Or set %PATH%, %LIB%, %INCLUDE% pointing to appropriate folders in the vs2010 GUI.--Vladimir

Thanks! I'll tell you if it works! :-)

It doesn't work. :-( I moved the contents of the unzipped dir to C:\Program Files\Intel\TBB\3.0 Update 1 Commercial-Aligned Release\ and went to its bin folder with vs command prompt 2010. Next, I typed tbbvars. A list of arguments came up, so I reran tbbvars with the arguments I needed, ia32 and vs2010. I got the following error:
The system cannot find the batch label specified - ParseArgs
I looked into the batch file and there it was, ParseArgs:

:ParseArgs

:: Parse the incoming arguments

if /i "%1"=="" goto SetEnv

if /i "%1"=="ia32" (set TBB_TARGET_ARCH=ia32) & shift & goto ParseArgs

if /i "%1"=="intel64" (set TBB_TARGET_ARCH=intel64) & shift & goto ParseArgs

if /i "%1"=="vs2005" (set TBB_TARGET_VS=vc8) & shift & goto ParseArgs

if /i "%1"=="vs2008" (set TBB_TARGET_VS=vc9) & shift & goto ParseArgs

if /i "%1"=="vs2010" (set TBB_TARGET_VS=vc10) & shift & goto ParseArgs

if /i "%1"=="all" (set TBB_TARGET_VS=vc_mt) & shift & goto ParseArgs

For some reason, the batch file can't find it! :-( Do you know what's going on?

t3h p3ngu1nz 15 b4k

I had vaguely similar issues running the sample code using Visual Studio 2010 Professional. I needed to modify copy_libraries.bat in examples\common. I added this after line 40:

if ("%VS100COMNTOOLS%") NEQ ("") set vc_dir=vc10

I believe this change and setting the environment variable TBB30_INSTALL_DIR was all that was required to build from from the *_cl.sln files (there will be a conversion required).

For meaningful output, I sometimes had to run from the command line (use the Visual Studio 2010 command prompt).

I also saw what I interpreted as timing issues when building a solution containing several projects (e.g., sub_string_finder). One or more projects will have an error resembling this:

2>FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\mcb\AppData\Local\Temp\tbb_examples\sub_string_finder_cl\x64\Release\link.read.1.tlog. The file exists.

However the easy work around is to build by project.

HTH.

-Michael

Quoting Tux, the Linux Penguin
For some reason, the batch file can't find it! :-( Do you know what's going on?

Somehow this file contains linux end-of-lines. Could you run unix2dos utility on that file?

I'll try to find out why it contains linux eol.

thanks
--Vladimir

Hi Nav!

Just so you know, I don't really use Linux. (I dual-boot Kubuntu and Windows XP, but Kubuntu got corrupted when I tried to upgrade. Some day I'll have to fix it.) My problem's on Windows XP. "Tux, the Linux Penguin" is just my display name. :-) Thanks for replying though.

t3h p3ngu1nz 15 b4k

Hi Vladmir!

I ran unix2dos in cygwin on tbbvars.bat, and then ran tbbvars. There were no error messages. However, I don't think the paths got updated. (There was nothing related to tbb in the path) Did unix2dos affect the functionality of tbbvars.bat? Sorry this is taking so long!

t3h p3ngu1nz 15 b4k

I just calculated the md5 hashes. The first one is after unix2dos. The second one is before.

4f0009046530620836d93d6f5e7fe9e0 tbbvars.bat
5529187f5eb823d13be2d1bc3be68c2f tbbvars.bat

EDIT: I compared them with notepad++, but found no differences. Maybe notepad++ shows linux eols and dos linebreaks as the same... :-/

t3h p3ngu1nz 15 b4k

Hi Michael!

Thanks for responding! The line you told me to add was already there. I set the TBB30_INSTALL_DIR and ran copy_libraries.bat, but there was an error: Error occured in libraries copying during post-build step. copy_libraries.bat probably needs some arguments. Can you give more clear instructions? Thanks!

t3h p3ngu1nz 15 b4k

Thanks to everyone who responded! None of the responses were the solution though. Sorry this is taking so long!

t3h p3ngu1nz 15 b4k

This script is invoked as a Post-Build Event when you build using Visual Studio. I'm looking at the fibonacci sample right now; with Configuration set to Debug and Platform set to Win32, the arguments resolve to:

ia32 debug "$(OutDir)"

To be honest, I may have sent you in the wrong direction. I'm using Visual Studio 2010 Professional - I didn't realize the limitations of Visual Studio 2010 Express until I read your linked tutorial. FYI, you can download and use Professional free for 3 months.

-Michael

Ah! :) btw, there's another person too on the forum who had asked about TBB installation on Linux. I thought I'd help you both in one go. Two birds with one arrow :)
Sorry I didn't check twice before posting.

Hey, how did my post above end up without my id on it. I remember that immediately after I had posted it, I was already logged out. I thought I had logged out myself, but I feel this might be a bug in the logging in process of this website. Could someone check it?

Quoting mcbphdThis script is invoked as a Post-Build Event when you build using Visual Studio. I'm looking at the fibonacci sample right now; with Configuration set to Debug and Platform set to Win32, the arguments resolve to:

ia32 debug "$(OutDir)"

To be honest, I may have sent you in the wrong direction. I'm using Visual Studio 2010 Professional - I didn't realize the limitations of Visual Studio 2010 Express until I read your linked tutorial. FYI, you can download and use Professional free for 3 months.

-Michael

Hi Michael!

Thanks for the info! Now I know what copy_libraries.bat is. :-) Thanks again!

t3h p3ngu1nz 15 b4k

Quoting navAh! :) btw, there's another person too on the forum who had asked about TBB installation on Linux. I thought I'd help you both in one go. Two birds with one arrow :)
Sorry I didn't check twice before posting.

That's okay! :-)

t3h p3ngu1nz 15 b4k

notepad++ is also good tool to convert eol on windows.

Quoting Vladimir Polin (Intel)notepad++ is also good tool to convert eol on windows.

Thanks for the tip! :-) I think I should try manually changing the paths on vs2010. Do you think I should? I'll tell you if it works.

t3h p3ngu1nz 15 b4k

Update:I didn't manually change the paths, but just then I found something called generate_tbbvars.bat. I ran it, and it generated a tbbvars.bat file. Here are the contents:

@echo off
SET TBB30_INSTALL_DIR=
SET TBB_ARCH_PLATFORM=
SET TBB_TARGET_ARCH=
SET INCLUDE=%TBB30_INSTALL_DIR%include;%INCLUDE%
SET LIB=C:Program FilesIntelTBB3.0 Update 1 Commercial-Aligned Releasebin;%LIB%
SET PATH=C:Program FilesIntelTBB3.0 Update 1 Commercial-Aligned Releasebin;%PATH%

I ran it, and the paths were updated! However, when I ran the fibonacci example, the tbb include files were not detected. I had to insert the full path forthe includes to work. Even then, a library, tbb_debug.lib, was not found. Strange.

t3h p3ngu1nz 15 b4k

well, do you build in command-line or in IDE? it looks like you set environment in command line but build the sample in the IDE. Am I correct?--Vladimir

Quoting Vladimir Polin (Intel)well, do you build in command-line or in IDE? it looks like you set environment in command line but build the sample in the IDE. Am I correct? --Vladimir

Yes, you're correct. I prefer to use IDEs. Does that not work?

t3h p3ngu1nz 15 b4k

by calling tbbvars.bat you set environement for the current console. Do you use /useenv option?after calling thetbbvars.bat you need to launch visual studio using following command

devenv /useenv

then this environment will be propagated to VS and this should work.Also you can useMSVS Plug-in (http://www.threadingbuildingblocks.org/ver.php?fid=129) but it needs to be updated for tbb 3.0. there are instructions inside archive.--Vladimir

Quoting Vladimir Polin (Intel)by calling tbbvars.bat you set environement for the current console. Do you use /useenv option? after calling thetbbvars.bat you need to launch visual studio using following command- collapse sourceview plaincopy to clipboardprint?

  1. devenv/useenv
devenv /useenv

then this environment will be propagated to VS and this should work.Also you can useMSVS Plug-in (http://www.threadingbuildingblocks.org/ver.php?fid=129) but it needs to be updated for tbb 3.0. there are instructions inside archive.--Vladimir

Thanks for the reply! Does the msvs plugin work with the express version? I remember it saying that it didn't somewhere... I triedusingthe vc8fileswith vs2010 express, but it didn't work. :-( Anyway, I couldn't find the devenv command. Also, just so you know, I updated the VCProjectEngine.Dll.Express.Configmanually, still does not work(see the include, library, path lines):

<?xml version="1.0" encoding="utf-8"?>

    
		
    

t3h p3ngu1nz 15 b4k

I just discovered something! Instead of

devenv /useenv

its

vcexpress /useenv

the fibonacci sample includes (w/o the full paths (below)) still do not work. :-(

#include 
#include 
#include 
#include 
#include "tbb/task.h"
#include "tbb/task_scheduler_init.h"
#include "tbb/tick_count.h"
#include "tbb/blocked_range.h"
#include "tbb/concurrent_vector.h"
#include "tbb/concurrent_queue.h"
#include "tbb/concurrent_hash_map.h"
#include "tbb/parallel_while.h"
#include "tbb/parallel_for.h"
#include "tbb/parallel_reduce.h"
#include "tbb/parallel_scan.h"
#include "tbb/pipeline.h"
#include "tbb/atomic.h"
#include "tbb/mutex.h"
#include "tbb/spin_mutex.h"
#include "tbb/queuing_mutex.h"
#include "tbb/tbb_thread.h"
t3h p3ngu1nz 15 b4k
Best Reply

You have used tbbvars.bat from the package converted via notepad++, right? generate_tbbvars.bat should be run by the build/gmake to produce righttbbvars.bat
--Vladimir

Quoting Vladimir Polin (Intel)You have used tbbvars.bat from the package converted via notepad++, right? generate_tbbvars.bat should be run by the build/gmake to produce righttbbvars.bat
--Vladimir

Not really, I'll convert it now.

t3h p3ngu1nz 15 b4k

Actually, I used notepad to convert them. Now they're linux eols along with dos eols. :-)

t3h p3ngu1nz 15 b4k

Quoting Tux, the Linux PenguinActually, I used notepad to convert them. Now they're linux eols along with dos eols. :-)

I just converted the file I mentioned above in the quote by deleting the linux eol and the dos eol and than pressing on each of the lines. Here is what it looks like now:

@echo off
REM
REM Copyright 2005-2010 Intel Corporation.  All Rights Reserved.
REM
REM This file is part of Threading Building Blocks.
REM
REM Threading Building Blocks is free software; you can redistribute it
REM and/or modify it under the terms of the GNU General Public License
REM version 2 as published by the Free Software Foundation.
REM
REM Threading Building Blocks is distributed in the hope that it will be
REM useful, but WITHOUT ANY WARRANTY; without even the implied warranty
REM of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with Threading Building Blocks; if not, write to the Free Software
REM Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
REM
REM As a special exception, you may use this file as part of a free software
REM library without restriction.  Specifically, if other files instantiate
REM templates or use macros or inline functions from this file, or you compile
REM this file and link it with other files to produce an executable, this
REM file does not by itself cause the resulting executable to be covered by
REM the GNU General Public License.  This exception does not however
REM invalidate any other reasons why the executable file might be covered by
REM the GNU General Public License.
REM
set SCRIPT_NAME=%~nx0
if (%1) == () goto Syntax
SET TBB30_BIN_DIR=%~d0%~p0
SET TBB30_INSTALL_DIR=%TBB30_BIN_DIR%..
:ParseArgs
:: Parse the incoming arguments
if /i "%1"==""        goto SetEnv
if /i "%1"=="ia32"         (set TBB_TARGET_ARCH=ia32)    & shift & goto ParseArgs
if /i "%1"=="intel64"      (set TBB_TARGET_ARCH=intel64) & shift & goto ParseArgs
if /i "%1"=="vs2005"       (set TBB_TARGET_VS=vc8)       & shift & goto ParseArgs
if /i "%1"=="vs2008"       (set TBB_TARGET_VS=vc9)       & shift & goto ParseArgs
if /i "%1"=="vs2010"       (set TBB_TARGET_VS=vc10)      & shift & goto ParseArgs
if /i "%1"=="all"          (set TBB_TARGET_VS=vc_mt)     & shift & goto ParseArgs
:SetEnv
if  ("%TBB_TARGET_VS%") == ("") set TBB_TARGET_VS=vc_mt
SET TBB_ARCH_PLATFORM=%TBB_TARGET_ARCH%%TBB_TARGET_VS%
if exist "%TBB30_BIN_DIR%%TBB_ARCH_PLATFORM%tbb.dll" SET PATH=%TBB30_BIN_DIR%%TBB_ARCH_PLATFORM%;%PATH%
if exist "%TBB30_INSTALL_DIR%..redist%TBB_TARGET_ARCH%tbb%TBB_TARGET_VS%tbb.dll" SET PATH=%TBB30_INSTALL_DIR%..redist%TBB_TARGET_ARCH%tbb%TBB_TARGET_VS%;%PATH%
SET LIB=%TBB30_INSTALL_DIR%lib%TBB_ARCH_PLATFORM%;%LIB%
SET INCLUDE=%TBB30_INSTALL_DIR%include;%INCLUDE%
IF ("%ICPP_COMPILER11%") NEQ ("") SET TBB_CXX=icl.exe
IF ("%ICPP_COMPILER12%") NEQ ("") SET TBB_CXX=icl.exe
goto End
:Syntax
echo Syntax:
echo  %SCRIPT_NAME% ^ ^
echo    ^ must be is one of the following
echo        ia32         : Set up for IA-32  architecture
echo        intel64      : Set up for Intel 64  architecture
echo    ^ should be one of the following
echo        vs2005      : Set to use with Microsoft Visual Studio 2005 runtime DLLs
echo        vs2008      : Set to use with Microsoft Visual Studio 2008 runtime DLLs
echo        vs2010      : Set to use with Microsoft Visual Studio 2010 runtime DLLs
echo        all         : Set to use TBB statically linked with Microsoft Visual C++ runtime
echo    if ^ is not set TBB statically linked with Microsoft Visual C++ runtime will be used.
exit /B 1
:End
exit /B 0
t3h p3ngu1nz 15 b4k

I just tried the new tbbvars.bat, and it worked, except for one thing. *sigh* I tried the fibonacci sample again, and the includes worked (not full paths; e.g. tbb/atomic.h), but there was a error:

1>------ Build started: Project: fibonacci_tbb, Configuration: Debug Win32 ------
1>  Fibonacci.cpp
1>LINK : fatal error LNK1104: cannot open file 'tbb_debug.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Were the lib paths updated?

t3h p3ngu1nz 15 b4k

I'm done! I manually updated the lib path with this command:

set path=C:Program FilesIntelTBB3.0 Update 1 Commercial-Aligned Releasebinia32vc10;%path%

Now the fibonacci sample works!
(My install path will probably be different from other people's install paths. If you've already set the TBB30_INSTALL_DIR, use it like this:

set path=%TBB_INSTALL_DIR%binia32;%path%

)
A big thank you to all the people who replied!

t3h p3ngu1nz 15 b4k

Leave a Comment

Please sign in to add a comment. Not a member? Join today