How To Install OpenZL on Linux Mint 22

If you have ever hit the ceiling of what gzip, zstd, or xz can do with your structured datasets, you already know the frustration: generic compressors treat every file the same, and your data is not generic. OpenZL is a format-aware, lossless compression framework released by Meta in October 2025 that solves this problem by building a specialized compressor tailored to your exact data format. This guide walks you through every step to install OpenZL on Linux Mint 22, from installing build dependencies all the way to running your first real compression test. Whether you are a developer, sysadmin, or data engineer, this Linux server tutorial will get you up and running fast.
What Is OpenZL and Why Does It Matter?
OpenZL is an open-source compression framework originally developed and deployed at production scale inside Meta’s infrastructure before being released to the public under the BSD 3-Clause license. It works by taking a description of your data’s structure, called a profile, and using it to build a directed acyclic graph (DAG) of composable codecs that are specifically optimized for that format.
The result is compression performance that generic tools simply cannot match. In official benchmarks using the Silesia corpus, OpenZL achieved a 2.06x compression ratio at 340 MB/s compression speed and 1,200 MB/s decompression speed. Compare that to zstd -3 at 1.31x or xz -9 at 1.64x, and the advantage becomes obvious, especially for AI model weights, genomic arrays, or any large numeric dataset your pipeline processes repeatedly.
Unlike zstd or xz, OpenZL also supports a trainer that analyzes a sample of your data and generates a custom compressor. In tests on the sample dataset sra0, training pushed the ratio from 1.50x all the way to 3.47x, a 130% improvement over the preset profile.
Prerequisites
Before you run a single command, verify that your system meets these requirements. Linux Mint 22 is based on Ubuntu 24.04 LTS, so its default toolchain already satisfies every dependency.
System requirements:
- Linux Mint 22 (Cinnamon, MATE, or Xfce edition)
- Active internet connection
- A user account with
sudoprivileges - GCC 9+ or Clang 13+ (Mint 22 ships GCC 13 by default)
- CMake 3.20.2 or newer (Mint 22 ships CMake 3.28)
gitfor cloning the repositorymakeorcmakebuild systempython3andpip(only required for Python bindings)
Required tools at a glance:
| Tool | Minimum Version | Purpose |
|---|---|---|
| GCC or Clang | GCC 9+ / Clang 13+ | C11 and C++17 compilation |
| CMake | 3.20.2+ | Full build and test system |
| git | Any recent version | Clone the repository |
| make | Any recent version | Quick build path |
| python3 + pip | Python 3.8+ | Optional Python bindings |
Step 1: Update Your System
Always update your package index and upgrade installed packages before adding new build dependencies. This prevents version conflicts and ensures you pull the latest stable packages from the repository.
sudo apt update && sudo apt upgrade -y
Wait for the upgrade to complete. On a fresh Mint 22 install this takes only a minute or two.
Step 2: Install Build Dependencies
Install all required tools in a single command. This covers everything from the compiler and build system to Python support.
sudo apt install -y git build-essential cmake g++ clang python3 python3-pip unzip wget
What each group installs:
git: clones the OpenZL repository from GitHubbuild-essential: providesgcc,g++, andmakecmake: the full-featured build system for the complete install pathclang: an alternative C/C++17 compiler if you prefer it over GCCpython3andpython3-pip: required only for the Python bindingsunzipandwget: used to download and extract the sample dataset
Confirm your GCC version to make sure it meets the C++17 requirement:
gcc --version
Expected output on Linux Mint 22:
gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0
GCC 13 fully supports C11 and C++17, so you are good to go.
Step 3: Clone the OpenZL Repository
Clone only the release branch. The dev branch carries no stability guarantees and is not suitable for production or even standard testing.
git clone --depth 1 -b release https://github.com/facebook/openzl.git
cd openzl
Flag breakdown:
--depth 1: fetches only the latest commit instead of the full history, which saves time and bandwidth-b release: targets the stable release branch specifically
The repository is roughly 10 MB to clone.
Step 4: Build OpenZL
You have two methods to choose from. Use Method A for a quick start and a working CLI binary. Use Method B for a full installation with tests, benchmarks, and system-wide access.
Method A: Build with Make (Quickest Path)
This builds only the zli CLI tool, which is all you need to start compressing data immediately.
make zli
The compiler output will scroll through the terminal. When it finishes, verify the binary works:
./zli --help
You should see a list of available subcommands including compress, decompress, train, and list-profiles.
If GCC is not your default compiler, set it explicitly:
CC=gcc CXX=g++ make zli
Method B: Build with CMake (Recommended for Full Installation)
This method compiles the full OpenZL library, the CLI, the test suite, and prepares everything for system-wide installation.
mkdir build-cmake
cd build-cmake
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DOPENZL_BUILD_TESTS=ON \
-DCMAKE_INSTALL_PREFIX=install
make -j$(nproc)
Flag breakdown:
-DCMAKE_BUILD_TYPE=Release: compiles with full optimizations and disables debug overhead-DOPENZL_BUILD_TESTS=ON: downloads GoogleTest and Zstd from GitHub and builds the test suite-DCMAKE_INSTALL_PREFIX=install: installs binaries into a localinstall/subdirectory instead of/usr/local-j$(nproc): auto-detects your CPU core count and uses all of them to speed up compilation
Run the test suite to confirm everything built correctly:
ctest . -j 10
All tests should pass. Then install:
make install
Alternative CMake-Only Method
If you prefer the pure CMake workflow without any make involvement:
mkdir -p cmakebuild
cmake -S . -B cmakebuild
cmake --build cmakebuild --target zli
ln -sf cmakebuild/cli/zli .
The ln -sf command creates a symbolic link so you can invoke ./zli from the repository root without copying the binary.
Step 5: Verify the Installation
Run these commands to confirm OpenZL is correctly installed and functional.
Check that the CLI responds:
./zli --help
List all available built-in data profiles:
./zli list-profiles
You should see entries like le-u64, le-u32, and others. These are preset format descriptors that OpenZL uses as a starting point for format-aware compression.
If you installed system-wide, verify the binary is accessible from anywhere in your shell:
which zli
zli --version
Step 6: Install Python Bindings (Optional)
This step is for developers who want to use OpenZL inside Python scripts, data pipelines, or Jupyter notebooks.
Create a Virtual Environment
Always use a virtual environment to keep your system Python clean:
python3 -m venv openzl-virtualenv
source ./openzl-virtualenv/bin/activate
Install from PyPI
The simplest installation path pulls the latest stable release directly:
pip install openzl
Install from Source
To use the Python bindings that match your compiled library version exactly:
cd py
pip install .
cd ..
Verify the Binding Works
python3 -c "import openzl; print('OpenZL Python binding loaded successfully')"
Expected output:
OpenZL Python binding loaded successfully
Step 7: Test OpenZL with a Real Compression Example
This is where the setup pays off. Run a full compress, decompress, and verify cycle on a real dataset so you can see OpenZL’s performance with your own eyes.
Download the Sample Dataset
Download sra0, a column of 64-bit numeric values from the Silesia compression corpus, which Meta uses as an official benchmark file:
wget https://github.com/facebook/openzl/releases/download/openzl-sample-artifacts/sra0.zip
unzip sra0.zip && rm sra0.zip
If you prefer curl over wget:
curl -L -O https://github.com/facebook/openzl/releases/download/openzl-sample-artifacts/sra0.zip
unzip sra0.zip && rm sra0.zip
Compress with a Preset Profile
Use the le-u64 profile, which tells OpenZL the data is an array of little-endian 64-bit unsigned integers:
./zli compress --profile le-u64 sra0 --output sra0.zl
Expected output:
Compressed 2071976 -> 1378167 (1.50x) in 15.335 ms, 128.85 MiB/s
For reference, xz -9 on the same file achieves only 1.39x and takes many seconds. OpenZL beats it at 1.50x in under 16 milliseconds.
Decompress and Verify Integrity
Decompress the output file:
./zli decompress sra0.zl --output sra0.decompressed
Expected output:
Decompressed: 66.51% (1345.87 KiB -> 2023.41 KiB) in 2.619 ms, 754.60 MiB/s
Note that decompression requires no --profile flag. OpenZL compressed frames are always self-describing.
Verify byte-for-byte integrity against the original:
cmp sra0 sra0.decompressed
A silent exit with no output confirms the files are identical. Alternatively, use md5sum:
md5sum sra0 sra0.decompressed
Both hashes must match exactly.
Train a Custom Compressor for Better Ratios
The preset profile is generic. Training generates a compressor specialized for your specific data:
./zli train --profile le-u64 sra0 --output sra0.zlc
The trainer is multi-threaded and uses all available CPU cores. On machines with fewer cores, add the --max-time-secs flag to cap the training duration:
./zli train --profile le-u64 sra0 --output sra0.zlc --max-time-secs 60
Expected output at the end of training:
[==================================================] Training ACE graph 1/1
Benchmarking trained compressor...
1 files: 2071976 -> 597635 (3.47), 121.64 MB/s 1059.97 MB/s
Training improved compression ratio by 130.48%
Now compress with the trained profile:
./zli compress sra0 --compressor sra0.zlc --output sra0.zl
The result jumps from 1.50x to 3.47x, with no additional cost at decompression time.
Step 8: Configure OpenZL on Linux Mint 22 as a C++ Library
If you want to embed OpenZL into your own C++ project, use CMake’s FetchContent module. Add this to your CMakeLists.txt:
include(FetchContent)
FetchContent_Declare(
openzl
GIT_REPOSITORY https://github.com/facebook/openzl.git
GIT_TAG release
OVERRIDE_FIND_PACKAGE
)
find_package(openzl REQUIRED)
add_executable(main main.cpp)
target_link_libraries(main openzl openzl_cpp)
Link against both openzl (the C11 core library) and openzl_cpp (the C++17 wrapper). These are separate targets because the C core handles raw compression logic while the C++ layer adds type safety and higher-level abstractions for message streams.
Troubleshooting Common Errors
Even on a well-maintained Linux Mint 22 system, a few issues can surface. Here are the most common ones and how to fix them.
Error 1: CMake Version Too Old
Error message:
CMake 3.20.2 or newer is required
Fix: Linux Mint 22 ships CMake 3.28, so this error should not appear in a standard environment. If it does, upgrade CMake via pip:
pip install --upgrade cmake
Or add the Kitware APT repository for the latest CMake release.
Error 2: C++17 Compilation Failures
Error message: Build fails with errors about unknown C++ features or unsupported syntax.
Fix: Confirm your GCC version supports C++17 (requires GCC 9+):
gcc --version
If you are running an older compiler, install GCC 13 explicitly:
sudo apt install -y gcc-13 g++-13
export CC=gcc-13
export CXX=g++-13
Then re-run the build command.
Error 3: make command not found
Fix: The build-essential package was not installed correctly. Reinstall it:
sudo apt install --reinstall build-essential
Error 4: Python ModuleNotFoundError: No module named openzl
Fix: You are running Python outside the virtual environment. Activate it first:
source ./openzl-virtualenv/bin/activate
Then run your Python script again. If you installed from source, confirm you ran pip install . from inside the openzl/py/ directory.
Error 5: ./zli: No such file or directory After CMake Build
Fix: When using the CMake path, the binary lives in cmakebuild/cli/zli, not the repo root. Either create the symlink:
ln -sf cmakebuild/cli/zli .
Or call the binary with its full path:
./cmakebuild/cli/zli --help
Performance at a Glance
Here is how OpenZL stacks up against the most common generic compression tools on the sra0 benchmark dataset:
| Compressor | Compressed Size | Ratio | Compression Speed | Decompression Speed |
|---|---|---|---|---|
gzip -9 |
1,742,445 B | 1.19x | moderate | moderate |
zstd -19 |
1,696,778 B | 1.22x | slow | fast |
xz -9 |
1,488,144 B | 1.39x | very slow | slow |
| OpenZL (preset) | 1,378,167 B | 1.50x | 128 MiB/s | 754 MiB/s |
| OpenZL (trained) | 597,635 B | 3.47x | 121 MiB/s | 1,059 MiB/s |
The trained OpenZL compressor achieves more than double the compression ratio of xz -9 while being dramatically faster in both directions.
Congratulations! You have successfully installed OpenZL. Thanks for using this tutorial for installing the OpenZL open-source compression framework on your Linux Mint 22 system. For additional help or useful information, we recommend you check the official OpenZL website.