最新消息:聚合-分享-->bidutools.com是专注互联网技术的个人博客,大部分来自互联网,以作为笔记查阅。

CentOS 编译rocksdb源码

数据库 bidu 24浏览

Linux – CentOS 编译rocksdb

Compilation

参考:http://www.mamicode.com/info-detail-2205244.html

RocksDB’s library should be able to compile without any dependency installed, although we recommend installing some compression libraries (see below). We do depend on newer gcc/clang with C++11 support.

There are few options when compiling RocksDB:

[recommended] make static_lib will compile librocksdb.a, RocksDB static library.

make shared_lib will compile librocksdb.so, RocksDB shared library.

make check will compile and run all the unit tests

make all will compile our static library, and all our tools and unit tests. Our tools depend on gflags. You will need to have gflags installed to run make all.

By default the binary we produce is 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

You can link RocksDB with following compression libraries:

zlib – a library for data compression.
bzip2 – a library for data compression.
snappy – a library for fast data compression.
All our tools depend on:

gflags – a library that handles command line flags processing. You can compile rocksdb library even if you don’t have gflags installed.
Upgrade your gcc to version at 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
Install snappy:
wget https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz
tar -xzvf snappy-1.1.1.tar.gz
cd snappy-1.1.1
./configure && make && sudo make install
Install zlib:
sudo yum install zlib
Upgrade your gcc to version at 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
Install snappy:
wget https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz
tar -xzvf snappy-1.1.1.tar.gz
cd snappy-1.1.1
./configure && make && sudo make install
Install zlib:
sudo yum install zlib

转载请注明:BiduTools.com聚合、分享 » CentOS 编译rocksdb源码