Build the source code
NoteCentOS 7 is the recommended Linux development and production platform for YugabyteDB.
Install necessary packages
Update packages on your system, install development tools and additional packages:
sudo yum update sudo yum groupinstall -y 'Development Tools' sudo yum install -y ruby perl-Digest epel-release ccache git python2-pip python-devel python3 python3-pip python3-devel sudo yum install -y cmake3 ctest3
Prepare build tools
ctest binaries are at least version 3. On CentOS, one way to achieve this is to symlink them into
sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake sudo ln -s /usr/bin/ctest3 /usr/local/bin/ctest
You could also symlink them into another directory that is on your
We also use Linuxbrew to provide some of the third-party dependencies on CentOS.
During the build, we install Linuxbrew in a separate directory,
~/.linuxbrew-yb-build/linuxbrew-<version>, so that it does not conflict with any other Linuxbrew installation on your workstation, and does not contain any unnecessary packages that would interfere with the build.
We don't need to add
PATH. The build scripts will automatically discover this Linuxbrew installation.
Building the code
Assuming this repository is checked out in
~/code/yugabyte-db, do the following:
cd ~/code/yugabyte-db ./yb_build.sh release
NoteIf you see errors, such as
g++: internal compiler error: Killed, the system has probably run out of memory. Try again by running the build script with less concurrency, for example,
The command above will build the release configuration, add the C++ binaries into the
build/release-gcc-dynamic-ninja directory, and create a
build/latest symlink to that directory.
TipYou can find the binaries you just built in
For Linux, it will first make sure our custom Linuxbrew distribution is installed into
Build Java code
YugabyteDB core is written in C++, but the repository contains Java code needed to run sample applications. To build the Java part, you need:
- JDK 8
- Apache Maven.
Also make sure Maven's bin directory is added to your
PATH (for example, by adding to your
~/.bashrc). See the example below (if you've installed Maven into
For building YugabyteDB Java code, you'll need to install Java and Apache Maven.