diff --git a/INSTALL.md b/INSTALL.md index 50b27c80d11..72865e2f210 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,19 +1,24 @@ ## Compilation +**Important**: If you plan to run RocksDB in production, don't compile using default +`make` or `make all`. That will compile RocksDB in debug mode, which is much slower +than release mode. + 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. +* [recommended] `make static_lib` will compile librocksdb.a, RocksDB static library. Compiles static library in release mode. -* `make shared_lib` will compile librocksdb.so, RocksDB shared library. +* `make shared_lib` will compile librocksdb.so, RocksDB shared library. Compiles shared library in release mode. -* `make check` will compile and run all the unit tests +* `make check` will compile and run all the unit tests. `make check` will compile RocksDB in debug mode. * `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`. +depend on gflags. You will need to have gflags installed to run `make all`. This will compile RocksDB in debug mode. Don't +use binaries compiled by `make all` in production. * 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 diff --git a/Makefile b/Makefile index 009f4676ac6..11ec0156737 100644 --- a/Makefile +++ b/Makefile @@ -76,6 +76,8 @@ endif ifeq ($(DEBUG_LEVEL),0) OPT += -DNDEBUG DISABLE_WARNING_AS_ERROR=1 +else +$(warning Warning: Compiling in debug mode. Don't use the resulting binary in production) endif #----------------------------------------------- @@ -322,10 +324,14 @@ TOOLS = \ BENCHMARKS = db_bench table_reader_bench cache_bench memtablerep_bench -# The library name is configurable since we are maintaining libraries of both -# debug/release mode. +# if user didn't config LIBNAME, set the default ifeq ($(LIBNAME),) +# we should only run rocksdb in production with DEBUG_LEVEL 0 +ifeq ($(DEBUG_LEVEL),0) LIBNAME=librocksdb +else + LIBNAME=librocksdb_debug +endif endif LIBRARY = ${LIBNAME}.a