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 prefixmakeoutput 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=0: Fail if the C++ compiler generates a warning, by enabling-Werror. -
./configure CXX=... CXXFLAGS=...: Build with a different compiler or flags. -
./configure --ccache: Speed up repeated builds usingccache. -
RethinkDB employees can use
./configure CXX=reccto speed up the build. The executable, innewton:/usr/local/bin/recc, wraps bothccacheanddistccto distribute the build across our server infrastructure and cache the result. -
There is a
check-syntaxtarget 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
makeoptions can also be useful:THREADED_COROUTINES=1NO_EVENTFD=1NO_EPOLL=1BUILD_PORTABLE=1orLEGACY_LINUX=1
- These are generated in a separate repository, named
"rethinkdb-old-admin", and the generated file is placed in
src/gen/web_assets.cc and committed. Instructions are in that
repository. The web assets are compiled into the executable. To
speed up development time and avoid rebuilding the executable, the
--web-static-directoryoption can be used. For example:build/release/rethinkdb --web-static-directory ~/rethinkdb-old-admin/build/web_assets
- Drivers have been removed from this repository.
-
These instructions are probably non-working -- you need to supply a driver.
-
make unit: Build and run the unit tests. -
make test: Run the unit tests, reql tests and integration tests. TheTESTvariables determines which tests to run. Seetest/run -hfor more documentation.
-
make supportormake support-<dep>: Build the dependencies that have not been built yet. -
make fetchormake 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. -
VERIFY_FETCH_HASH=0: Don't verify the hash of fetched archives.
-
./configure --prefix: Set the prefix folder used bymake install. -
make install: Install RethinkDB to the prefix. If theDESTDIRvariable is passed, install the files there. IfSTRIP_ON_INSTALL=1is 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 admginstaller for OS X. Jenkins always builds thedmgon 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: Tellmaketo 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-dbormake -p: Dump themakedatabase. -
make command-line: Print the realmakecommand 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
To build on FreeBSD (these instructions tested on FreeBSD 13), run
pkg install git gcc gmake python
./configure --allow-fetch CXX=g++
gmake
Note that despite the CXX=g++ parameter, the QuickJS dependency is hard-coded to build with Clang, out of laziness. If you try CXX=clang++, the executable is improperly linked. Some fixes to improve this are welcome.