Skip to content

Optional RAW-ZLIB compression#53

Merged
szaghi merged 1 commit intoszaghi:masterfrom
flabowski:raw-zlib
Mar 13, 2026
Merged

Optional RAW-ZLIB compression#53
szaghi merged 1 commit intoszaghi:masterfrom
flabowski:raw-zlib

Conversation

@flabowski
Copy link
Copy Markdown
Contributor

Hi! I added support for VTK’s built-in XML zlib compression for appended VTU output via format='raw-zlib' (optional CMake flag VTKFORTRAN_USE_ZLIB). zlib compression reduces file size quite a bit for our cases (compared to base64 or uncompressed raw), ParaView or Pyvista can read these files directly. I used Cursor, but the changes are straightforward and work fine for me.

- Optional zlib support for VTK XML appended (.vtu) using vtkZLibDataCompressor format\n- Emit compressor/header_type attributes for RAW-ZLIB\n- Add minimal Fortran zlib bindings + zlib test writer\n- Default-disable package export when used as subproject (avoids export-set issues with in-tree zlib targets)
@szaghi
Copy link
Copy Markdown
Owner

szaghi commented Mar 13, 2026

@flabowski Thank you very much!

@szaghi szaghi merged commit 7656c3c into szaghi:master Mar 13, 2026
1 check failed
@szaghi
Copy link
Copy Markdown
Owner

szaghi commented Mar 13, 2026

@flabowski Do you think that your zlib approach can also be used for the others XML formats aside VTU? I have not yet read your implementation, but if you think it is possible, I will study it carefully, and I will apply sistematically to all outputs.

@flabowski
Copy link
Copy Markdown
Contributor Author

Yes, zlib compression isn not VTU specific in principle. It should work for any XML output that uses appended/raw data. I’ve only tested it with VTU though.
The CI failure looks like the runner isn’t linking against zlib ('compress2' and 'compressBound' are undefined). I did not add madler/zlib as a submodule because I did not want to force the dependency on everyone. Could zlib be installed on the CI runner (e.g. Ubuntu zlib1g-dev) so find_package(ZLIB) works?

@szaghi
Copy link
Copy Markdown
Owner

szaghi commented Mar 13, 2026

Yes, zlib compression isn not VTU specific in principle. It should work for any XML output that uses appended/raw data. I’ve only tested it with VTU though. The CI failure looks like the runner isn’t linking against zlib ('compress2' and 'compressBound' are undefined). I did not add madler/zlib as a submodule because I did not want to force the dependency on everyone. Could zlib be installed on the CI runner (e.g. Ubuntu zlib1g-dev) so find_package(ZLIB) works?

Very soon, I will address all issues (CI, ship a zlib compiled for CI, add a compressor to all outputs). I already use zlib for other projects involving HDF5; it is just a matter of grabbing the CI things from those projects.

Thank you again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants