Skip to content

Building RethinkDB

aborkar-ibm edited this page Feb 4, 2020 · 23 revisions

Building RethinkDB

The instructions specify the steps to build RethinkDB version v2.4.0 on Linux on IBM Z for following distributions:

  • RHEL (7.5, 7.6, 7.7, 8.0)
  • SLES (12 SP4, 15 SP1)
  • Ubuntu (16.04, 18.04, 19.10)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

Building and Installing RethinkDB

export SOURCE_ROOT=/<source_root>/

Step 1: Install the Dependencies

  • RHEL (7.5, 7.6, 7.7)
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y python openssl-devel libcurl-devel wget tar m4 git-core boost-static m4 gcc-c++  ncurses-devel which make ncurses-static zlib-devel zlib-static protobuf protobuf-compiler protobuf-devel
  • RHEL 8.0
sudo yum groupinstall -y 'Development Tools'
sudo yum install -y python2 openssl-devel libcurl-devel wget tar m4 git-core boost gcc-c++  ncurses-devel which make ncurses zlib-devel zlib procps
sudo ln -s /usr/bin/python2 /usr/bin/python
  • SLES 12 SP4
sudo zypper update -y
sudo zypper install  gcc gcc-c++ make libopenssl-devel zlib-devel wget tar patch curl unzip autoconf automake libtool python python-xml python-curses libicu-devel protobuf-devel libprotobuf-lite9 libprotobuf9 boost-devel termcap curl libcurl-devel git awk 
  • SLES 15 SP1
sudo zypper update -y
sudo zypper install -y gcc gcc-c++ make libopenssl-devel zlib-devel wget tar patch curl unzip autoconf automake libtool python python-xml python-curses libicu-devel protobuf-devel libprotobuf-lite15 libprotobuf15 boost-devel termcap curl libcurl-devel git bzip2 awk
  • Ubuntu (16.04, 18.04, 19.10)
sudo apt-get update
sudo apt-get install -y build-essential protobuf-compiler python libprotobuf-dev libcurl4-openssl-dev libboost-all-dev libncurses5-dev libjemalloc-dev wget m4 libssl-dev git
  • Install Node v6.11.0 (RHEL 8.0, SLES 15 SP1, Ubuntu 18.04 & 19.10)
cd $SOURCE_ROOT
wget https://nodejs.org/dist/v6.11.0/node-v6.11.0-linux-s390x.tar.gz
tar xvf node-v6.11.0-linux-s390x.tar.gz
export PATH=$SOURCE_ROOT/node-v6.11.0-linux-s390x/bin:$PATH
  • Build and install Protobuf v3.0.0 (for RHEL 8.0)

    Follow the build instruction to build and install Protobuf 3.0.0

Step 2: Clone and build RethinkDB

cd $SOURCE_ROOT
git clone https://github.com/rethinkdb/rethinkdb
cd rethinkdb
git checkout v2.4.0
  • Make the following change in mk/support/pkg/v8.sh (for RHEL, SLES, Ubuntu)
@@ -64,9 +64,10 @@ pkg_install-include () {
         # for s390x we need to generate correct header files
         cd $build_dir
         export PATH=$(pwd)/depot_tools:$PATH
+        export CXXFLAGS="-fno-delete-null-pointer-checks"
         #cd v8z
-        make dependencies
-        make s390x -j4 library=static
+        make dependencies || true
+        make s390x -j4 werror=no snapshot=off library=static

         #s390x cp -RL "$src_dir/include/." "$install_dir/include"
         cp -RL "$build_dir/include/." "$install_dir/include"
@@ -168,7 +169,7 @@ pkg_link-flags () {
     # These are the necessary libraries recommended by the docs:
     # https://developers.google.com/v8/get_started#hello
      if [[ "$ARCH" != "ppc64le" ]]; then
-        for lib in libv8_{base,libbase,snapshot,libplatform}; do
+         for lib in libv8_{base,libbase,nosnapshot,libplatform}; do
              echo "$install_dir/lib/$lib.a"
         done
         for lib in libicu{i18n,uc,data}; do
  • Make the following change in mk/support/pkg/v8.sh (RHEL 8.0 & 7.x)
@@ -60,13 +60,14 @@ pkg_install-include () {
     rm -rf "$install_dir/include"
     mkdir -p "$install_dir/include"

-    if [[ "$($CXX -dumpmachine)" = "s390x-linux-gnu" ]]; then
+    if [[ "$($CXX -dumpmachine)" = "s390x-redhat-linux" ]]; then
         # for s390x we need to generate correct header files
         cd $build_dir
  • Make the following change in mk/support/pkg/v8.sh (SLES 12 SP4 & 15 SP1)
@@ -60,13 +60,14 @@ pkg_install-include () {
     rm -rf "$install_dir/include"
     mkdir -p "$install_dir/include"

-    if [[ "$($CXX -dumpmachine)" = "s390x-linux-gnu" ]]; then
+    if [[ "$($CXX -dumpmachine)" = "s390x-suse-linux" ]]; then
         # for s390x we need to generate correct header files
         cd $build_dir
  • Build
./configure --allow-fetch
make -j 4

Note: make -j 4 will execute up to 4 build tasks in parallel. This number may be increased or decreased as necessary to match the resources available on the machine.

Step 3: Install RethinkDB

sudo make install

Step 4: Start RethinkDB server

rethinkdb --bind all

(Optional) Testing RethinkDB

Execute Unit Tests

cd $SOURCE_ROOT/rethinkdb
make -j 4 DEBUG=1
./test/run unit -j 4

Note: ./test/run unit -j 4 will execute up to 4 unit tests in parallel. This number may be increased or decreased to match the resources available on the machine. A test case:UtilsTest may be failed if the local Time Zone is not defined.

Execute Integration Tests

cd $SOURCE_ROOT/rethinkdb
./test/run -j 4

Note: 2 cases: regression.known_failures_1774 and cpplint.cpplint are known failed cases that are also found on x86_64 platform. They can be safely ignored.

Reference

https://www.rethinkdb.com/

Clone this wiki locally