# Building ParaView 5.10.1 on a Debian 10 machine

**URL:** https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329
**Category:** ParaView Support
**Created:** [September 15, 2022, 3:43pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329 "2022-09-15T15:43:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![DeX97](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/bbce88/32.png) [@DeX97](https://discourse.paraview.org/u/DeX97)
#### Post date: [September 15, 2022, 3:43pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329/1 "2022-09-15T15:43:13Z")

</div>

Dear ParaView users,

I have encountered an issue when trying to install ParaView 5.10.1 on a Debian 10 machine. I expect the issue to be an easy fix, but unfortunately I was not able to resolve it myself.

To build ParaView from source, I followed the build instructions described [here](https://github.com/Kitware/ParaView/blob/v5.10.1/Documentation/dev/build.md). At first, I made sure to install all required dependencies as specified in the build instructions. Then, I cloned the GitHub repository and checked out the proper tag:

```sh
git clone --recursive https://gitlab.kitware.com/paraview/paraview.git
cd ParaView
git checkout v5.10.1
git submodule update --init --recursive

```

For building and installing ParaView, I created the following shell script (note that I disabled QT, as I only require pvserver):

```bash
#!/bin/sh

# Settings
BASE_DIR="<some-path>"
PARAVIEW_SOURCE_DIR="$BASE_DIR/ParaView"
PARAVIEW_BUILD_DIR="$BASE_DIR/build"
PARAVIEW_INSTALL_DIR="$BASE_DIR/paraview-5.10.1-install"
OSPRAY_DIR="$BASE_DIR/ospray-2.10.0.x86_64.linux"

# Create the build directory
mkdir -p $PARAVIEW_BUILD_DIR
cd $PARAVIEW_BUILD_DIR

# Generate Ninja build files
cmake -GNinja $PARAVIEW_SOURCE_DIR \
    -DPARAVIEW_USE_PYTHON=ON \
    -DPARAVIEW_USE_MPI=OFF \
    -DPARAVIEW_USE_CUDA=OFF \
    -DPARAVIEW_USE_QT=OFF \
    -DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
    -DPARAVIEW_ENABLE_RAYTRACING=ON \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DCMAKE_INSTALL_PREFIX="$PARAVIEW_INSTALL_DIR" \
    -DCMAKE_PREFIX_PATH="$OSPRAY_DIR" \
    -DCMAKE_BUILD_TYPE=Release 

# If generation of Ninja build files was succesful, start the build
if [$? -eq 0]; then
    ninja install
else
    echo "Generating build files failed."
fi

```

Note that in the `BASE_DIR` directory, I placed the OSPRay binaries downloaded from [here](https://www.ospray.org/downloads.html).

CMake’s generation stage goes well. Unfortunately, I receive the following linker errors during the build stage:

```auto
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::interface7::internal::task_arena_base::internal_max_concurrency(tbb::interface7::task_arena const*)'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::get_initial_auto_partitioner_divisor()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::interface7::internal::task_arena_base::internal_initialize()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `typeinfo for tbb::task'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::allocate_continuation_proxy::allocate(unsigned long) const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::task_group_context::is_group_execution_cancelled() const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::concurrent_vector_base_v3::internal_grow_by(unsigned long, unsigned long, void (*)(void*, void const*, unsigned long), void const*)'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::task::self()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::concurrent_vector_base_v3::~concurrent_vector_base_v3()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::NFS_Allocate(unsigned long, unsigned long, void*)'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::allocate_child_proxy::allocate(unsigned long) const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::task_group_context::cancel_group_execution()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::concurrent_vector_base_v3::internal_capacity() const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::concurrent_vector_base_v3::internal_clear(void (*)(void*, unsigned long))'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::allocate_via_handler_v3(unsigned long)'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::interface7::internal::task_arena_base::internal_execute(tbb::interface7::internal::delegate_base&) const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::interface7::internal::task_arena_base::internal_terminate()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::task::note_affinity(unsigned short)'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::NFS_Free(void*)'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::task_group_context::~task_group_context()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::task_group_context::init()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::thread_get_id_v3()'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::allocate_root_with_context_proxy::free(tbb::task&) const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::allocate_root_with_context_proxy::allocate(unsigned long) const'
/usr/bin/ld: lib/libvtkCommonCore-pv5.10.so.5.10: undefined reference to `tbb::internal::deallocate_via_handler_v3(void*)'

```

The errors are clearly related to either a missing TBB library or a wrong version of the TBB library. However, I did install libtbb-dev as stated in the build instructions. From the instructions, I quote:

> Ubuntu 18.04 LTS / **Debian 10**  
> `sudo apt-get install git cmake build-essential libgl1-mesa-dev libxt-dev qt5-default libqt5x11extras5-dev libqt5help5 qttools5-dev qtxmlpatterns5-dev-tools libqt5svg5-dev python3-dev python3-numpy libopenmpi-dev libtbb-dev ninja-build`

Notice the second-to-last entry in the `apt-get` command. To be sure, I checked my installed packages and found the following entry:

> libtbb-dev/oldstable,now 2018~U6-4 amd64 [installed]

The TBB library thus seems to be present on the system.

I hope someone has a good suggestion on how to overcome this issue.

Best regards,  
Danny

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 16, 2022, 2:34am UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329/2 "2022-09-16T02:34:45Z")

</div>

A simple work around is of course to disable TBB SMP backend and to use STDThread.

Another thing to try would be to build VTK with TBB and see if the error is the same.

FYI @Charles_Gueunet

---

<div class="post-metadata">

### Author: ![DeX97](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/bbce88/32.png) [@DeX97](https://discourse.paraview.org/u/DeX97)
#### Post date: [September 16, 2022, 7:30pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329/3 "2022-09-16T19:30:04Z")

</div>

@mwestphal Thank you for the suggestion! Changing the SMP backend from TBB to STDThread indeed worked.

I tried building VTK with the TBB SMP backend using the following commands:

```nohighlight
git clone --recursive https://gitlab.kitware.com/vtk/vtk.git
cd vtk
mkdir build
cd build
cmake -GNinja .. \
    -DVTK_USE_MPI=OFF \
    -DVTK_USE_CUDA=OFF \
    -DVTK_SMP_IMPLEMENTATION_TYPE=TBB \
    -DCMAKE_BUILD_TYPE=Release
ninja

```

During CMake’s generation stage, it gives me the following message:

```auto
-- Could NOT find TBB (missing: TBB_DIR)

```

However, the configuration stage finishes without errors. I can also build the code without errors, so it seems to be working fine. I checked CMake’s cache variables for any variables related to TBB using `cmake -LA . -N | grep "TBB"`, which gives me the following output:

```auto
TBB_DIR:PATH=TBB_DIR-NOTFOUND
TBB_INCLUDE_DIR:PATH=/usr/include
TBB_LIBRARY_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbb.so
TBB_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbb.so
TBB_MALLOC_INCLUDE_DIR:PATH=/usr/include
TBB_MALLOC_LIBRARY_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbbmalloc.so
TBB_MALLOC_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbbmalloc.so
TBB_MALLOC_PROXY_INCLUDE_DIR:PATH=/usr/include
TBB_MALLOC_PROXY_LIBRARY_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so
TBB_MALLOC_PROXY_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so
VTK_SMP_IMPLEMENTATION_TYPE:STRING=TBB

```

It seems that the only problematic variable is `TBB_DIR`, as all other TBB related variables contain the proper (file)paths.

I once more tried to build ParaView with the script I supplied above (so including the `-DVTK_SMP_IMPLEMENTATION_TYPE=TBB` option) to compare its output with the output of the VTK build. I didn’t notice this the first time, but during the configuration stage it also gives me the same message about the missing `TBB_DIR` variable. However, in this case the TBB related cache variables have different values:

```auto
TBB_DIR:PATH=TBB_DIR-NOTFOUND
TBB_INCLUDE_DIR:PATH=/usr/include
TBB_LIBRARY_DEBUG:FILEPATH=<some-path>/ospray-2.10.0.x86_64.linux/lib/libtbb.so
TBB_LIBRARY_RELEASE:FILEPATH=<some-path>/ospray-2.10.0.x86_64.linux/lib/libtbb.so
TBB_MALLOC_INCLUDE_DIR:PATH=/usr/include
TBB_MALLOC_LIBRARY_DEBUG:FILEPATH=<some-path>/ospray-2.10.0.x86_64.linux/lib/libtbbmalloc.so
TBB_MALLOC_LIBRARY_RELEASE:FILEPATH=<some-path>/ospray-2.10.0.x86_64.linux/lib/libtbbmalloc.so
TBB_MALLOC_PROXY_INCLUDE_DIR:PATH=/usr/include
TBB_MALLOC_PROXY_LIBRARY_DEBUG:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so
TBB_MALLOC_PROXY_LIBRARY_RELEASE:FILEPATH=/usr/lib/x86_64-linux-gnu/libtbbmalloc_proxy.so
VTK_SMP_IMPLEMENTATION_TYPE:STRING=TBB

```

As you can see, it is a mix of the TBB libraries supplied by the OSPRay package and the TBB libraries present on the system. I suspect this is caused by the `-DCMAKE_PREFIX_PATH="$OSPRAY_DIR"` option. I use that option to make sure CMake can find the required OSPRay libraries, but it thus also brings additional TBB libraries into scope.

My current fix is to exchange the aforementioned option by `-Dospray_DIR=<path>`, where `<path>` is the path to the `osprayConfig.cmake` file (located in the OSPRay package). Using this option, the TBB related cache variables match the ones I had in the VTK build. With the proper paths in these cache variables, I no longer get the linker errors.

Unfortunately, I didn’t find out why `TBB_DIR` seems to be missing.

---

<div class="post-metadata">

### Author: ![aron.helser](https://discourse.paraview.org/user_avatar/discourse.paraview.org/aron.helser/32/13_2.png) [@aron.helser](https://discourse.paraview.org/u/aron.helser)
#### Post date: [September 16, 2022, 8:22pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329/4 "2022-09-16T20:22:25Z")

</div>

`TBB_DIR` is just a shortcut for setting the other TBB related variables - it is safe to ignore this warning when the other variables are set correctly.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 19, 2022, 1:52am UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329/5 "2022-09-19T01:52:47Z")

</div>

CMake grabbing ospray TBB is unfortunate, but it feels like more of a cmake issue than ParaView.

I’m glad you figured it out though 🙂

---

<div class="post-metadata">

### Author: ![DeX97](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/bbce88/32.png) [@DeX97](https://discourse.paraview.org/u/DeX97)
#### Post date: [September 22, 2022, 3:41pm UTC](https://discourse.paraview.org/t/building-paraview-5-10-1-on-a-debian-10-machine/10329/6 "2022-09-22T15:41:53Z")

</div>

@mwestphal It indeed was a CMake issue rather than a ParaView issue. Unfortunately, I only found out _after_ your suggestion to build VTK with TBB 😅
