Parallel gzip compression and decompression with
- libdeflate by Eric Biggers for compression.
- rapidgzip by Maximilian Knespel for decompression.
- zlib-ng by zlib-ng as the rapidgzip backend.
- A compiler with C++17 support.
- cmake >= v3.16.
tigz additionally downloads, or requires, the following dependencies when cmake is called
Clone the repository, enter the directory, and run
mkdir build
cd build
cmake ..
make -j
This will create the tigz executable in the build/bin
directory.
Optinally, use make install
afterwards to install tigz. The
installation path can be modified by passing
-DCMAKE_INSTALL_PREFIX=/path/to/install/tigz/in
to cmake.
- Native CPU instructions:
-DCMAKE_WITH_NATIVE_INSTRUCTIONS=1
- Link-time optimization:
-DCMAKE_WITH_FLTO=1
System zlib
or libdeflate
libraries can be supplied by specifying the path to the library files and the header files with
cmake -DCMAKE_ZLIB_LIBRARY=/path/to/libz.so -DCMAKE_LIBDEFLATE_LIBRARY=/path/to/libdeflate.so \\
-DCMAKE_ZLIB_HEADERS=/path/to/zlib.h -DCMAKE_LIBDEFLATE_HEADERS=/path/to/libdeflate.h
Preinstalled rapidgzip, BS::thread_pool, or cxxopts headers may be supplied similarly via cmake. These are header-only libraries so the library path is not needed.
tigz has the same command-line interface as gzip, bzip2, xz, etc. do. tigz accepts the following flags
tigz [options] [files]
-1 ... -12 Compression level. (default: 6)
-z, --compress Compress file(s).
-d, --decompress Decompress file(s).
-k, --keep Keep input file(s) instead of deleting.
-f, --force Force overwrite output file(s).
-c, --stdout Write to standard out, keep files.
-T, --threads arg Use `arg` threads, 0 = all available. (default: 1)
-b, --block-size arg i/o buffer sizes per thread in KiB. (default: 128)
-h, --help Print this message and quit.
-V, --version Print the version and quit.
Note: the API is experimental until v1.x.y is released.
tigz can be used as a header-only library. Include the tigz_decompressor.hpp
or tigz_compressor.hpp
files in your project and create the appropriate class in your code.
You will need to supply the dependency headers and link your program with zlib and libdeflate for tigz to work. Cmake can be used to configure the project automatically as part of a larger build.
tigz is licensed under the BSD-3-Clause license. A copy of the license is supplied with the project, or can alternatively be obtained from https://opensource.org/licenses/BSD-3-Clause.
- libdeflate is licensed under the MIT license.
- rapidgzip is dual-licensed under the MIT license or the Apache 2.0 license.
- zlib-ng is licensed under the zlib license.
- BS::thread_pool is licensed under the MIT license.
- cxxopts is licensed under the MIT license.