1 1.1 christos # ZSTD Windows binary package 2 1.1 christos 3 1.1 christos ## The package contents 4 1.1 christos 5 1.1 christos - `zstd.exe` : Command Line Utility, supporting gzip-like arguments 6 1.1 christos - `dll\libzstd.dll` : The ZSTD dynamic library (DLL) 7 1.1 christos - `dll\libzstd.lib` : The import library of the ZSTD dynamic library (DLL) for Visual C++ 8 1.1 christos - `example\` : The example of usage of the ZSTD library 9 1.1 christos - `include\` : Header files required by the ZSTD library 10 1.1 christos - `static\libzstd_static.lib` : The static ZSTD library (LIB) 11 1.1 christos 12 1.1 christos ## Usage of Command Line Interface 13 1.1 christos 14 1.1 christos Command Line Interface (CLI) supports gzip-like arguments. 15 1.1 christos By default CLI takes an input file and compresses it to an output file: 16 1.1 christos 17 1.1 christos Usage: zstd [arg] [input] [output] 18 1.1 christos 19 1.1 christos The full list of commands for CLI can be obtained with `-h` or `-H`. The ratio can 20 1.1 christos be improved with commands from `-3` to `-16` but higher levels also have slower 21 1.1 christos compression. CLI includes in-memory compression benchmark module with compression 22 1.1 christos levels starting from `-b` and ending with `-e` with iteration time of `-i` seconds. 23 1.1 christos CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined 24 1.1 christos into `-b1e18i1`. 25 1.1 christos 26 1.1 christos ## The example of usage of static and dynamic ZSTD libraries with gcc/MinGW 27 1.1 christos 28 1.1 christos Use `cd example` and `make` to build `fullbench-dll` and `fullbench-lib`. 29 1.1 christos `fullbench-dll` uses a dynamic ZSTD library from the `dll` directory. 30 1.1 christos `fullbench-lib` uses a static ZSTD library from the `lib` directory. 31 1.1 christos 32 1.1 christos ## Using ZSTD DLL with gcc/MinGW 33 1.1 christos 34 1.1 christos The header files from `include\` and the dynamic library `dll\libzstd.dll` 35 1.1 christos are required to compile a project using gcc/MinGW. 36 1.1 christos The dynamic library has to be added to linking options. 37 1.1 christos It means that if a project that uses ZSTD consists of a single `test-dll.c` 38 1.1 christos file it should be linked with `dll\libzstd.dll`. For example: 39 1.1 christos 40 1.1 christos gcc $(CFLAGS) -Iinclude\ test-dll.c -o test-dll dll\libzstd.dll 41 1.1 christos 42 1.1 christos The compiled executable will require ZSTD DLL which is available at `dll\libzstd.dll`. 43 1.1 christos 44 1.1 christos ## The example of usage of static and dynamic ZSTD libraries with Visual C++ 45 1.1 christos 46 1.1 christos Open `example\fullbench-dll.sln` to compile `fullbench-dll` that uses a 47 1.1 christos dynamic ZSTD library from the `dll` directory. The solution works with Visual C++ 48 1.1 christos 2010 or newer. When one will open the solution with Visual C++ newer than 2010 49 1.1 christos then the solution will be upgraded to the current version. 50 1.1 christos 51 1.1 christos ## Using ZSTD DLL with Visual C++ 52 1.1 christos 53 1.1 christos The header files from `include\` and the import library `dll\libzstd.lib` 54 1.1 christos are required to compile a project using Visual C++. 55 1.1 christos 56 1.1 christos 1. The path to header files should be added to `Additional Include Directories` that can 57 1.1 christos be found in project properties `C/C++` then `General`. 58 1.1 christos 2. The import library has to be added to `Additional Dependencies` that can 59 1.1 christos be found in project properties `Linker` then `Input`. 60 1.1 christos If one will provide only the name `libzstd.lib` without a full path to the library 61 1.1 christos the directory has to be added to `Linker\General\Additional Library Directories`. 62 1.1 christos 63 1.1 christos The compiled executable will require ZSTD DLL which is available at `dll\libzstd.dll`. 64