TBB DLL problem with new version of Visual Studio

Hi all,

I recently encountered something really strange, and since I saw this problem on three different machines, I think it is caused by the latest versions of Visual Studio.

If we build Slicer (in Debug or Release, occurs with both), although the splash screen shows up, this error appears, and then Slicer exits.
Screenshot 2024-06-21 104356

The superbuild tree contains files with such name

What I suspect is that the issue was introduced with an update of Visual Studio, because everything worked with MSVC compiler version 14.39.33519, but we had the TBB issue with version 14.40.33807.

Does anyone have any idea how to fix this? Thank you very much!

1 Like

An update: I thought the name of the folder was the same as the MSVC version, which for some reason isnā€™t. For example the folder
C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215 contains MSVC 19.35.32215.0. The versions above correspond to the directory name.

Does copying tbb123.dll into the folder that contains SlicerApp-real.exe fix the issue?

Does the issue occur only in the build tree or also in the install tree (if you create an install package)?

There is some FindVcvars.cmake update stuff needed for VS 17.10 which has MSVC 1940.

It had been updated on the scikit-built side, but Iā€™ve backported the required changes on the Slicer side. I havenā€™t tried yet if this is all that is needed to fix your issue, but definitely required for MSVC 1940 usage.

1 Like

Thanks a lot for the answers!

I tried different things, but to unblock the work I ended up rebuilding with the v142 toolset. It worked. But I messed up my v143 build tree, so to be able to help solve this issue (I know about at least one other person who had it) I started a new build with the problematic compiler version. Iā€™ll report back on Monday.

Have a great weekend!

(@jamesobutler Iā€™ll update and try!)

I tried using v142 toolset and v143 toolset 14.39.33519,both encountered this tbb12 dll issue.
So I think this may not be a toolset version problem?

I get the same error trying to build with VS 2022. Has anyone been able to figure this out? Iā€™m trying to build my first loadable module for Project week ā€“ should I install a different version of Visual Studio? If so, could you please tell me which one?

v142 worked for me.

My latest clean v143 build also showed missing VTK OpenGL DLL issues, but I went ahead with updating Slicer as @jamesobutler suggested, Iā€™ll see if they disappear. (Yesterday was holiday here so didnā€™t have access to the computers at the office)

The very latest Slicer (b0ed88351af465159b101fc434802c83fd438522) did not work as is, I had the same TBB DLL errors.

I copied all DLLs from S5R\tbb-install\redist\intel64\vc14 to S5R\Slicer-build\bin\Release and it solves the issue, Slicer starts. Although it took forever the first time (much longer than a normal ā€œfirst time after restartā€). I observed this long startup with v142 as well though, but this is a brand new computer so maybe itā€™s that (but definitely not performance issue, this is a really strong computer).

Packaging fails with

  CMake Error at C:/d/S5R/Slicer-build/CMake/LastConfigureStep/cmake_install.cmake:408 (file):
    file INSTALL cannot find "C:/d/S5R/tbb-install/redist/intel64/tbb12.dll":
    File exists.
  Call Stack (most recent call first):
    C:/d/S5R/Slicer-build/cmake_install.cmake:142 (include)


EXEC : CPack error : Error when generating package: Slicer [c:\d\S5R\Slicer-build\PACKAGE.vcxproj]

The following likely needs updating to say 1949 as it appears it is never setting tbb_vsdir. It has been an unusual case that 1940 is still Visual Studio 2022.

Quick update: I tried Csabaā€™s dll move and that also worked on my laptop with VS 2022. Slicer builds and runs. I know its only a temporary solution but it allows me to keep moving :-). Thanks!
Sarah

1 Like

Now that project week is over, Iā€™d like to ask if there is any plan to address this issue? I remember we had a time several years ago when we had to use an older compiler. Iā€™d be fine with that, but please give an update in case you had the chance to discuss it at the PW.

The reason Iā€™m asking is that I typically have many different Slicer builds, and Iā€™m just about to switch to a new machine, and Iā€™d like to avoid rebuilding everything more times than needed. So the question is basically should I wait or help, or proceed with the build using the v142 switch everywhere? Thank you very much!

If you can help confirm that the change mentioned below works that would be great!

I already checked, it didnā€™t. See:

Let me know if you were thinking of something else.

I think there may be some confusion. What I described in the below link is code that is not in a Slicer PR and not on Slicer main. A local change needs to be applied and tested.

Sorry Iā€™ll revise it again then and let you know!

1 Like

@jamesobutler The change you propose (change 1939 to 1949) works. Is this acceptable for everyone? @jcfr @lassoan

If so I can do a PR. Thanks for the help!

Yes I think that change makes sense considering Visual Studio 2022 having a MSVC version > 1939 was unexpected and I think this place in TBB is the remaining location where this MSVC version stuff could go wrong. A PR would be appreciated! Thanks for your testing.

This is the PR: COMP: Update acceptable VS2022 MSVC version for TBB install by cpinter Ā· Pull Request #7833 Ā· Slicer/Slicer Ā· GitHub

1 Like