Zlib-ng

A high-performance data compression library, fork of zlib with optimizations

Overview

Zlib-ng is a general-purpose lossless data-compression library that focuses on performance. It is an actively maintained fork of Zlib with significant optimizations and enhancements. The key performance improvements come from modern SIMD (Single Instruction, Multiple Data) acceleration techniques, utilizing CPU features like SSE, AVX, AVX2, and NEON to process multiple data elements simultaneously.

Note

On Discoverer and Discoverer+ clusters, the compatibility installation of Zlib-ng serves as a drop-in replacement for Zlib in scenarios where fast compression and decompression are critical. The SIMD optimizations

are automatically enabled based on the available CPU features.

Available versions and types of installations

Two types of installations are available:

  • Standard Installation - Regular zlib-ng library
  • Compatibility Mode - Drop-in replacement for zlib

To view available zlib-ng versions:

$ module avail zlib-ng

For compatibility versions (zlib replacement):

$ module avail zlib-ng-compat

Usage

Loading the module

To load the standard version:

$ module load zlib-ng/<version>

If you omit the version, the latest one will be loaded.

For compatibility mode:

$ module load zlib-ng-compat/<version>

Again, if you omit the version, the latest one will be loaded.

Building software (linking)

When compiling programming code that relies on Zlib-ng specific API, load the zlib-ng module into the build environment and pass the following flags to the linker:

$ module load zlib-ng/<version>
$ <linker or compiler> <flags> <source or object files> -lz-ng

In case your code still relies on the regular zlib API, you need to load the compatibility module zlib-ng-compat into the build environment and pass the following flags to the linker:

$ module load zlib-ng-compat/<version>
$ <linker or compiler> <flags> <source or object files> -lz

How to replace zlib with zlib-ng for running software

Warning

The recipe given below applies only in case your application is dynamically linked to libz.so.

In that case the only thing you need to do is to load the zlib-ng-compat module in the environment where you run the linked executable. In that case the path to the Zlib-ng compatibility library will be used instead of the regular zlib library installation.

Build recipes

The build recipes and configuration details are maintained in our GitLab repository:

Getting Help

For additional assistance: