2013-11-18 20:44:17 +01:00
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
RocksDB is developed on Linux (CentOS release 5.2), with gcc 4.8.1.
|
|
|
|
It depends on gcc with C++11 support.
|
|
|
|
|
|
|
|
* RocksDB depends on the following libraries:
|
|
|
|
- [zlib](http://www.zlib.net/) - a library for data compression.
|
|
|
|
- [bzip2](http://www.bzip.org/) - a library for data compression.
|
|
|
|
- [snappy](https://code.google.com/p/snappy/) - a library for fast
|
|
|
|
data compression.
|
|
|
|
- [gflags](https://code.google.com/p/gflags/) - a library that handles
|
|
|
|
command line flags processing.
|
|
|
|
|
|
|
|
RocksDB will successfully compile without the compression libraries included,
|
|
|
|
but some things may fail. We do not support releases without the compression
|
|
|
|
libraries. You are on your own.
|
|
|
|
|
|
|
|
## Supported platforms
|
|
|
|
|
2014-01-29 17:41:43 +01:00
|
|
|
* **Linux - Ubuntu**
|
2013-11-18 20:44:17 +01:00
|
|
|
* Upgrade your gcc to version at least 4.7 to get C++11 support.
|
2014-01-29 17:41:43 +01:00
|
|
|
* Install gflags. First, try: `sudo apt-get install libgflags-dev`
|
2013-12-02 15:48:23 +01:00
|
|
|
If this doesn't work and you're using Ubuntu, here's a nice tutorial:
|
2013-11-18 20:44:17 +01:00
|
|
|
(http://askubuntu.com/questions/312173/installing-gflags-12-04)
|
|
|
|
* Install snappy. This is 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`.
|
2014-01-29 17:41:43 +01:00
|
|
|
* **Linux - CentOS**
|
|
|
|
* 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
|
|
|
|
sudo yum install zlib-devel
|
|
|
|
|
|
|
|
* Install bzip2:
|
|
|
|
|
|
|
|
sudo yum install bzip2
|
|
|
|
sudo yum install bzip2-devel
|
|
|
|
|
2013-11-18 20:44:17 +01:00
|
|
|
* **OS X**:
|
2013-11-20 23:54:53 +01:00
|
|
|
* Install latest C++ compiler that supports C++ 11:
|
2013-11-20 23:55:33 +01:00
|
|
|
* Update XCode: run `xcode-select --install` (or install it from XCode App's settting).
|
|
|
|
* Install via [homebrew](http://brew.sh/).
|
2013-11-20 23:54:53 +01:00
|
|
|
* If you're first time developer in MacOS, you still need to run: `xcode-select --install` in your command line.
|
|
|
|
* run `brew tap homebrew/dupes; brew install gcc47 --use-llvm` to install gcc 4.7 (or higher).
|
2013-11-18 20:44:17 +01:00
|
|
|
* Install zlib, bzip2 and snappy libraries for compression.
|
|
|
|
* Install gflags. We have included a script
|
|
|
|
`build_tools/mac-install-gflags.sh`, which should automatically install it.
|
|
|
|
If you installed gflags by other means (for example, `brew install gflags`),
|
|
|
|
please set `LIBRARY_PATH` and `CPATH` accordingly.
|
|
|
|
* Please note that some of the optimizations/features are disabled in OSX.
|
|
|
|
We did not run any production workloads on it.
|
|
|
|
|
2014-04-04 22:11:44 +02:00
|
|
|
* **iOS**:
|
|
|
|
* Run: `TARGET_OS=IOS make static_lib`
|
|
|
|
|
2013-11-18 20:44:17 +01:00
|
|
|
## Compilation
|
2014-03-18 20:01:44 +01:00
|
|
|
`make clean; make` will compile librocksdb.a (RocksDB static library) and all
|
2013-11-18 20:44:17 +01:00
|
|
|
the unit tests. You can run all unit tests with `make check`.
|
|
|
|
|
2014-02-24 21:29:26 +01:00
|
|
|
For shared library builds, exec `make shared_lib` instead.
|
2013-12-30 14:34:45 +01:00
|
|
|
|
2013-11-18 20:44:17 +01:00
|
|
|
If you followed the above steps and your compile or unit tests fail,
|
|
|
|
please submit an issue: (https://github.com/facebook/rocksdb/issues)
|