VTK w/ TBB missing TBB config info in CMake
VTK built against TBB exposes several TBB includes ({atomic,blocked_range,parallel_for}.h
), in what are -- as far as I can tell -- public headers: vtkAtomic.h
and vtkSMPThreadLocal.h
(also vtkSMPToolsInternal.h
, but that's not public).
This appears to mean that any program linked against VTK w/TBB needs to make TBB headers available. However, I don't see a way to discover that fact using VTKConfig.cmake, except by grep'ing the INTERFACE_LINK_LIBRARIES
for libtbb.
Given the error below, it's unclear how I would determine, from VTK CMake config files, that ITK needs to pass TBB header paths to ITKVtkGlue (assuming ITK was also built with TBB -- otherwise it should probably raise an error).
example error in ITKVtkGlue (click to expand)
[100%] Built target ITKIOMesh
In file included from /bp/_h_env/include/vtk-8.1/vtkAtomicTypes.h:18:0,
from /bp/_h_env/include/vtk-8.1/vtkObjectBase.h:54,
from /bp/_h_env/include/vtk-8.1/vtkObject.h:45,
from /bp/_h_env/include/vtk-8.1/vtkVersion.h:32,
from /bp/work/build/ITKv5/Modules/Bridge/VtkGlue/src/QuickView.cxx:25:
/bp/_h_env/include/vtk-8.1/vtkAtomic.h:28:10: fatal error: tbb/atomic.h: No such file or directory
#include <tbb/atomic.h>
^~~~~~~~~~~~~~
compilation terminated.
[100%] Built target ITKIOMesh-all
make[2]: *** [Modules/Bridge/VtkGlue/src/CMakeFiles/ITKVtkGlue.dir/QuickView.cxx.o] Error 1
make[1]: *** [Modules/Bridge/VtkGlue/src/CMakeFiles/ITKVtkGlue.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
related: #16867 (closed)