CFFI wrapper around LZMA (de)compressor foreign library

Upstream URL


Michał "phoe" Herda <>


Public domain


This is a CFFI wrapper around a LZMA foreign library, compiled straight out of the official LZMA SDK C binary.

There is no portable Lisp LZMA (de)compressor because:

  • the algorithm is complicated
  • the LZMA SDK is very obfuscated code
  • there is hardly any documentation for LZMA algorithm
  • there is no known workforce that can rewrite this in Lisp.


  • write a proper README, since the code seems to be working on my machine


Right now, Windows, Linux and macOS x32/x64 binaries are provided. (32bit macOS binaries were not tested yet - if they work for you, please let me know.)

To compile your own:

  1. Install the official LZMA SDK from Igor Pavlov.
  2. Modify /C/Util/Lzma/makefile.gcc, add -fPIC to CFLAGS.
  3. Remove makefile and move makefile.gcc to makefile.
  4. Issue make, which will build all object files.
  5. Build the shared library file. On Linux, this is $ gcc -shared -O2 -Wall -D_7ZIP_ST -fPIC -o *.o - on other platforms, I bet you can figure it out.
  6. Put the file anywhere you want and load it with CFFI.

Credits and inspirations

This is based on - a CFFI wrapper that I quickly hacked up.

This is based on which is a C interface to the LZMA SDK.

Dependencies (4)

  • cffi
  • cl-autowrap
  • fast-io
  • static-vectors

Dependents (0)

    • GitHub
    • Quicklisp