OceanBase Developer Handbook, Part 1: How to Compile the OceanBase Source Code

Abstract

This article guides you through compiling OceanBase. Most of its content comes from https://github.com/oceanbase/oceanbase .

The OceanBase Developer Handbook mainly guides developers on how to participate in OceanBase development, clearing obstacles you may encounter while preparing to contribute. This section covers the following articles, with more to be added in the future. For now, the OceanBase source code references the Open-Source Database OceanBase Source Code Walkthrough series on the OceanBase open-source official site:

  1. How to compile the OceanBase source code
  2. How to set up an IDE development environment
  3. How to become an OceanBase Contributor
  4. How to edit the OceanBase documentation
  5. How to debug OceanBase
  6. How to run tests
  7. How to fix bugs

Steps

OS compatibility list

OS Ver. Arch Compilable Package Deployable Compiled Binary Deployable Mysqltest Passed
Alibaba Cloud Linux 2.1903 x86_64
CentOS 7.2, 8.3 x86_64
Debian 9.8, 10.9 x86_64
Fedora 33 x86_64
MacOS any x86_64
openSUSE 15.2 x86_64
OpenAnolis 8.2 x86_64
SUSE 15.2 x86_64
Ubuntu 16.04, 18.04, 20.04 x86_64
UOS 20 x86_64

How to build

This document shows you how to build OceanBase.

Preparation

Before building, you need to make sure the required dependencies are installed on your system.

RedHat-based (including CentOS, Fedora, OpenAnolis, RedHat, UOS, etc.)
1
yum install git wget rpm* cpio make glibc-devel glibc-headers binutils
Debian-based (including Debian, Ubuntu, etc.)
1
apt-get install git wget rpm rpm2cpio cpio make build-essential binutils
SUSE-based (including SUSE, openSUSE, etc.)
1
zypper install git wget rpm cpio make glibc-devel binutils

Debug mode

1
bash build.sh debug --init --make

Release mode

1
bash build.sh release --init --make

RPM packages

1
bash build.sh rpm --init && cd build_rpm && make -j16 rpm