Compilation
Rocksdb ' s library should is able to compile without any dependency installed, although we recommend installing some Compre Ssion libraries (see below). We do depend on newer Gcc/clang and c++11 support.
There is few options when compiling ROCKSDB:
[Recommended] make static_lib
Would compile LIBROCKSDB.A, rocksdb Static library.
make shared_lib
Would compile librocksdb.so, Rocksdb shared library.
make check
Would compile and run all the unit tests
make all
Would compile our static library, and all our tools and unit tests. Our tools depend on gflags. You'll need to the gflags installed to run make all
.
By default the binary we produce are optimized for the platform you ' re compiling on (-march=native). If you want to build a portable binary, add ' portable=1 ' before your make commands, like this:PORTABLE=1 make static_lib
Dependencies
Supported platforms
- linux-ubuntu
- Upgrade your gcc to version on least 4.7 to get c++11 support.
- Install gflags. First, try:
sudo apt-get install Libgflags-dev
if This doesn ' t work and your ' re using Ubuntu, here ' s A nice tutorial: (http://askubuntu.com/questions/312173/installing-gflags-12-04)
- Install Snappy. This was usually as easy as:
sudo apt-get install Libsnappy-dev
.
- Install zlib. try:
sudo apt-get install Zlib1g-dev
.
- install bzip2:
sudo apt-get install Libbz2-dev
.
-
linux-centos
- Upgrade your gcc to version on least 4.7 to get c++11 support: ;
Yum install gcc47-c++
-
Install gflags:
wget https://gflags.googlecode.com/files/gflags-2.0-no-svn-files.tar.gz Tar- XZVF gflags-2.0-no-svn-files.tar.gz cd gflags-2.0./configure && make && sudo make install
/li>
-
Install snappy:
wget https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz tar-xzvf SNA ppy-1.1.1.tar.gz CD snappy-1.1.1./configure && make && sudo make install
-
Ins Tall zlib:
sudo yum install zlib sudo yum install zlib-devel
-
Install bzip2:
sudo yum install bzip2 sudo yum install bzip2-devel
OS X:
- Install latest C + + compiler that supports C + + 11:
- Update xcode:run
xcode-select --install
(or install it from XCode App ' s settting).
- Install via homebrew.
- If you ' re first time developer on MacOS, you still need to run: in
xcode-select --install
your command line.
- Run to
brew tap homebrew/dupes; brew install gcc47 --use-llvm
install GCC 4.7 (or higher).
- Run
brew install rocksdb
IOS:
- Run:
TARGET_OS=IOS make static_lib
. When building the project which uses Rocksdb IOS Library, make sure to define, important pre-processing macros: ROCKSDB_LITE
and IOS_CROSS_COMPILE
.
ROCKSDB Compiling the installation log