Project: YugabyteDB (App Definition and Development / Database)
File: build-from-src-almalinux.md

title: Build from source code on AlmaLinux headerTitle: Build the source code linkTitle: Build the source description: Build YugabyteDB from source code on AlmaLinux. headcontent: Build the source code. menu: preview: identifier: build-from-src-1-almalinux parent: core-database weight: 2912 type: docs <ul class="nav nav-tabs-alt nav-tabs-yb"> <li > <a href="{{< relref "./build-from-src-almalinux.md" >}}" class="nav-link active"> <i class="fa-brands fa-linux" aria-hidden="true"></i> AlmaLinux </a> </li> <li > <a href="{{< relref "./build-from-src-macos.md" >}}" class="nav-link"> <i class="fa-brands fa-apple" aria-hidden="true"></i> macOS </a> </li> <li > <a href="{{< relref "./build-from-src-centos.md" >}}" class="nav-link"> <i class="fa-brands fa-linux" aria-hidden="true"></i> CentOS </a> </li> <li > <a href="{{< relref "./build-from-src-ubuntu.md" >}}" class="nav-link"> <i class="fa-brands fa-linux" aria-hidden="true"></i> Ubuntu </a> </li> </ul> {{< note title="Note" >}} AlmaLinux 8 is the recommended Linux development platform for YugabyteDB. {{< /note >}} {{% readfile "includes/tldr.md" %}} ```sh shellrc=~/.bashrc sudo dnf update -y sudo dnf groupinstall -y 'Development Tools' sudo dnf -y install epel-release packages=( ccache cmake3 gcc-toolset-11 gcc-toolset-11-libatomic-devel golang java-1.8.0-openjdk libatomic maven npm patchelf python39 rsync ) sudo dnf -y install "${packages[@]}" sudo alternatives --set python3 /usr/bin/python3.9 latestzipurl=$(curl -Ls "https://api.github.com/repos/ninja-build/ninja/releases/latest" \ | grep browserdownloadurl | grep ninja-linux.zip | cut -d \" -f 4) curl -Ls "$latestzipurl" | zcat | sudo tee /usr/local/bin/ninja >/dev/null sudo chmod +x /usr/local/bin/ninja sudo mkdir /opt/yb-build sudo chown "$USER" /opt/yb-build source <(echo 'export YBCCACHEDIR="$HOME/.cache/yb_ccache"' \ | tee -a "$shellrc") git clone https://github.com/yugabyte/yugabyte-db cd yugabyte-db ./yb_release ``` Update and install basic development packages as follows: ```sh sudo dnf update -y sudo dnf groupinstall -y 'Development Tools' sudo dnf -y install epel-release libatomic rsync ``` {{% readfile "includes/opt-yb-build.md" %}} {{% readfile "includes/python.md" %}} The following example installs Python 3.9. ```sh sudo dnf install -y python39 ``` In case there is more than one Python 3 version installed, ensure that `python3` refers to the right one. ```sh sudo alternatives --set python3 /usr/bin/python3.9 sudo alternatives --display python3 python3 -V ``` {{% readfile "includes/cmake.md" %}} ```sh sudo dnf install -y cmake3 ``` {{% readfile "includes/java.md" %}} Install the following packages to satisfy the preceding requirements: ```sh sudo dnf install -y java-1.8.0-openjdk maven ``` {{% readfile "includes/yugabyted-ui.md" %}} ```sh sudo dnf install -y npm golang ``` {{% readfile "includes/ninja.md" %}} The latest release can be downloaded: ```sh latestzipurl=$(curl -Ls "https://api.github.com/repos/ninja-build/ninja/releases/latest" \ | grep browserdownloadurl | grep ninja-linux.zip | cut -d \" -f 4) curl -Ls "$latestzipurl" | zcat | sudo tee /usr/local/bin/ninja >/dev/null sudo chmod +x /usr/local/bin/ninja ``` {{% readfile "includes/ccache.md" %}} ```sh sudo dnf install -y ccache export YBCCACHEDIR="$HOME/.cache/yb_ccache" ``` To compile with GCC, install the following packages, and adjust the version numbers to match the GCC version you plan to use. ```sh sudo dnf install -y gcc-toolset-11 gcc-toolset-11-libatomic-devel ``` {{% readfile "includes/build-the-code.md" %}} Perform the following steps to build a release package: . Install patchelf: ```sh sudo dnf install -y patchelf ``` Run the `yb_release` script using the following command: ```sh ./yb_release ``` ```output.sh ...... 2023-02-14 04:14:16,092 [ybrelease.py:299 INFO] Generated a package at '/home/user/code/yugabyte-db/build/yugabyte-2.17.2.0-b8e42eecde0e45a743d51e244dbd9662a6130cd6-release-clang15-centos-x8664.tar.gz' ``` {{% readfile "includes/ulimit.md" %}}