Skip to content
Nathan Moinvaziri edited this page Mar 10, 2021 · 31 revisions

Welcome to the zlib-ng wiki!

Dual-Linking

In order to link both zlib and zlib-ng in the same executable:

  • Define ZLIB_CONST in zlib
  • Compile without ZLIB_COMPAT in zlib-ng

Deflate Algorithm Comparison

Level Zlib-ng Algorithm Zlib Algorithm
0 Store Store
1 Intel deflate quick Zlib deflate fast
2-3 Zlib deflate fast Zlib deflate fast
4-6 Intel deflate medium Zlib deflate slow
7-9 Zlib deflate slow Zlib deflate slow

Compile options

Building on Apple Silicon

Export following environment variables before building on Apple silicon based Macs

export ARCH_FLAGS="-arch arm64"
export SDK_NAME=macosx
export SDK_PATH=$(xcrun --show-sdk-path --sdk $SDK_NAME)
export CFLAGS="$ARCH_FLAGS -isysroot $SDK_PATH -I$SDK_PATH/usr/include"
export CXXFLAGS=$CFLAGS
export LDFLAGS="$ARCH_FLAGS"
export CC="$(xcrun -sdk $SDK_PATH --find clang) $CFLAGS"
export CXX="$(xcrun -sdk $SDK_PATH --find clang++) $CXXFLAGS"
export LD="$(xcrun -sdk $SDK_PATH --find ld) $LDFLAGS"

$ ./configure
$ make
$ make test
$ make install

Recommended Build Minimums

Below is a list of recommended build environment minimums necessary to build zlib-ng. It is possible to build zlib-ng outside of these minimums, however support for doing so is limited.

Build system versions:

  • CMake 3.5.1
  • Configure script (bash/gmake)
  • NMake

Compiler versions:

  • Clang 6.0
  • GCC 5.5
  • MSVC 12.0

Compiler must support the C99 standard.

Platform versions:

  • Android 18
  • macOS 10.9
  • Ubuntu 12.04
  • Windows 7

Additional Resources

Clone this wiki locally