Search code examples
visual-studio-2015buildtbbdevenv

How to build TBB using VS2015 x64 from the command line?


I want to build Intel Threading Building Blocks from the command line using Visual Studio 2015 x64. I downloaded the last stable version from https://www.threadingbuildingblocks.org/.

The directory tbb2017_20161128oss\build\vs2012 contains besides some other files:

makefile.sln 
tbb.vcxproj 
tbbmalloc.vcxproj 
tbbmalloc_proxy.vcxproj

To build the Debug version of TBB I tried the following command in a VS2015 x64 Native Tools Command Prompt:

Devenv makefile.sln /build Debug /project tbb

But I get the following error:

Microsoft Visual Studio 2015 Version 14.0.25420.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: tbb, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(344,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1>  generating tbb.def file
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets(172,5): error MSB6006: "cmd.exe" exited with code -1073741515.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The problem here is that the VS2012 files need to be upgraded. When I open the file makefile.sln manually these windows pops up:

VC Upgrade Message

If I hit the "OK" button and retry env makefile.sln /build Debug /project tbb again everything works fine.

Since I plan to build TBB on several computers this manual task is annoying. Can it be avoided? Is there a way to upgrade a solution from the command line?


Solution

  • You should run devenv makefile.sln /upgrade before build command.

    BTW you can get the binaries from Download page