# CMake says TBB version incompatible with ITK installed via conda/mamba

**URL:** https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771
**Category:** Beginner Questions
**Tags:** cmake
**Created:** [March 1, 2023, 8:51am UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771 "2023-03-01T08:51:43Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![KrisThielemans](https://discourse.itk.org/user_avatar/discourse.itk.org/kristhielemans/32/1633_2.png) [@KrisThielemans](https://discourse.itk.org/u/KrisThielemans)
#### Post date: [March 1, 2023, 8:51am UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/1 "2023-03-01T08:51:43Z")

</div>

Hi

I installed ITK on a Windows 10 machine via

```auto
mamba create -n pvc install petpvc libitk-devel

```

(`petpvc` requires `libitk`). I then used (non-Conda) CMake 3.25.2 (and VS 2022) to try and build PETPVC sources. After setting `ITK_DIR` I get

```auto
CMake Error at C:/Users/xxx/miniconda3/envs/pvc/Library/lib/cmake/ITK-5.3/Modules/ITKBBB.cmake:15 (find_package)
Could not find a configuration file for package "TBB" that is compatible with requestion version "".

The following configuration files were considered but not accepted:
C:/Users/xxx/miniconda3/envs/pvc/Library/lib/cmake/TBB/TBBConfig.cmake, version: 2021.8.0 (64bit)

Call stack (most recent calls first):
  C:/Users/xxx/miniconda3/envs/pvc/Library/lib/cmake/ITK-5.3/ITKModuleAPI.cmake (76) include)
   <snip>

```

I’ve seen this type of (in my opinion confusing) CMake message about incompatible versions before but then it normally is followed by a missing library/component or whatever, but here I had no further diagnostics.

I’ve tried to reproduce this on a different Windows 10 machine (using same CMake, same mamba command etc), (I have only restricted access to the previous one), but there it works fine…

Checking the content of `.../ITK-5.3/Modules/ITKTBB.cmake` on the second machine it contains

```auto
set(TBB_DIR "C:/Users/krisf/miniconda3/envs/petpvc/Library/lib/cmake/TBB")
find_package(TBB REQUIRED CONFIG)

```

so indeed it doesn’t ask for a version so all looks fine.

Any ideas?

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [March 1, 2023, 2:00pm UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/2 "2023-03-01T14:00:32Z")

</div>

Good morning,

This is related to the [libitk-feedstock](https://github.com/conda-forge/libitk-feedstock/blob/main/recipe/meta.yaml) in Conda forge.

Is the “tbb-devel” Conda package installed?

---

<div class="post-metadata">

### Author: ![KrisThielemans](https://discourse.itk.org/user_avatar/discourse.itk.org/kristhielemans/32/1633_2.png) [@KrisThielemans](https://discourse.itk.org/u/KrisThielemans)
#### Post date: [March 1, 2023, 2:46pm UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/3 "2023-03-01T14:46:42Z")

</div>

Hi, yes, it might be related to the feedstock, but I’m not sure, given the confusing message and the fact the conda package works on another windows pc.

Sorry to be incomplete, yes, the `tbb-devel` is installed (v 2021.8.0). I guess that supplied `.../lib/cmake/TBB/TBBConfig.cmake` that CMake found (but rejected for unclear reasons).

I will get access to the other PC in the next few days again, but if anyone has any suggestions on what I could try, that’d help.

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [March 2, 2023, 5:46pm UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/4 "2023-03-02T17:46:50Z")

</div>

> [@KrisThielemans](#):
>
> I guess that supplied `.../lib/cmake/TBB/TBBConfig.cmake` that CMake found (but

For building libsimpleitk recipe in conda forge this: ’ -D “CMAKE\_FIND\_ROOT\_PATH:PATH=${PREFIX}” ’ CMake argument was required before it was moved to the CMAKE\_ARGS variable in the recipe build scripts. Perhaps some of these CMake variable are important for configuring your project to use condo forge packages: [Use CMAKE\_ARGS is build.sh · conda-forge/libsimpleitk-feedstock@aaf9da6 · GitHub](https://github.com/conda-forge/libsimpleitk-feedstock/commit/aaf9da6b36cc68832c41583bf9fa96a0f45ec4b2)

---

<div class="post-metadata">

### Author: ![KrisThielemans](https://discourse.itk.org/user_avatar/discourse.itk.org/kristhielemans/32/1633_2.png) [@KrisThielemans](https://discourse.itk.org/u/KrisThielemans)
#### Post date: [March 2, 2023, 7:05pm UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/5 "2023-03-02T19:05:34Z")

</div>

thanks @blowekamp . Unfortunately, I cannot see how this is going to help. The `CMAKE_FIND_ROOT_PATH` would be necessary if CMake didn’t find TBB at all, but it did find the relevant file, it just wasn’t happy with it…

But I’ll give it a go when I have access.

---

<div class="post-metadata">

### Author: ![KrisThielemans](https://discourse.itk.org/user_avatar/discourse.itk.org/kristhielemans/32/1633_2.png) [@KrisThielemans](https://discourse.itk.org/u/KrisThielemans)
#### Post date: [March 24, 2023, 7:50pm UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/6 "2023-03-24T19:50:27Z")

</div>

sorry for the delay. Adding `CMAKE_FIND_ROOT_PATH` did not help.

This is all quite weird. I checked the content of `C:/Users/xxx/miniconda3/envs/pvc/Library/lib/cmake/TBB/TBBConfig.cmake`, and it contains

```plaintext
include(${CMAKE_CURRENT_LIST_DIR}/TBBTargets.cmake)

```

(as expected). I put a `message(STATUS "I am here")` in front of the `include`, and it doesn’t appear. (Putting a `message` in `ITKTBB.cmake` before the `find_package` does work).  
So, `find_package` is rejecting the file without actually parsing it.

Amazingly, saving `TBBConfig.cmake` as `TBB2Config.cmake` and modifying `ITKTBB.cmake` to do `find_package(TBB2 ...)` means that the file **is** read. I then get an identical message on `hdf5-config.cmake` though.

I have no idea why this is happening… (nor any idea how to debug it. `cmake --debug-find` doesn’t show up anything helpful to diagnose this as far as I can see). Maybe it’s some strange file permission problem (although can read/write the file with wordpad for instance).

Oh well.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [March 24, 2023, 8:19pm UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/7 "2023-03-24T20:19:30Z")

</div>

[CMake debugger](https://devblogs.microsoft.com/cppblog/cmake-debugger-allows-you-to-debug-your-cmake-scripts-and-more/) is currently in VS preview, but worth trying. I have not tried this myself - waiting for it to come to a stable version.

---

<div class="post-metadata">

### Author: ![KrisThielemans](https://discourse.itk.org/user_avatar/discourse.itk.org/kristhielemans/32/1633_2.png) [@KrisThielemans](https://discourse.itk.org/u/KrisThielemans)
#### Post date: [March 25, 2023, 11:08am UTC](https://discourse.itk.org/t/cmake-says-tbb-version-incompatible-with-itk-installed-via-conda-mamba/5771/8 "2023-03-25T11:08:23Z")

</div>

That looks like a great addition, thanks for that pointer! However, I don’t think this will help in this case. Putting in my manual print statements shows that the call to `find_package` returned without getting into the relevant CMake file (while it did find it). I doubt that the debugger will step “into” `find_package`
