Installation
Zstandard can be installed using various package managers or built from source. Choose the method that best suits your development environment.Quick install
Installation steps
Choose your installation method
Select the package manager or build system that matches your platform and workflow. For most Unix-like systems, the Makefile method is recommended.
Install dependencies
Ensure you have the necessary build tools:
- Linux/macOS:
gccorclang,make - Windows: Visual Studio 2010 or later, or use CMake with your preferred compiler
- All platforms:
gitfor cloning the repository
Build and install
Follow the commands for your chosen method above. The build process will create:
zstdcommand-line tool (in root directory)libzstdlibrary (inlib/directory)- Man pages and documentation
Build from source (detailed)
Using Makefile
The Makefile is the main build system and follows GNU Standard Makefile conventions:The Makefile supports standard compilation flags, directory variables, and command variables following GNU conventions.
Using CMake
The CMake project generator can create Makefiles or other build scripts:Using Meson
A Meson project is provided withinbuild/meson:
Platform-specific notes
macOS Universal2 build
You can build Zstandard with support for both Apple Silicon (M1/M2) and Intel processors:Windows with Visual Studio
Go into thebuild directory to find:
- Projects for Visual Studio 2008 and 2010 (VS2010 project is compatible with VS2012-VS2017)
- Automated build scripts in
build/VS_scriptsthat build without opening Visual Studio - Recommended: Generate Visual Studio solutions using CMake
Using Buck
You can build the zstd binary via Buck:buck-out/gen/programs/.
Using Bazel
Integrate zstd into your Bazel project using the module hosted on the Bazel Central Repository.Advanced build options
For specialized flags controlling binary generation and installation paths:- Library options: See
lib/README.mdfor modular build options - CLI options: See
programs/README.mdfor compilation variables
Package manager maintenance
The Zstandard packages in VCPKG and Conan are maintained by Microsoft team members and community contributors. If you find an outdated version:- VCPKG: Create an issue or pull request on the vcpkg repository
- Conan: Create an issue or pull request on the ConanCenterIndex repository
Next steps
Quick start guide
Now that you have Zstandard installed, learn how to compress and decompress data with working code examples