# This VTU file can be loaded into Linux, but not Windows

**URL:** https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380
**Category:** ParaView Support
**Tags:** vtk
**Created:** [June 23, 2023, 3:10pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380 "2023-06-23T15:10:04Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 23, 2023, 3:10pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/1 "2023-06-23T15:10:04Z")

</div>

The VTU file was generated from a in-house CFD solver based on the High Lift Workshop benchmark case. It contains 26M grid points and ~65M cells. The files are placed at Google drive: [volumes\_hlcrm\_medium.tar - Google Drive](https://drive.google.com/file/d/1twlC3oTCcRNr0IcBXKjPWfB0IBlrYDjb/view?usp=sharing)

This VTU file can not be loaded into Paraview (Windows version) due to the error message:

> ERROR: In vtkXMLDataParser.cxx, line 651  
> vtkXMLDataParser (000002913777F810): Error reading uncompressed binary data header. Read 0 of 8 bytes.  
> ERROR: In vtkXMLUnstructuredDataReader.cxx, line 738  
> vtkXMLUnstructuredGridReader (0000029150A5EC70): Cannot read cell offsets from Cells in piece 0 because the “offsets” array is not long enough.

I tried 5.11.1, 5.10.1 and 5.9.1 versions of Paraview, the error messages are the same. The strange thing is the above file could be loaded into Linux’s version of Paraview successfully.

Could anyone take a look at this issue? Thank you!

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 24, 2023, 3:12am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/2 "2023-06-24T03:12:14Z")

</div>

Does this help?

> **[Problem opening vtu-file in Paraview -- CFD Online Discussion Forums](https://www.cfd-online.com/Forums/su2/227916-problem-opening-vtu-file-paraview.html)**
>
> Hello! So I have been struggling for a while now trying to open my vtu files in Paraview. The error I get is this: ERROR: In C:\\bbd\\ecd3383f\\build\\supe

This problem seems to keep resurfacing in different guises on Windows.

> I have a program in c++ that generates the xml file based on other input data. It has been working for years for many different inputs. This is the first time the xml file exceeds 2GB.  
> [https://gitlab.kitware.com/paraview/paraview/-/issues/19628](https://gitlab.kitware.com/paraview/paraview/-/issues/19628)

> [@problem reading large VTU file](https://discourse.paraview.org/t/problem-reading-large-vtu-file/6887):
>
> Hi, I am having issues reading a large vtu file. I have tried various versions of Paraview on Windows and Ubuntu, but the problem is persistent. The VTU file consist of 404000 unstructured data points and when I try to load it, paraview says: ERROR: In /build/paraview-vlxewD/paraview-5.7.0/VTK/IO/XML/vtkXMLUnstructuredDataReader.cxx, line 601 vtkXMLUnstructuredGridReader (0x560f46d55990): Cannot read cell offsets from Cells in piece 0 because the “offsets” array is not long enough. I was wo…

It has not been fixed because it needs to be resolved in CMake and the documentation on how to use _vtk\_module\_definitions()_ is practically useless.  
[https://gitlab.kitware.com/paraview/paraview/-/issues/21145](https://gitlab.kitware.com/paraview/paraview/-/issues/21145)

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 24, 2023, 2:14pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/3 "2023-06-24T14:14:40Z")

</div>

Hi @todoooo , thanks for these useful links. In recent days, I found the same thing as your link: [https://gitlab.kitware.com/paraview/paraview/-/issues/21145](https://gitlab.kitware.com/paraview/paraview/-/issues/21145).  
I also track down at the XMLByteIndex, which is a abnormal negative number at Windows (~1.7 billion), but it is a normal number at Linux (2.5 Billion, which is bigger than max(Int32\_t), but I confirmed that vtkTypeId is 64-bit). Then I found the VTK library uses expat to parse the XML documentation. You mentioned

> Hard coding `add_definitions(-DXML_LARGE_SIZE)` in the _CMakeLists.txt_ file for the _IOXMLParser_ project resolves this

Could you tell me more about this? Also, do you know how to rebuild the entire Paraview release from source code at Windows OS? I found a repo called Paraview-superbuild, but not sure about whether it is the correct way: [https://gitlab.kitware.com/paraview/paraview-superbuild](https://gitlab.kitware.com/paraview/paraview-superbuild)

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 24, 2023, 2:30pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/4 "2023-06-24T14:30:37Z")

</div>

hi @cfd_ow

Basically what is happening is that the XML 3rd party library is being built with a stream size of type Long. On 64 bit Linux/Mac that maps to 8 bytes, but on Win64 it maps to 4 bytes, so once the stream position exceeds ~2Gb the index becomes negative. The way to fix this is to force the compiler to define XML\_LARGE\_SIZE when building the XML library for 64 bit. This should be configured in CMake but I couldn’t figure out how to implement it.

If you find the IOXMLParser folder in the Paraview source and add the XML\_LARGE\_SIZE definition to its CMakeLists file you have a hacky work-around solution.

You can build Paraview from the Gitlab master branch (or a release branch) on Windows by configuring CMake for Visual Studio or Ninja. I use Visual Studio. I have never tried the super-build but it is probably similar.

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 24, 2023, 2:39pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/5 "2023-06-24T14:39:47Z")

</div>

@todoooo Thanks! Yup, the “long” at Windows is 32-bit. I’ve found the XML\_LARGE\_SIZE in the VTK/ThirdParty/expat/vtkexpat/CMakeLists.txt library. Currently it is OFF. I will make it ON to have a quick test.

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 24, 2023, 3:03pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/6 "2023-06-24T15:03:03Z")

</div>

@todoooo Do you know what the compilation options used by the official released Paraview at [https://www.paraview.org/download/](https://www.paraview.org/download/)? I want to build a version using the same options as the official version with only the change of the above XML\_LARGE\_SIZE. Thanks.

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 25, 2023, 12:13am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/7 "2023-06-25T00:13:33Z")

</div>

@todoooo I’ve tried to turn on the EXPAT\_LARGE\_SIZE at the expat’s library, but the built VTK library still fails to read my big VTU file with throwing out the same error message.

In the VTK/ThirdParty/expat/vtkexpat/CMakeLists.txt, I made the change to turn on the EXPAT\_LARGE\_SIZE:

> option(EXPAT\_LARGE\_SIZE “Make XML\_GetCurrent\* functions return \<(unsigned) long  
> long\> rather than \<(unsigned) long\>” ON)

I also confirmed that the “-DXML\_LARGE\_SIZE” was added into definitions, since I added a log into the above CMakeLists.txt file. Since this issue occurs in the level of VTK library, I didn’t compile the entire Paraview application. I just compiled the VTK library and let it to read my VTU file using one of its unit tests (its path is VTK\IO\XML\Testing\Cxx\TestXMLUnstructuredGridReader.cxx), but it still gives me the same error like before.

I guess I have to dive into the source code of the XML parser to figure it out…

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 25, 2023, 1:14am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/8 "2023-06-25T01:14:41Z")

</div>

> [@cfd\_ow](#):
>
> In the VTK/ThirdParty/expat/vtkexpat/CMakeLists.txt, I made the change to turn on the EXPAT\_LARGE\_SIZE:

I didn’t do that. As I recall I just added  
add\_definitions(-DXML\_LARGE\_SIZE)  
to` $ParaviewSrc\VTK\IO\XMLParser\CMakeLists.txt`

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 25, 2023, 2:10am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/9 "2023-06-25T02:10:10Z")

</div>

Got it. Thanks. I will try that. I will also try to add some log for the actual size of the XML\_Index used by the expat parser.

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 27, 2023, 12:10pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/10 "2023-06-27T12:10:07Z")

</div>

@todoooo I confirmed that your solution works by adding `add_definitions(-DXML_LARGE_SIZE)` into ParaviewSrc\VTK\IO\XMLParser\CMakeLists.txt. Previously, I only added the above definition into the vtkexpat part, which is not enough. With your solution, now I can read the big VTU file into Paraview smoothly. Thanks.

---

<div class="post-metadata">

### Author: ![aron.helser](https://discourse.paraview.org/user_avatar/discourse.paraview.org/aron.helser/32/13_2.png) [@aron.helser](https://discourse.paraview.org/u/aron.helser)
#### Post date: [June 27, 2023, 1:57pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/11 "2023-06-27T13:57:44Z")

</div>

Please look for an existing ParaView issue that describes this problem, or file a new one, and describe your solution. This should be pretty easy to get fixed. If you can provide a data file that causes the error on Windows, we can confirm it is fixed, too.

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 27, 2023, 11:39pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/12 "2023-06-27T23:39:34Z")

</div>

@aron.helser  
I already filed issue [https://gitlab.kitware.com/paraview/paraview/-/issues/21145](https://gitlab.kitware.com/paraview/paraview/-/issues/21145), mentioned above, more than one year ago.

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 27, 2023, 11:44pm UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/13 "2023-06-27T23:44:37Z")

</div>

@cfd_ow The change I suggested should be sufficient. AFAIK editing any of the VTK third party library cmake files has no effect on their building in Paraview.

I’m glad it helped. ☀

---

<div class="post-metadata">

### Author: ![cfd\_ow](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cfd_ow/32/9715_2.png) [@cfd\_ow](https://discourse.paraview.org/u/cfd_ow)
#### Post date: [June 28, 2023, 2:27am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/14 "2023-06-28T02:27:13Z")

</div>

@todoooo Thank you very much. I created a new issue in the Paraview’s gitlab repo: [https://gitlab.kitware.com/paraview/paraview/-/issues/22201](https://gitlab.kitware.com/paraview/paraview/-/issues/22201). I also mentioned the solution is originally from you.  
@aron.helser Good idea, since some old issues did not provide enough information, this problem has persisted for a long time. I’ve created a new issue: [https://gitlab.kitware.com/paraview/paraview/-/issues/22201](https://gitlab.kitware.com/paraview/paraview/-/issues/22201)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 28, 2023, 7:03am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/15 "2023-06-28T07:03:50Z")

</div>

> [@todoooo](#):
>
> how to use _vtk\_module\_definitions()_ is practically useless.

Please improve it if you can @todoooo

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 28, 2023, 7:07am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/16 "2023-06-28T07:07:08Z")

</div>

@cfd_ow : Thanks for opening the issues and identifying a working fix. Lets hope someone will actually tackle this and fix it. Do not hesitate to do this yourself if you feel like it.

---

<div class="post-metadata">

### Author: ![todoooo](https://discourse.paraview.org/user_avatar/discourse.paraview.org/todoooo/32/2819_2.png) [@todoooo](https://discourse.paraview.org/u/todoooo)
#### Post date: [June 28, 2023, 7:07am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/17 "2023-06-28T07:07:23Z")

</div>

I would do that if I knew how it was supposed to work, but it was the lack of comprehension that prevented me from creating an MR fix in the first place.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 28, 2023, 7:07am UTC](https://discourse.paraview.org/t/this-vtu-file-can-be-loaded-into-linux-but-not-windows/12380/18 "2023-06-28T07:07:55Z")

</div>

Got it. I answered to you on the initial issue with the related CMake doc. let me know if you need more.
