Prerequisites
Compiler Requirements
RocksDB requires a modern C++ compiler with C++20 support:- GCC: Version 11 or higher
- Clang: Version 10 or higher
Recommended Dependencies
While RocksDB can compile without any dependencies, installing compression libraries significantly improves performance:- zlib: General-purpose compression
- bzip2: High compression ratio
- lz4: Extremely fast compression
- snappy: Fast compression optimized for speed
- zstandard: Fast real-time compression algorithm
- gflags: Required for command-line tools
- clang-format: Required for code formatting checks
Ubuntu / Debian
1
Update compiler
Ensure you have GCC 11 or higher:
2
Install dependencies
Install compression libraries and tools:
3
Clone repository
4
Build RocksDB
5
Run tests (optional)
CentOS / RHEL / Fedora
1
Update compiler
Ensure you have GCC 11 or higher:
2
Install gflags from source
3
Install compression libraries
4
Clone and build
Installing zstandard on older systems
If zstandard is not available through your package manager:Build Options
Portable Build
By default, RocksDB optimizes for your specific CPU (-march=native). To build a binary compatible with different architectures:
Debug vs Release
Production builds: Always use
make static_lib or make shared_lib (release mode).Development builds: Use make all or make check (debug mode).Verification
Verify your installation:Next Steps
Getting Started
Learn the basics of using RocksDB
API Reference
Explore the complete API documentation