Building ScyllaDB - linux-on-ibm-z/docs GitHub Wiki

Building ScyllaDB

The instructions provided below specify the steps to build ScyllaDB version 5.2.9 on Linux on IBM Z for the following distributions:

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9)
  • Ubuntu (20.04, 22.04)

Ensure that the kernel you are using is the latest available.

General Notes:

  • ScyllaDB and its dependencies are large projects and take a significant amount of time to build. The build can be sped up on large systems by increasing the -j parameter passed to make and/or ninja. The build was tested on a machine with 8 vCPUs and 32GB/16GB RAM. When building on a machine with 16GB RAM or less, a large swap file is needed.
  • Building ScyllaDB takes a large amount of disk space. Ensure you have at least 75GB available on the filesystem you are using. Significantly more space will be necessary if you wish to add debug information to the test binaries.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
  • An installation directory /<prefix>/ is referred to in these instructions, by default this is /usr/local.
  • A target architecture /<target>/ is referred to in these instructions - this is the value passed to the GCC compiler.

Step 1. Build using script

If you want to build ScyllaDB manually, go to STEP 2.

Use the following commands to build ScyllaDB using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/ScyllaDB/5.2.9/build_scylladb.sh

bash build_scylladb.sh [-t] [-y] [-z <target>]

Provide -t option for executing build with tests.
Provide -y to install required packages without confirmation. Provide -z option to select target architecture for build e.g. z13, z14. Defaults to native architecture.

If the build completes successfully, go to STEP 9. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

Step 2. Install Dependencies

export SOURCE_ROOT=/<source_root>/
export TARGET=native                      # z13, z14, native
export PREFIX=/usr/local                  # /<prefix>/
export PATCH_URL=https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/ScyllaDB/5.2.9/patch/

2.1) Prepare for installation

  • RHEL (7.8, 7.9)

    Downgrade broken glibc version if installed.

    sudo yum list installed glibc-2.17-307.el7.1.s390
    if [[ $? ]]; then
     sudo yum downgrade -y glibc glibc-common
     sudo yum downgrade -y krb5-libs
     sudo yum downgrade -y libss e2fsprogs-libs e2fsprogs libcom_err
     sudo yum downgrade -y libselinux-utils libselinux-python libselinux
    fi

2.2) Install Packages

  • RHEL 7.x

    sudo yum install -y java-1.8.0-openjdk-devel libaio-devel systemtap-sdt-devel lksctp-tools-devel \
    xfsprogs-devel snappy-devel libyaml-devel libevent-devel libtasn1-devel libmpcdec \
    lz4-devel libatomic libatomic_ops-devel perl-devel automake make git gcc gcc-c++ maven unzip file \
    bzip2 wget curl xz-devel texinfo libffi-devel libpciaccess-devel libxml2-devel libtool diffutils \
    libtool-ltdl-devel trousers-devel libunistring-devel libicu-devel readline-devel lua-devel patch \
    systemd-devel valgrind-devel net-tools langpacks-en glibc-all-langpacks zlib-devel libdeflate libdeflate-devel
  • RHEL 8.X

    sudo dnf install -y  https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    
    sudo yum install -y --allowerasing gcc gcc-c++ \
      libatomic libatomic_ops-devel java-1.8.0-openjdk-devel lksctp-tools-devel xfsprogs-devel \
      snappy-devel libyaml-devel openssl-devel libevent-devel libtasn1-devel libmpcdec \
      libidn2-devel numactl-devel c-ares-devel gnutls-devel gnutls-c++ gnutls-dane perl-devel \
      python38 python38-devel python38-pip python38-PyYAML python38-setuptools python38-requests \
      make automake git maven ant ninja-build unzip bzip2 wget curl xz-devel texinfo libffi-devel \
      libpciaccess-devel libxml2-devel libtool diffutils libtool-ltdl-devel trousers-devel \
      p11-kit-devel libunistring-devel libicu-devel readline-devel lua-devel patch systemd-devel \
      valgrind-devel cmake hwloc hwloc-devel cryptopp cryptopp-devel lz4 lz4-devel jsoncpp \
      jsoncpp-devel protobuf rapidjson-devel stow yaml-cpp yaml-cpp-devel ragel langpacks-en \
      glibc-all-langpacks libdeflate libdeflate-devel file abseil-cpp-devel
    sudo yum install -y gcc-toolset-11 gcc-toolset-11-libatomic-devel
  • Ubuntu (20.04, 22.04)

     sudo apt-get update >/dev/null
     sudo apt-get install -y software-properties-common
     sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
     sudo apt-get update >/dev/null
     sudo apt-get install -y --no-install-recommends gcc g++
     sudo apt-get install -y openjdk-8-jdk libaio-dev systemtap-sdt-dev lksctp-tools xfsprogs \
      libyaml-dev openssl libevent-dev libmpfr-dev libmpcdec-dev libssl-dev libsystemd-dev \
      libsctp-dev libsnappy-dev libpciaccess-dev libxml2-dev xfslibs-dev libgnutls28-dev \
      libiconv-hook-dev liblzma-dev libbz2-dev libxslt-dev libc-ares-dev libprotobuf-dev \
      protobuf-compiler libcrypto++-dev libtool perl ant libffi-dev rapidjson-dev automake \
      make git maven ninja-build unzip bzip2 wget curl xz-utils texinfo diffutils liblua5.3-dev \
      libnuma-dev libunistring-dev python3 python3-pip pigz ragel stow patch locales valgrind \
      libudev-dev libdeflate-dev zlib1g-dev
     sudo apt-get install -y libabsl-dev # only for Ubuntu 22.04

2.3) Install rust and rust packages

  cd "$SOURCE_ROOT"
  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh /dev/stdin -y
  export PATH="$HOME/.cargo/bin:$PATH"
  echo "export PATH=$PATH" >> $ENV_VARS
  cargo install cxxbridge-cmd --root $SOURCE_ROOT/cxxbridge
  sudo cp -r $SOURCE_ROOT/cxxbridge/. /usr/local

Step 3. Build GCC 12.1.0 and binutils:

3.1) Binutils 2.38

  cd "$SOURCE_ROOT"
  URL=https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz
  curl -sSL $URL | tar xzf - || error "binutils 2.38"
  cd binutils-2.38
  mkdir objdir
  cd objdir

  CC=/usr/bin/gcc ../configure --prefix=/usr --build=s390x-linux-gnu
  make -j 8
  sudo make install

3.2) GCC 12.1.0 (Only for RHEL 7.x and Ubuntu 20.04)

  cd "$SOURCE_ROOT"
  URL=https://ftp.gnu.org/gnu/gcc/gcc-12.1.0/gcc-12.1.0.tar.gz
  curl -sSL $URL | tar xzf - || error "GCC 12.1.0"

  cd gcc-12.1.0
  ./contrib/download_prerequisites
  mkdir objdir
  cd objdir

  ../configure --enable-languages=c,c++ --prefix=${PREFIX} \
    --enable-shared --enable-threads=posix \
    --disable-multilib --disable-libmpx \
    --with-system-zlib --with-long-double-128 --with-arch=zEC12 \
    --disable-libphobos --disable-werror \
    --build=s390x-linux-gnu --host=s390x-linux-gnu --target=s390x-linux-gnu

  make -j 8 bootstrap
  sudo make install

  export PATH=${PREFIX}/bin${PATH:+:${PATH}}

  LD_LIBRARY_PATH=${PREFIX}/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
  LD_LIBRARY_PATH+=:${PREFIX}/lib
  LD_LIBRARY_PATH+=:/usr/lib64
  export LD_LIBRARY_PATH

  LD_RUN_PATH=${PREFIX}/lib64${LD_RUN_PATH:+:${LD_RUN_PATH}}
  LD_RUN_PATH+=:${PREFIX}/lib
  LD_RUN_PATH+=:/usr/lib64
  export LD_RUN_PATH

3.3) Update Compiler information(only for RHEL 7.x)

  export CC=${PREFIX}/bin/gcc
  export CXX=${PREFIX}/bin/g++

3.4) Update Compiler information(only for RHEL 8.x)

  export CC=clang-14
  export CXX=clang++-14

3.5) Setup binutils(only for Ubuntu)

  sudo rm /usr/bin/s390x-linux-gnu-ld /usr/bin/s390x-linux-gnu-ld.bfd
  sudo ln -s /usr/bin/ld /usr/bin/s390x-linux-gnu-ld
  sudo ln -s /usr/bin/ld.bfd /usr/bin/s390x-linux-gnu-ld.bfd

3.6) Setup gcc for Clang compiler(only for Ubuntu 20.04)

  sudo ln -s ${PREFIX}/lib/gcc/s390x-linux-gnu/12.1.0 /usr/lib/gcc/s390x-linux-gnu/12.1.0

Step 4. Install Clang (For Ubuntu only)

  cd "$SOURCE_ROOT"
  wget https://apt.llvm.org/llvm.sh
  sed -i 's,add-apt-repository "${REPO_NAME}",add-apt-repository "${REPO_NAME}" -y,g' llvm.sh
  chmod +x llvm.sh
  sudo ./llvm.sh 14
  rm ./llvm.sh
  export CC=clang-14
  export CXX=clang++-14

Step 5. Build and install dependencies for required distributions

5.1) Build Python 3.11 on RHEL 7.x, 8.x and Ubuntu 20.04

  cd "$SOURCE_ROOT"
  URL="https://www.python.org/ftp/python/3.11.3/Python-3.11.3.tgz"
  curl -sSL $URL | tar xzf -
  cd Python-3.11.3
  ./configure
  make
  sudo make install

  pip3 install --user --upgrade pip
  pip3 install --user pyparsing colorama pyyaml boto3 requests pytest traceback-with-variables \
                      scylla-driver scylla-api-client aiohttp tabulate boto3 pytest-asyncio

5.2) On RHEL 7.x and Ubuntu distributions

  • Cmake
  cd "$SOURCE_ROOT"
  URL=https://github.com/Kitware/CMake/releases/download/v3.17.4/cmake-3.17.4.tar.gz
  curl -sSL $URL | tar xzf -
  cd cmake-3.17.4
  ./bootstrap --prefix=/usr
  make
  sudo make install
  • cryptopp
  cd "$SOURCE_ROOT"
  mkdir cryptopp
  cd cryptopp
  curl -ksSLO https://github.com/weidai11/cryptopp/archive/refs/tags/CRYPTOPP_8_2_0.zip
  unzip CRYPTOPP_8_2_0.zip
  cd cryptopp-CRYPTOPP_8_2_0
  CXXFLAGS="-std=c++11 -g -O2" make
  sudo make install
  • hwloc
  cd "$SOURCE_ROOT"
  URL=https://download.open-mpi.org/release/hwloc/v2.4/hwloc-2.4.1.tar.gz
  curl -sSL $URL | tar xzf - || error "hwloc 2.4.1"
  cd hwloc-2.4.1
  ./configure
  sudo make install
  • yaml-cpp
  cd "$SOURCE_ROOT"
  URL=https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.6.3.tar.gz
  curl -sSL $URL | tar xzf -
  cd yaml-cpp-yaml-cpp-0.6.3
  mkdir build
  cd build
  cmake ..
  make
  sudo make install
  • valgrind (RHEL 7.x and Ubuntu 20.04 only)
  cd "$SOURCE_ROOT"
  URL=https://sourceware.org/pub/valgrind/valgrind-3.19.0.tar.bz2
  curl -sSL $URL | tar -xj || error "Valgrind 3.19.0"
  cd valgrind-3.19.0
  ./configure CC=gcc CXX=g++
  make
  sudo make install
  • jsoncpp
  cd "$SOURCE_ROOT"
  URL=https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/1.9.5.tar.gz
  curl -sSL $URL | tar xzf -
  cd jsoncpp-1.9.5
  mkdir -p build/release
  cd build/release
  cmake ../..
  make -j 8
  sudo make install

5.3) On Ubuntu distributions

  • lz4
  cd "$SOURCE_ROOT"
  URL=https://github.com/lz4/lz4/archive/refs/tags/v1.9.3.tar.gz
  curl -sSL $URL | tar xzf - || error "lz4 1.9.3"
  cd lz4-1.9.3
  sudo make install

5.4) On RHEL 7.x distributions

  • Openssl
  cd "$SOURCE_ROOT"
  wget https://www.openssl.org/source/openssl-1.1.1u.tar.gz --no-check-certificate
  tar -xzf openssl-1.1.1u.tar.gz
  cd openssl-1.1.1u
  ./config --prefix=/usr/local --openssldir=/usr/local
  make
  sudo make install
  sudo ldconfig /usr/local/lib64
  export LDFLAGS="-L/usr/local/lib/ -L/usr/local/lib64/"
  export CPPFLAGS="-I/usr/local/include/ -I/usr/local/include/openssl"
  • Ragel
  cd "$SOURCE_ROOT"
  URL=http://www.colm.net/files/ragel/ragel-6.10.tar.gz
  curl -sSL $URL | tar xzf -
  cd ragel-6.10
  ./configure
  make -j 8
  sudo make install
  • Ninja
  cd "$SOURCE_ROOT"
  curl -sSLO https://github.com/ninja-build/ninja/archive/refs/tags/v1.11.1.zip
  unzip v1.11.1.zip
  cd ninja-1.11.1
  ./configure.py --bootstrap
  sudo cp ninja ${PREFIX}/bin
  • libidn2
  cd ${SOURCE_ROOT}
  URL=https://ftp.gnu.org/gnu/libidn/libidn2-2.3.0.tar.gz
  curl -sSL $URL | tar xzf -
  cd libidn2-2.3.0
  ./configure --disable-doc --disable-gtk-doc
  make
  sudo make install
  • numactl
  cd ${SOURCE_ROOT}
  git clone https://github.com/numactl/numactl.git
  cd numactl
  git checkout v2.0.14
  ./autogen.sh
  ./configure
  make
  sudo make install
  • c-ares
  cd ${SOURCE_ROOT}
  URL=https://c-ares.org/download/c-ares-1.15.0.tar.gz
  curl -sSL $URL | tar xzf -
  cd c-ares-1.15.0
  ./configure
  make
  sudo make install
  • Ant
  cd "$SOURCE_ROOT"
  URL=https://downloads.apache.org/ant/binaries/apache-ant-1.10.14-bin.tar.gz
  curl -sSL $URL | tar xzf -
  export ANT_HOME="$SOURCE_ROOT/apache-ant-1.10.14"
  export PATH=$PATH:"$ANT_HOME/bin"
  • LUA
  cd "$SOURCE_ROOT"
  URL=http://www.lua.org/ftp/lua-5.3.5.tar.gz
  curl -sSL $URL | tar xzf -
  cd lua-5.3.5
  make linux
  sudo make install
  • p11-kit
  ver=0.23.21
  cd "$SOURCE_ROOT"
  URL=https://github.com/p11-glue/p11-kit/releases/download/0.23.21/p11-kit-0.23.21.tar.xz
  curl -sSL $URL | tar xJf - || error "p11-kit 0.23.21"
  cd p11-kit-0.23.21
  ./configure --prefix=${PREFIX}
  make
  sudo make install
  • gmplib
  cd "$SOURCE_ROOT"
  URL=https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz
  curl -sSL $URL | tar xJf - || error "gmplib 6.2.1"
  cd gmp-6.2.1
  ./configure --prefix=${PREFIX}
  make
  make check
  sudo make install
  • nettle
  cd "$SOURCE_ROOT"
  URL=https://ftp.gnu.org/gnu/nettle/nettle-3.6.tar.gz
  curl -sSL $URL | tar xzf - || error "nettle 3.6"
  cd nettle-3.6
  ./configure --prefix=${PREFIX}
  make
  make check
  sudo make install
  • gnutls
  cd "$SOURCE_ROOT"
  URL=https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-3.6.15.tar.xz
  curl -sSL $URL | tar xJf - || error "gnutls 3.6.15"
  cd gnutls-3.6.15
  PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}} ./configure --prefix=${PREFIX}
  make
  make check
  sudo make install
  • Protocolbuffers
  cd "$SOURCE_ROOT"
  git clone https://github.com/protocolbuffers/protobuf.git
  cd protobuf
  git checkout v3.11.2
  ./autogen.sh
  ./configure
  make
  sudo make install
  • RapidJSon
  cd "$SOURCE_ROOT"
  git clone https://github.com/Tencent/rapidjson.git
  cd rapidjson
  git checkout v1.1.0
  sudo cp -r ./include/rapidjson ${PREFIX}/include
  • stow
  cd "$SOURCE_ROOT"
  URL=http://ftpmirror.gnu.org/gnu/stow/stow-2.3.1.tar.gz
  curl -sSL $URL | tar xzf - || error "Stow 2.3.1"
  cd stow-2.3.1
  ./configure
  sudo make install
  • Libdeflate
  cd "$SOURCE_ROOT"
  git clone https://github.com/ebiggers/libdeflate.git
  cd libdeflate
  git checkout v1.18
  cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=/usr/local
  sudo cmake --build build --target install
  libbuild=${SOURCE_ROOT}/libdeflate
  export PATH=$libbuild/build:$PATH
  export LD_LIBRARY_PATH=$libbuild/lib:$LD_LIBRARY_PATH

5.5) Build clang on RHEL 7.x and 8.X

  cd "$SOURCE_ROOT"
  URL=https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-14.0.6.tar.gz
  curl -sSL $URL | tar xzf - || error "Clang 14.0.6"
  cd llvm-project-llvmorg-14.0.6
  mkdir build
  cd build

  # on RHEL 8.x
  cmake -DLLVM_ENABLE_PROJECTS=clang  -DCMAKE_BUILD_TYPE="Release" -G "Unix Makefiles" -DGCC_INSTALL_PREFIX="/opt/rh/gcc-toolset-11/root/" ../llvm

  # On other distros
  cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_C_COMPILER="${PREFIX}/bin/gcc" -DCMAKE_CXX_COMPILER="${PREFIX}/bin/g++" \
  -DCMAKE_BUILD_TYPE="Release" -G "Unix Makefiles" ../llvm

  make clang -j8

  clangbuild=${SOURCE_ROOT}/llvm-project-llvmorg-14.0.6/build
  export PATH=$clangbuild/bin:$PATH
  export LD_LIBRARY_PATH=$clangbuild/lib:$LD_LIBRARY_PATH

  # On RHEL 7.x
  sudo ln -s ${PREFIX}/lib/gcc/s390x-linux-gnu/13.1.0 /usr/lib/gcc/s390x-redhat-linux/13.1.0
  sudo ln -s ${PREFIX}/include/c++/13.1.0/s390x-linux-gnu /usr/include
  export CC=clang
  export CXX=clang++

  # On RHEL 8.x
  clangbuild=${SOURCE_ROOT}/llvm-project-llvmorg-${CLANG_VERSION}/build
  ln -s clang++ ${SOURCE_ROOT}/llvm-project-llvmorg-${CLANG_VERSION}/build/bin/clang++-14
  export PATH=$clangbuild/bin:$PATH
  export LD_LIBRARY_PATH=$clangbuild/lib:$LD_LIBRARY_PATH
  export CC=clang-14
  export CXX=clang++-14

5.6) On RHEL 8.x and Ubuntu

  • Python 3 modules
  python3 -m pip install --user --upgrade pip
  python3 -m pip install --user pyparsing colorama pyyaml boto3 requests pytest scylla-driver \
          traceback-with-variables scylla-api-client aiohttp tabulate pytest-asyncio

5.7) Dependencies common to all distributions

  • xxHash
  cd "$SOURCE_ROOT"
  URL=https://github.com/Cyan4973/xxHash/archive/v0.8.0.tar.gz
  curl -sSL $URL | tar xzf - || error "xxHash 0.8.0"
  cd xxHash-0.8.0
  sudo make install
  • fmt
  cd "$SOURCE_ROOT"
  git clone https://github.com/fmtlib/fmt.git
  cd fmt
  git checkout 9.1.0
  cmake -DFMT_TEST=OFF \
         -DCMAKE_CXX_STANDARD=17 \
         -DCMAKE_BUILD_TYPE=RelWithDebInfo \
         -DCMAKE_CXX_VISIBILITY_PRESET=hidden \
         -DCMAKE_POSITION_INDEPENDENT_CODE=ON .
  make
  sudo make install
  • Zstd
  cd "$SOURCE_ROOT"
  URL=https://github.com/facebook/zstd/releases/download/v1.4.5/zstd-1.4.5.tar.gz
  curl -sSL $URL | tar xzf - || error "zstd 1.4.5"
  cd zstd-1.4.5
  curl -sSL ${PATCH_URL}/zstd.diff | patch -p1 || error "zstd.diff"
  cd lib
  make
  sudo make install
  • Antlr
  cd "$SOURCE_ROOT"

  URL=https://github.com/antlr/antlr3/archive/refs/tags/3.5.2.tar.gz
  curl -sSL $URL | tar xzf -
  cd antlr3-3.5.2
  curl -sSL ${PATCH_URL}/antlr3.diff | patch -p1 || error "antlr3.diff"

  sudo cp runtime/Cpp/include/antlr3* ${PREFIX}/include/

  cd antlr-complete
  MAVEN_OPTS="-Xmx4G" mvn
  echo 'java -cp '"$(pwd)"'/target/antlr-complete-3.5.2.jar org.antlr.Tool $@' | sudo tee ${PREFIX}/bin/antlr3
  sudo chmod +x ${PREFIX}/bin/antlr3
  • Boost
  TOOLSET=gcc
  CENV=(PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH LD_RUN_PATH=$LD_RUN_PATH CC=$CC CXX=$CXX)

  cd "$SOURCE_ROOT"
  URL=https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz
  curl -sSL $URL | tar xzf -
  cd boost_1_74_0

  sed -i 's/array\.hpp/array_wrapper.hpp/g' boost/numeric/ublas/matrix.hpp
  sed -i 's/array\.hpp/array_wrapper.hpp/g' boost/numeric/ublas/storage.hpp

  ./bootstrap.sh

  options=( toolset=$TOOLSET variant=release link=shared runtime-link=shared threading=multi --without-python )

  ./b2 ${options[@]} stage
  sudo ${CENV[@]} ./b2 ${options[@]} install
  • Thrift
  cd "$SOURCE_ROOT"
  URL=http://archive.apache.org/dist/thrift/0.13.0/thrift-0.13.0.tar.gz
  curl -sSL $URL | tar xzf -
  cd thrift-0.13.0
  ./configure --without-java --without-lua --without-go --disable-tests --disable-tutorial
  make -j 8
  sudo make install
  • Abseil (RHEL 7.x and 8.x and Ubuntu 20.04 only)
  cd "$SOURCE_ROOT"
  git clone https://github.com/abseil/abseil-cpp.git
  cd abseil-cpp
  git checkout 20230125.3
  cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=/usr/local
  sudo -E env "PATH=$PATH" cmake --build build --target install

Step 6. Build ScyllaDB

6.1) Adjust locale settings (only on Ubuntu):

  sudo locale-gen en_US.UTF-8
  export LC_ALL=C
  unset LANGUAGE

6.2) Checkout and Patch

The following commands will clone the repository, initialize its submodules and apply the patches.

  cd "$SOURCE_ROOT"
  git clone https://github.com/scylladb/scylla.git
  cd scylla
  git checkout scylla-5.2.9
  git submodule update --init --force --recursive

  curl -sSL ${PATCH_URL}/seastar.diff | patch -d seastar -p1 || echo "Error"
  curl -sSL ${PATCH_URL}/scylla.diff | patch -p1 || echo "Error"
6.2.1) Apply RHEL7 specific Patch for RHEL 7 distribution
  curl -sSL ${PATCH_URL}/rhel7.diff | patch -d seastar -p1 || echo "Error"

6.3) Configure and compile ScyllaDB

The following commands will build a release binary that is optimized for, and will only run, on the specified TARGET:

  export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PREFIX/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}
  export PATH=$PATH:~/.local/bin/:~/.cargo/bin

  #Fix warning about deprecated boost/function_output_iterator.hpp (Optional)
  sudo sed -i 's/boost\/function_output_iterator\.hpp/boost\/iterator\/function_output_iterator\.hpp/g' \
    $PREFIX/include/boost/signals2/detail/null_output_iterator.hpp

  cflags="-I${PREFIX}/include -I${PREFIX}/include/boost"

  ./configure.py --mode="release" --target="${TARGET}" --debuginfo=1 \
    --cflags="${cflags}" --compiler="${CXX}" --c-compiler="${CC}"

  # clang14 failed on Ubuntu22 and RHEL 8.6 for this file!
  sed -i -E 's/(build \$builddir\/release\/service\/raft\/group0_state_machine\.o.+)/\1\n   optimize = -O0/g' ./build.ninja
  sed -i -E 's/(build \$builddir\/release\/service\/raft\/raft_server_test\.o.+)/\1\n   optimize = -O0/g' ./build.ninja

  ninja build -j 8

Increase the request capacity in /proc/sys/fs/aio-max-nr for setting up Async I/O (only on Ubuntu 20.04 and Ubuntu 22.04):

echo "fs.aio-max-nr = 1048576" |& sudo tee /etc/sysctl.conf
sudo sysctl -p

Step 7. Test ScyllaDB

Once ScyllaDB has been built you can run the tests. By default the tests will not contain debug information. To enable debug information add --tests-debuginfo 1 to the configure.py parameters above. This will make the build significantly larger (10s of gigabytes).

  cd "$SOURCE_ROOT/scylla"
  ./test.py --mode release

Note:

  • Some testcases related to topology, cql-pytest, and raft components may fail in the first attempt but are successfull upon reruns.
  • As per this PR, scylla-gdb testcase is only supported on x86 architecture therefore its behaviour on s390x is undefined.

Step 8. Performance Tuning

The performance tuning scripts that ship with ScyllaDB don't fully support LinuxONE at this stage. To maximize performance receive packet steering (RPS) should be enabled on network adapters.

Step 9. Run ScyllaDB

The scylla binary can be found at /<source_root>/scylla/build/release/scylla.

$SOURCE_ROOT/scylla/build/release/scylla --help

For more information on how to run and test ScyllaDB see the links below.

References

⚠️ **GitHub.com Fallback** ⚠️