If you tak a looke at TBB assets for Window/Linux/Mac then you will notice that it uses different naming convention for release and debug libraries. Release libs are called libtbb.so and Debug libtbb_debug.so.
In the same time SlicerBlockInstallTBB.cmake handles only Release mode. So if the Slicer is compiled with TBB in Debug mode then installed Slicer should not work as it is unable to load debug TBB.
I’m not sure but I propose to add something like (UNIX example):
I only tried to handle Debug and Release modes but cmake also supports RelWithDebInfo and MinSizeRel.
I don’t Know whether Slicer uses these build types but I don’t have experience of working with RelWithDebInfo and MinSizeRel thus I don’t know what libraries they need (debug or release).
Anyway I could to try fix this PR to handle RelWithDebInfo and MinSizeRel if needed.
You are right but I’m talking about installation (and packaging) like executing commands (assuming Slicer is built):
cd Slicer-build
cpack -B ../..
If you have built Slicer in Debug mode then Slicer is linked against libtbb_debug.so. That means if you want to install Slicer then you need to install libtbb_debug.so but Slicer installs libtbb.so instead. Thus when you try to run installed Slicer you should see something like libtbb_debug.so not found (but you have libtbb.so in the installation folder) and the app must fails to start. This happened to me on Ubuntu 20.04.
Generally speaking you aren’t meant to be making packages of debug or other non-release builds - I believe some tools won’t allow it or it’s against the license to redistribute the debug libs. But I guess there might be times when you’d want to.
Yes, and in my case I usually work with SlicerCAT and Debug mode. I needed to check whether I’m able able to correctly package the app or not (are there any bugs in my installation scripts).
The install rules have also been tested to make sure tbb release libraries are packaged.
That said, Debug libraries are still excluded. To support this, we would need to set the list of exceptions in SlicerFunctionInstallLibrary.cmake based on the build type by checking the value of CMAKE_BUILD_TYPE (only the case of single configuration generator).