Skip to content
/ tigz Public

Parallel gzip decompression and compression using libdeflate and rapidgzip.

License

Notifications You must be signed in to change notification settings

tmaklin/tigz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tigz

Parallel gzip compression and decompression with

Installation

Compile from source

Requirements

  • A compiler with C++17 support.
  • cmake >= v3.16.

Dependencies

tigz additionally downloads, or requires, the following dependencies when cmake is called

Compiling

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.

Extra compiler flags

  • Native CPU instructions: -DCMAKE_WITH_NATIVE_INSTRUCTIONS=1
  • Link-time optimization: -DCMAKE_WITH_FLTO=1

Using system libraries

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.

Usage

As an executable

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.

As a library

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.

License

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.

Dependencies