Cannot read XML files over 2GB in Windows - expat issue
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
This has been observed in 6.1.0 and 6.2.0
vtkXMLRectilinearGridReader fails at reading XML data from a file that is larger than 2GB on the windows platforms.
This is due to the old version of expat being embedded as third-party lib in VTK. This version (1.95.2) uses a signed 'long' as index into the input stream. And, on (even 64 bits) windows, long's always are 32-bit.
The solution is to use an external, more recent version of expat. Any version after 2.0.0 (jan-2006) should do, with #define-ing the XML_LARGE_SIZE preprocessor macro. VTK can then be linked with this external expat lib with cmake ... -D VTK_USE_SYSTEM_EXPAT:BOOL=ON -D EXPAT_INCLUDE_DIR:STRING=... -D EXPAT_LIBRARY:STRING=...