Build the source code

Build the source code.

Note

CentOS 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 apt-get update
packages=(
  autoconf
  cmake
  curl
  git
  git
  git
  libtool
  libtool
  locales
  maven
  ninja-build
  patchelf
  pkg-config
  python3-pip
  python3-venv
  rsync
  zip
)
sudo apt-get install -y "${packages[@]}"
sudo locale-gen en_US.UTF-8

Assuming this repository is checked out in ~/code/yugabyte-db, do the following:

cd ~/code/yugabyte-db
./yb_build.sh release --no-linuxbrew

Note

If you see errors, such as internal compiler error: Killed, the system has probably run out of memory. Try again by running the build script with less concurrency, for example, -j1.

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.

Tip

You can find the binaries you just built in build/latest directory.

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:

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 ~/tools/apache-maven-3.6.3)

export PATH=$HOME/tools/apache-maven-3.6.3/bin:$PATH

For building YugabyteDB Java code, you'll need to install Java and Apache Maven.

Build release package

Currently a release package can only be built in CentOS & MacOS.