Skip to content

Releases: fangq/zmat

ZMat v1.0.0 (Foxy the Fantastic Mr. Fox)

16 Apr 03:06

Choose a tag to compare

ZMat

ZMat 1.0.0 — "Foxy the Fantastic Mr. Fox"

Release date: 2026-04-15


Download

  • Please download zmat by filling out a brief registration form
  • The pre-compiled Octave mex file can only be used with Octave 10+ on Windows and MacOS (on Linux, the Octave mex file supports all Octave versions). The MATLAB mex files can run across a wide range of MATLAB versions.

Highlights

ZMat reaches its first stable release after seven years of development. This release adds a
Python binding, updates all bundled compression libraries to their latest versions, and fixes
long-standing memory and safety issues in the core C library.

New Features

  • Python bindingpip install zmat provides compress, decompress, encode,
    decode, and a low-level zmat interface; supports all compression methods
    (zlib, gzip, lzma, lzip, lz4, lz4hc, zstd, blosc2 variants, base64)
  • NumPy array round-tripcompress(arr, info=True) returns an info dict;
    decompress(data, info=info) restores the original dtype, shape, and memory order
    (mirrors the MATLAB [ss,info]=zmat(arr) / zmat(ss,info) pattern)
  • Octave 10+ compatibility — special matrix types (diagonal, permutation, etc.)
    are now handled correctly
  • Apple Silicon support — the blosc2 backend now automatically detects SSE2
    availability on Apple Silicon (M-series) Macs
  • New Linux MEX binaries — pre-compiled MEX files for Linux are now included
    in the private folder alongside the existing macOS and Windows binaries
  • macOS.mex extension is now recognized so packages built against newer
    Octave run on older releases as well
  • Project webpagehttps://neurojson.org/zmat

Library Updates

Library Old version New version
blosc2 2.8.0 2.23.1
zstd 1.5.5 1.5.7
miniz 3.1.1
lz4 1.9.4 1.10.0

Bug Fixes

Build & CI

  • Static linking hardened for macOS (gcc-12) and Linux
  • CI runners updated; added Ubuntu 24.04 and Apple Silicon (arm64) targets
  • Windows MEX and Python wheel builds fixed for MSYS2/MinGW toolchain

Acknowledgement

AI coding assistant Claude has been used in the development of this release.


Quick Start

MATLAB / Octave

% Compress and decompress a numeric array (restoring size and type)
orig = single(rand(5));
[compressed, info] = zmat(orig, 1, 'lzma');
restored = zmat(compressed, info);

% Base64 encode and decode a string
encoded = zmat('zmat toolbox', 1, 'base64');
decoded = char(zmat(encoded, 0, 'base64'));

Python

import numpy as np
import zmat

# Compress and decompress bytes
data = b"hello zmat"
compressed = zmat.compress(data, method='zlib')
restored   = zmat.decompress(compressed, method='zlib')

# NumPy array round-trip (preserves dtype, shape, memory order)
arr = np.random.rand(4, 5).astype(np.float32)
compressed, info = zmat.compress(arr, method='lz4', info=True)
restored = zmat.decompress(compressed, info=info)

# Base64 encoding
encoded = zmat.encode(b"zmat toolbox", method='base64')
decoded = zmat.decode(encoded, method='base64')

C

#include "zmatlib.h"
#include <string.h>
#include <stdlib.h>

int main(void) {
    const char *input = "hello zmat";
    unsigned char *compressed = NULL, *decompressed = NULL;
    size_t complen = 0, decomplen = 0;
    int status = 0;
    union TZMatFlags flags = {1};   /* 1 = compress */

    /* compress */
    zmat_run(strlen(input), (unsigned char *)input,
             &complen, &compressed, zmZlib, &status, flags.iscompress);

    /* decompress */
    flags.iscompress = 0;
    zmat_run(complen, compressed,
             &decomplen, &decompressed, zmZlib, &status, flags.iscompress);

    free(compressed);
    free(decompressed);
    return 0;
}

Link with: -lzmat -lz -lpthread


Full Changelog

2026-04-15 [1954707] [mex] add Linux mex binaries
2026-04-15 [1558336] [doc] bump version to 1.0, add webpage
2026-04-12 [4310bb1] [macos] allow .mex for octave run older octave
2026-04-11 [5e079a0] [deploy] macos build still hardcode liboctmex full path
2026-04-11 [42518ff] [deploy] remove absolute path to liboctmex.1 on mac
2026-04-11 [41812bb] [ci] statically link gcc on macos, python build show dylib
2026-04-11 [03e0efc] [test] print benchmark output
2026-04-10 [c1eb247] [deploy] build zmat with static gcc
2026-04-10 [9fa6f02] [ci] fix windows python build
2026-04-10 [343e4fb] [bug] add missing header file
2026-04-10 [b993b31] [blosc2] update blosc2 to 2.23.1, zstd to 1.5.7
2026-04-10 [92fa19c] [miniz] update miniz to v3.1.1
2026-04-10 [99d1ddb] [lz4] update lz4 to 1.10.0
2026-04-10 [2c40056] [mex] update linux mex files
2026-03-07 [aea6ad4] [ci] bump python version to 0.9.10 to use latest package
2026-03-07 [6ad3773] [ci] add the missing README, update setup.py to use manylinux
2026-03-07 [4f85fba] [doc] add README for python module
2026-03-07 [f05e962] [feat] support special matrices in octave 10+
2026-03-07 [b440935] [bug] fix various python module building issues
2026-03-07 [9dde248] [feat] add python binding
2026-03-07 [a3e9ddb] [ci] fix MW_MINGW64_LOC again
2026-03-06 [baeccf5] [blosc] automatically detect sse2 on apple silicon
2026-03-05 [a986c56] fix safety, memory, and efficiency issues throughout zmatlib.c
2025-09-21 [1b2cb0f] [ci] update all retired runners
2025-01-18 [6f92b49] [feat] allow to build with miniz without lzma
2024-09-14 [c6a6ce1] [ci] disable upx on macos
2024-08-18 [26b1147] [example] revert sample code back to zlib from lzma test
2024-08-18 [7c3b09b] [deploy] update all build-in mex files after fixing NeuroJSON#11
2024-08-18 [ca52abd] [ci] fix github macos-12 runner gcc version
2024-08-18 [66c8e88] [bug] fix memory leakage lloyd/easylzma#4 and lloyd/easylzma#7, close NeuroJSON#11
2024-07-18 [d756c37] [ci] debug ubuntu 24.04 octave-dev installation
2024-07-18 [6149af3] [ci] add ubuntu 24.04
2024-06-14 [980b445] [mac] add arm64 apple silicon precompiled mex files
2024-03-30 [b810d29] [package] remove cmake cache file found by debian packaging

ZMat 1.0 RC1 (Foxy the Fantastic Mr. Fox - RC1)

24 Oct 15:51

Choose a tag to compare

  • Copyright (C) 2019-2023 Qianqian Fang <q.fang at neu.edu>
  • License: GNU General Public License version 3 (GPL v3), see License*.txt
  • Version: 0.9.9 (Foxy the Fantastic Mr. Fox - RC1)
  • URL: https://github.com/NeuroJSON/zmat
  • Acknowledgement: This project is part of the NeuroJSON project
    supported by US National Institute of Health (NIH)
    grant U24-NS124027

Download

  • Please download zmat by filling out a brief registration form from https://neurojson.org/registration
  • The pre-compiled Octave mex file can only be used with Octave 8.x on Windows and MacOS (on Linux, the Octave mex file supports all Octave versions). The MATLAB mex files can run across a wide range of MATLAB versions.

Whats New

Starting in v0.9.9, we added support to a high-performance meta-compressor,
called blosc2 (https://blosc.org). The blosc2 compressor is not single
compression method, but a container format that supports a diverse set of
strategies to losslessly compress data, especially optimized for storing and
retrieving N-D numerical data of uniform binary types. Users can choose
between blosc2blosclz, blosc2lz4, blosc2lz4hc, blosc2zlib and
blosc2zstd, to access these blosc2 codecs.

The key updates of thi release include

  • support blosc2 (https://blosc.org) meta-compressor (blosc2blosclz, blosc2lz4, blosc2lz4hc, blosc2zlib and
    blosc2zstd)
  • support ZStandard (zstd) compression
  • use miniz instead of zlib to make the package self-contained to ease deployment
  • Octave mex files are organized in folders and support multiple OSes in one package
  • Octave/MATLAB mex files are both forward and backward compatible (universal)
  • add unit-testing scripts
  • extensive development on github action based CI/CD, with automated testing and packaging
  • migrate upstream git repository to https://github.com/NeuroJSON/zmat
  • many bug fixes

ChangeLog

ZMAT 0.9.9 (Foxy the Fantastic Mr. Fox - RC1), FangQ <q.fang (a) neu.edu>

2023-10-22 [c79f969] use valgrind to test memory error on Linux,run example scripts
2023-10-22 [48ba900] fix memory error using valgrind, run full tests on all OS
2023-10-13 [d5b2c40] revert blosc2 to v2.8.0 to remove new dependency libdl
2023-10-13 [f2eadb5] fix broken test
2023-10-13 [e6bbda1] update cmake file, update README
2023-10-13 [bc760d5] Merge branch 'master' of github.com:NeuroJSON/zmat
2023-10-13 [7472d29] update blosc2 to v2.10.5, update zstd to 1.5.5
2023-10-13 [437f300] rename zstd folder without version number
2023-10-13*[f4408f6] use miniz by default, rename zstd folder name
2023-10-13 [fcaa396] update lz4 to 1.9.4
2023-10-13 [57115dd] Update README.rst
2023-09-14 [e50dc6b] build octave mex with octave 8.3 on windows
2023-09-14 [edbeae9] update compilezmat.m without blosc2 and zstd support
2023-06-27 [906d422] run a simpler version of octave test on windows
2023-06-25 [d628473] run demo
2023-06-25 [8c97c17] run full test on windows
2023-06-25 [a28f9c7] use simple test on windows
2023-06-25 [f443ef7] skip error testing on windows and mac
2023-06-25 [2d6732c] add matlab mex build on ubuntu 16.04
2023-06-24 [68eede3] add new octave mex for windows and mac
2023-06-24 [7416b2c] double quote windows libloc
2023-06-24 [d9f239c] static link zlib again
2023-06-24 [cf8b9d4] fix windows matlab path
2023-06-24 [05be0d6] add additional path for libmx
2023-06-23 [30beb86] test ubuntu 20.04 build error
2023-06-23 [3383f74] fix windows mx/mex not found issue
2023-06-23 [910be8b] fix quotation mark issue
2023-06-23 [fb1a63d] upload all zip files
2023-06-22 [6f6b493] upload only the allinone package
2023-06-21 [2751923] strip mex file to reduce size
2023-06-21 [1461b9b] remove -lz from static linking on linux
2023-06-21 [df92d96] add LDFLAGS to mkoctfile
2023-06-10 [e3303c5] base64 no longer add new line by default, use level=3 to restore
2023-06-06*[ff150ae] support miniz-based gzip compression and decompression, update test
2023-06-06 [e098fd2] use miniz for gzip decompression
2023-06-03 [0acc9e3] allow using HAVE_ZLIB/HAVE_LZ4/HAVE_ZSTD=yes/no with make
2023-04-11*[2caae69] add github action based CI
2022-10-24*[c655c56] add miniz
2022-09-20*[e557c65] let zmatlib C function handle base64 encoding newline instead of zmat.m
2022-09-20 [afe5654] make flag compatible with zmat v0.9.8 convention
2022-09-20*[6f1e437] add speed benchmark
2022-09-18 [84892ca] update fortran90 example
2022-09-18 [edb768b] update octave mex using octave 5
2022-09-18 [e5107bb] fix zstd default clevel, force make rebuild, update octave mex
2022-09-18 [2be1661] add zstd tests, fix blosc condition, fix zstd error code
2022-09-18 [2526367] fix mac ci error
2022-09-17*[877f2d7] add zstd compression support, fix NeuroJSON#5
2022-09-15 [ad4605d] statically link libblosc2 and libzstd to libzmat.a
2022-09-15 [b1b0ad7] add c example in CI, add blosc2 tests
2022-09-15 [a5c072d] adjust makefile for building so file
2022-09-14 [98ab1df] force CC as dll linker
2022-09-13 [b8bdc8d] change xcode version
2022-09-13 [d863adf] remove warning
2022-09-13 [ef9ace9] debug travis on windows and osx
2022-09-13 [269a972] use system MAKE variable
2022-09-13 [7431bfc] debug travis error
2022-09-13 [78b1fa9] fix typesize, fix composit flags, make pretty
2022-09-12 [552a007] add the missing blosc2 makefile
2022-09-12 [944fb12] support blosc2 compressors
2022-09-11 [3f9542e] update zstd makefile
2022-09-11 [f07c09a] revert c-blosc2 to stable release v2.3.1
2022-09-10 [65ae09f] add blosc2 code tree
2022-08-22 [a471522] revert ci setting
2022-08-22 [9d4293e] switch CI to NeuroJSON
2022-08-22 [290a46c] switch upstream git repo owner to NeuroJSON org
2022-08-22 [59d092d] run test on matlab R2010
2022-08-22 [63b3f3d] manually patch easylzma PR lloyd/easylzma#7 to prevent memory leak
2022-08-22 [16cb296] matlab/octave are different in exp(1) and mexErrMsgTxt format
2022-08-21*[3bc5d6f] allow zmat to return error status without throwing an error
2022-08-20 [138be0b] test return status, clear memory in c example
2022-08-20 [b914a67] zlib memory tweaks
2022-08-20 [ccf0546] reformat c example
2022-08-20*[eab19fb] add unit tests, zlib memory optimization
2022-08-18 [5fe4360] test older octave (3.8)
2022-08-18 [e542838] test built in portable octave mex file
2022-08-18 [2cdc1b4] revert demo script to print outputs
2022-08-18 [675c922] add ubuntu 22.04 in CI
2022-08-18*[11b858b] allow oct file built with 5.x or newer to run in 4.x and 3.x
2022-08-16 [8291ebe] fix a warning picked by fedora package building flags
2022-08-15 [af61014] remove CXX=mkoctfile to prevent infinite loop in octave 7, fix NeuroJSON#9
2022-06-07 [617618d] complete reformat using miss_hit
2022-05-21 [ef858a5] reformat C source code using astyle
2022-05-19 [b7cf723] add ubuntu 20.04 in ci
2022-05-19 [4b6a87e] update PKG_ADD to use locally compiled mex file first
2022-04-28*[08bd437] autoload octave mex file when addpath, thanks to cdf and mmuetzel
2021-11-20 [5f31756] port debian package patch to respect CFLAGS and LDFLAGS, fix NeuroJSON#7