To build RethinkDB, run:
./configure --allow-fetch
make
The --allow-fetch
option tells make
to fetch and build missing
dependencies.
The full list of options accepted by the configure script can be
listed with ./configure --help
. The full list of variables that can
be passed to make
are documented in mk/defaults.mk
. The possible
targets are described below.
Useful targets and variables during development.
-
make clean
: Remove the entirebuild/
directory. -
make SHOW_COUNTDOWN=0
: Do not prefixmake
output with the rule count (such as[3/301]
). -
make VERBOSE=1
: Display each command being executed and their output. -
make -j <n>
: Build in parallel. A good default for<n>
is the amount of cores plus one.
The server may depend on some of the fetched dependencies. Accessing its web UI also requires the web assets.
-
make rethinkdb
: Only build the server executable. -
make tags
,make etags
: Generate tag files used by vim and emacs. -
make ALLOW_WARNINGS=1
: Do not fail if the C++ compiler generates a warning, by disabling-Werror
. -
./configure CXX=... CXXFLAGS=...
: Build with a different compiler or flags. -
./configure --ccache
: Speed up repeated builds usingccache
. -
RethinkDB employees can use
./configure CXX=recc
to speed up the build. The executable, innewton:/usr/local/bin/recc
, wraps bothccache
anddistcc
to distribute the build across our server infrastructure and cache the result. -
There is a
check-syntax
target that can be used with emacs' flymake-mode. -
make SYMBOLS=0
: Exclude debugging symbols. -
make SPLIT_SYMBOLS=1
: Strip the executable and generate a symbols file. -
make DEBUG=1
: Build in debug mode. -
When building on older distributions or porting to different platforms, these
make
options can also be useful:THREADED_COROUTINES=1
NO_EVENTFD=1
NO_EPOLL=1
BUILD_PORTABLE=1
orLEGACY_LINUX=1
-
make web-assets
: Build only the web assets. -
If there is a
precompiled/web
folder, the web assets will not be rebuilt unless the--disable-precompiled-web
flag is passed to./configure
-
The web assets are compiled into the executable. To speed up development time and avoid rebuilding the executable, the
--web-static-directory
option can be used. For example:build/release/rethinkdb --web-static-directory build/web_assets
-
make ruby-driver
: Build the Ruby driver -
make python-driver
: Build the Python driver. -
make js-driver
: Build the JavaScript driver. -
make drivers
: Build all the drivers.
-
make unit
: Build and run the unit tests. -
make test
: Run the unit tests, reql tests and integration tests. TheTEST
variables determines which tests to run. Seetest/run -h
for more documentation.
-
make support
ormake support-<dep>
: Build the dependencies that have not been built yet. -
make fetch
ormake fetch-<dep>
: Fetch the dependencies that have not yet been fetched. -
make build-<dep>
: Rebuild a given dependency. -
make clean-<dep>
: Clean the build directory of a given dependency. -
install-include-<dep>
: Copy the include files from the given dependency.
-
./configure --prefix
: Set the prefix folder used bymake install
. -
make install
: Install RethinkDB to the prefix. If theDESTDIR
variable is passed, install the files there. IfSTRIP_ON_INSTALL=1
is passed, also strip the executable. -
make install-binaries
: Only install the server executable.
Packaging is usually automated by the BuildBot instance running on
dr-doom:8010
in our intranet.
-
make build-deb-src UBUNTU_RELEASE=<name> PACKAGE_BUILD_NUMBER=<n>
: Build a package for the given Ubuntu version. -
make build-osx
: Build admg
installer for OS X. Jenkins always builds thedmg
on OS X 10.7.5. -
make dist
: Build a source distribution. -
The CentOS RPM are built with
scripts/build-rpm.sh
.
Some of the flags and targets can be used to debug the build system itself.
-
make
var-<VAR>
: Print the value of the given variable. -
make -B
: Force rebuilding all files. -
make -d
: Tellmake
to dump a lot of debug information. -
make IGNORE_MAKEFILE_CHANGES=1
: Do not rebuild files if the makefiles have changes. -
make SHOW_BUILD_REASON=1
: Show which file triggered each rule. -
make dump-db
ormake -p
: Dump themake
database. -
make command-line
: Print the realmake
command line used to build RethinkDB. On some old, unpatched versions of GNU make this is required to use-j
. -
make debug-count
: Debug the count feature.
To be able to invoke make from a subdirectory, a Makefile must exist. It usually looks like this:
OVERRIDE_GOALS ?= default-goal=<default target for this directory>
TOP := <relative path to the top of the rethinkdb source tree>
include $(TOP)/Makefile