Debug build of VTK-9.4 fail on Windows if VTK_ENABLE_KITS
is enabled, with this error:
CommonCore-objects.dir\Debug\CommonCore-objects.lib : fatal error LNK1248: image size (10098384C) exceeds maximum allowable size (FFFFFFFF) [C:\D\VTK-bin\Common\Core\CommonCore-objects.vcxproj]
This is a problem, because we can no longer build 3D Slicer in debug mode on Windows.
Full build command:
cmake c:\D\VTK -G "Visual Studio 17 2022" -T "v143" -DVTK_ENABLE_KITS:BOOL=ON
cmake --build . --config Debug -- /m
VTK 9.2 was built successfully with the same options. The issue seems to be that CommonCore
is actually huge now. Size of VTK-bin\Common\Core\CommonCore.dir\Debug
is 7.9GB in VTK-9.4, while it was 3.1GB in VTK-9.2.
The difference is about 230 extra files in VTK-bin\Common\Core\CommonCore.dir\Debug
folder:
vtkAffineArrayInstantiate_<type>.obj
vtkCompositeArrayInstantiate_<type>.obj
vtkConstantArrayInstantiate_<type>.obj
vtkIndexedArrayInstantiate_<type>.obj
vtkStdFunctionArrayInstantiate_<type>.obj
vtkStructuredPointArrayInstantiate_<type>.obj
vtkTypedDataArrayInstantiate_<type>.obj
vtkAffine<type>Array.obj
vtkComposite<type>Array.obj
vtkConstant<type>Array.obj
vtkIndexed<type>Array.obj
vtkAffineImplicitBackendInstantiate_<type>.obj
vtkCompositeImplicitBackendInstantiate_<type>.obj
vtkConstantImplicitBackendInstantiate_<type>.obj
vtkIndexedImplicitBackendInstantiate_<type>.obj
vtkStructuredPointBackendInstantiate_<type>.obj
vtkDataArray<operation>.obj
I’ve tried to add -DVTK_DISPATCH_AFFINE_ARRAYS:BOOL=OFF -DVTK_DISPATCH_CONSTANT_ARRAYS:BOOL=OFF -DVTK_DISPATCH_STD_FUNCTION_ARRAYS:BOOL=OFF -DVTK_DISPATCH_STRUCTURED_POINT_ARRAYS:BOOL=OFF
but it resulted in many build errors similar to this:
35>C:\D\S4D\VTK\Common\Core\vtkDataArray_GetTuples_ids.cxx(24,33): error C2039: 'DataArrayTupleRange': is not a member of 'vtk'
35> C:\D\S4D\VTK\Common\Core\vtkAOSDataArrayTemplate.h(29,11):
35> see declaration of 'vtk'
35> C:\D\S4D\VTK\Common\Core\vtkDataArray_GetTuples_ids.cxx(24,33):
35> the template instantiation context (the oldest one first) is
35> C:\D\S4D\VTK\Common\Core\vtkDataArray_GetTuples_ids.cxx(66,5):
35> see reference to function template instantiation 'void `anonymous-namespace'::GetTuplesFromListWorker::operator ()<vtkDataArray,vtkDataArray>(Array1T *,Array2T *) const' being compiled
35> with
35> [
35> Array1T=vtkDataArray,
35> Array2T=vtkDataArray
35> ]
Would it be possible to move back implicit arrays into their own CommonImplicitArrays
component as it was before?
If that was impractical, could someone provide CMake flags that allow building VTK without implicit arrays?