We have tested YDB builds using Ubuntu 18.04 and Ubuntu 20.04. Other Linux distributions are likely to work, but additional effort may be needed. Only x86_64 Linux is currently supported.
Below is a list of packages that need to be installed before building YDB. 'How to Build' section contains step by step instructions to obtain these packages.
- cmake 3.22+
- clang-12
- lld-12
- git 2.20+
- python2.7
- python3.8
- pip3
- antlr3
- libaio-dev
- libidn11-dev
- ninja 1.10+
We run multiple clang instances in parallel to speed up the process by default. Each instance of clang may use up to 1GB of RAM, and linking the binary may use up to 16GB of RAM, please make sure your build host has enough resources.
The following packages are required to run ydbd server:
- libidn11
- libaio
-
Add repositories for dependencies
Note: the following repositories are required for Ubuntu 20.04. You may skip this step if your GNU/Linux distribution has all required packages in their default repository. For more information please read your distribution documentation and https://apt.llvm.org as well as https://apt.kitware.com/
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | sudo apt-key add - echo 'deb http://apt.kitware.com/ubuntu/ focal main' | sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal main' | sudo tee /etc/apt/sources.list.d/llvm.list >/dev/null sudo apt-get update
-
Install dependencies
sudo apt-get -y install git cmake python python3-pip ninja-build antlr3 m4 clang-12 lld-12 libidn11-dev libaio1 libaio-dev sudo pip3 install conan
-
Create the work directory. Please make sure you have at least 80Gb of free space. We also recommend placing this directory on SSD to reduce build times.
mkdir ~/ydbwork && cd ~/ydbwork mkdir build
-
Clone the ydb repository.
git clone https://github.com/ydb-platform/ydb.git
-
Build ydb
cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain ../ydb ninja
A YDB server binary can be found at:
ydb/apps/ydbd/ydbd
A YDB CLI binary can be found at:
ydb/apps/ydb/ydb