# Build VTK with TBB

**URL:** https://discourse.vtk.org/t/build-vtk-with-tbb/2686
**Category:** Support
**Created:** [February 23, 2020, 10:11pm UTC](https://discourse.vtk.org/t/build-vtk-with-tbb/2686 "2020-02-23T22:11:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Max](https://discourse.vtk.org/user_avatar/discourse.vtk.org/max/32/1420_2.png) [@Max](https://discourse.vtk.org/u/Max)
#### Post date: [February 23, 2020, 10:11pm UTC](https://discourse.vtk.org/t/build-vtk-with-tbb/2686/1 "2020-02-23T22:11:23Z")

</div>

Hello,

can anyone guide me how to build VTK with VTK\_SMP\_IMPLEMENTATION\_TYPE = TBB on Windows?

I downloaded TBB from [https://github.com/intel/tbb/releases](https://github.com/intel/tbb/releases).  
[tbb-2020.1-win.zip](https://github.com/intel/tbb/releases/download/v2020.1/tbb-2020.1-win.zip)

Unfortunately, I don’t know which folders have to be set since there are various possibilities (e.g. tbb/bin/intel64/vc14 or tbb/bin/intel64/vc14 etc.).

 ![image](https://discourse.vtk.org/uploads/default/original/2X/1/12212fe24c29add6eb5f6903c1895d1245c34148.png)

I tried to set all “INCLUDE\_DIR” to “tbb\include” all “LIBRARY” DIRs to “tbb\lib\intel64\vc14” but I received some TBB related build errors.

Moreover there is a QGLWidget related error which also occurs when building without TBB.

 ![image](https://discourse.vtk.org/uploads/default/original/2X/c/c8a71008710fbc70feb770445e2d9ba328851790.png)

Thank you for your help.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [February 24, 2020, 1:19am UTC](https://discourse.vtk.org/t/build-vtk-with-tbb/2686/2 "2020-02-24T01:19:37Z")

</div>

Most applications nowadays depend on a number of third-party libraries, which are downloaded/built automatically using CMake External Project infrastructure.

In your project, you would dowbload TBB and pass its path to VTK. See an example here: [https://github.com/Slicer/Slicer/blob/master/SuperBuild/External\_VTK.cmake](https://github.com/Slicer/Slicer/blob/master/SuperBuild/External_VTK.cmake)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [February 24, 2020, 2:38am UTC](https://discourse.vtk.org/t/build-vtk-with-tbb/2686/3 "2020-02-24T02:38:51Z")

</div>

FYI, you can build with OpenMP easilly as it is integrated in visual studio.

---

<div class="post-metadata">

### Author: ![shogarth](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/7ba0ec/32.png) [@shogarth](https://discourse.vtk.org/u/shogarth)
#### Post date: [February 24, 2020, 10:34pm UTC](https://discourse.vtk.org/t/build-vtk-with-tbb/2686/4 "2020-02-24T22:34:53Z")

</div>

If you need to configure TBB manually, you can do that by:  
VTK\_SMP\_IMPLEMENTATION\_TYPE: VTK  
TBB\_INCLUDE\_DIR: Path to the folder which contains tbb/tbb.h  
TBB\_LIBRARY\_DEBUG: (Path)/tbb\_debug.lib  
TBB\_LIBRARY\_RELEASE: (Path)/tbb.lib

Also, make sure to always use forward slashes with cmake paths.

---

<div class="post-metadata">

### Author: ![hcwiley](https://discourse.vtk.org/user_avatar/discourse.vtk.org/hcwiley/32/638_2.png) [@hcwiley](https://discourse.vtk.org/u/hcwiley)
#### Post date: [February 28, 2020, 4:37pm UTC](https://discourse.vtk.org/t/build-vtk-with-tbb/2686/5 "2020-02-28T16:37:45Z")

</div>

I have built VTK with TBB on macOS, linux, and iOS. Still need to get around to Android. (We don’t use windows sorry)

Here’s my configure command:

```bash
export TBB_ROOT=$PATH_TO_TBB//tbb_2019-linux/

cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=$PWD/install \
    -DBUILD_EXAMPLES=OFF \
    -DBUILD_TESTING=OFF \
    -DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
  ../vtk

```

You might have to configure the `FindTBB.cmake` to not use the CMAKE\_FIND\_ROOT\_PATH like I did for iOS: [https://gitlab.kitware.com/vtk/vtk/merge\_requests/4862/diffs#9cc788f89f8295fd16deed0c681d2837096b4b47\_282\_283](https://gitlab.kitware.com/vtk/vtk/merge_requests/4862/diffs#9cc788f89f8295fd16deed0c681d2837096b4b47_282_283)

Hope this helps!
