aboutsummaryrefslogtreecommitdiffstats
path: root/BUILD.md
blob: 2da643f8ab5f23c0d7814d306cfaf8a597e8e8a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
## Build YDB from source

##### Build requirements:
 The following packets is required to build ydbd.

 - cmake 3.22+
 - clang-12
 - lld-12
 - git 2.20+
 - python2.7
 - python3.8
 - pip3
 - antlr3
 - libaio-dev
 - libidn11-dev
 - ninja 1.10+

##### Runtime requirements:
 The following packets is required to run ydbd.

 - libidn11
 - libaio

##### How to build:
 Currently x86_64 linux is supported. Building was tested on Ubuntu 18.04 and Ubuntu 20.04
 Note when multithreading build is on operation each instance of clang can use up to 1 GB of RAM. Linkage of binary file can use up to 16Gb ram. Please make sure system has enough memory.

1. Add repositories to install dependencies

    Note following repositories is required for **ubuntu 20.04**. If your GNU/Linux distributive already have required build dependencies you need to skip this step.
    For more information look in to your distributive instruction and https://apt.llvm.org and 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
     ```

1. 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
     ```

 1. Create work directory. Please make sure youre have at least 80Gb free space on the filesystem where your want to place this directory. Also we recomend to use SSD drive to reduce build time.
    ```
    mkdir ~/ydbwork && cd ~/ydbwork
    mkdir build
    ```

 1. Checkout ydb repository.
    ```
    git clone https://github.com/ydb-platform/ydb.git
    ```

 1. Build ydb
     ```
    cd build
    cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../ydb/clang.toolchain ../ydb
    ninja
    ```
    The YDB server binary can be found at:
    ```
    ydb/apps/ydbd/ydbd
    ```
    The YDB CLI binart at:
    ```
    ydb/apps/ydb/ydb
    ```