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 which sudo yum install -y cmake3 ctest3 ninja-build
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. Linuxbrew allows us to create a portable package that contains its own copy of glibc and can be installed on most Linux distributions. However, we are transitioning away from using Linuxbrew and towards native toolchains on various platforms.
Our build scripts may automatically install Linuxbrew in a directory such as
There is no need to add any of those directories to PATH.
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
build/latestdirectory, which would be a symbolic link to
build/release-gcc-dynamic-ninjain this case.
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.
Build release package
You can build a release package by executing:
$ ./yb_release ...... 2020-10-27 20:52:27,978 [yb_release.py:283 INFO] Generated a package at '/home/user/code/yugabyte-db/build/yugabyte-188.8.131.52-8696bc05a97c4907b53d6446b5bfa7acb28ceef5-release-centos-x86_64.tar.gz'