Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

MKL 2025.2 CMake does not find TBB

NickAnthony
Beginner
4,132 Views

I have both MKL and TBB installed with oneAPI 2025.2. When trying to detect MKL with `find_package(MKL CONFIG REQUIRED)` it fails because it claims that TBB cannot be found. Running the same operation with 2025.1 works without issue.

 

The difference appears to be because of line 837 of MKLConfig.cmake. In 2025.1 the line checks if TBB was not found using: `if(NOT TBB_FOUND)`. However in version 2025.2 it uses ` if(NOT TBB_tbb_FOUND)`

 

Modifying the cmake file so that line 837 matches how it was in version 2025.1 seems to fix the issue.

0 Kudos
4 Replies
Viraj_M_Intel
Employee
3,982 Views

Hi @NickAnthony 

We need some information in order to help further.

  1. Which install method did you use to install oneMKL and TBB? - oneAPI installer/apt/pip etc.
  2. Are you using Linux or Windows?
  3. How did you setup the oneAPI runtime environment? Did you use setvars.sh/bat or manually setup the PATH and/or LD_LIBRARY_PATH values?
  4. Can you list the library files inside the tbb/2025.2/lib folder?
  5. Can you also upload the TBBConfig.cmake file from tbb/2025.2/lib/cmake folder?

Thank you.

0 Kudos
NickAnthony
Beginner
3,961 Views

I am on Windows and I installed MKL and TBB with the 2025.2 oneAPI installer.

 

Although I have TBB 2022.2 installed from the oneAPI installer when I build I am actually using 2022.1 (provided by Vcpkg). So maybe it is just that the CMake file for MKL 2025.2 is incompatible with TBB 2022.1?

0 Kudos
Fengrui
Moderator
2,813 Views

It should be compatible. Could you please provide the configure output with -DCMAKE_FIND_DEBUG_MODE=on?

 

Thanks,

Fengrui

0 Kudos
Viraj_M_Intel
Employee
2,343 Views

@NickAnthony 

Just to clarify - the issue you reported:


`find_package(MKL CONFIG REQUIRED)` fails because it claims that TBB cannot be found. Running the same operation with 2025.1 works without issue.


occurs because starting 2025.2, MKLConfig.cmake forces release version of TBB to be used whereas 2025.1 MKLConfig.cmake will work with `libtbb_debug.so/a/lib/dll` as well which may provide a lower performance than the release version of TBB (libtbb.so/a/lib/dll).

 

In your case, it is possible that you have 2 installations of TBB on your machine and/or only the debug TBB is available in the shell/vcpkg environment, so @Fengrui 's approach will help debug this environment setup.

0 Kudos
Reply