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
sudo apt-get install uuid-dev libbz2-dev libreadline-dev maven ninja-build \
                     cmake curl rsync python3-pip python3-venv zip autoconf libtool \
                     pkg-config libssl1.0-dev libicu-dev bison flex \
                     libncurses5-dev

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

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

Note

If 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, -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.

Note

If you are getting errors in the form of:

uild/release-gcc-dynamic-ninja/postgres_build/src/backend/libpq/be-secure-openssl.o: In function `my_sock_read':
src/postgres/src/backend/libpq/be-secure-openssl.c:665: undefined reference to `BIO_get_data'
build/release-gcc-dynamic-ninja/postgres_build/src/backend/libpq/be-secure-openssl.o: In function `my_sock_write':
src/postgres/src/backend/libpq/be-secure-openssl.c:685: undefined reference to `BIO_get_data'

The code is probably not finding the right path for libssl1.0. Try a clean build ./yb_build.sh --clean release. If that doesn't work, look into your $PATH if some other openssl version path is being used.

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.