Skip to content

Building RethinkDB

aborkar-ibm edited this page Sep 19, 2017 · 24 revisions

Building RethinkDB

RethinkDB is the open-source, scalable database that makes building realtime apps dramatically easier. The development version(pre 2.4) of RethinkDB has been built and tested on Linux on z Systems. The following instructions can be used for RHEL 7.3, SLES 12 SP2 and Ubuntu 16.04.

General Note:

  • 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

Step 1: Install the Dependencies

  • RHEL 7.3
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++ npm ncurses-devel which make ncurses-static zlib-devel zlib-static protobuf protobuf-compiler protobuf-devel
  • SLES 12 SP2
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-lite9 libprotobuf9 boost-devel termcap curl libcurl-devel
  • Ubuntu 16.04
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

Step 2: Clone and build RethinkDB

cd /<source root>/
git clone https://github.com/linux-on-ibm-z/rethinkdb.git --branch next-s390x
cd rethinkdb/
  • Make the following changes in mk/support/pkg/jemalloc.sh
@@ -1,7 +1,7 @@

 version=4.1.0

-src_url=http://www.canonware.com/download/jemalloc/jemalloc-$version.tar.bz2
+src_url=https://github.com/jemalloc/jemalloc/releases/download/4.1.0/jemalloc-4.1.0.tar.bz2
 src_url_sha1=450a2f0331cd4544140bb3be5d6e11cc82383cdf

 pkg_install () {
  • Make the following change in /mk/support/pkg/v8.sh
@@ -62,9 +62,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"
@@ -154,7 +155,7 @@ pkg_install () {
 pkg_link-flags () {
     # These are the necessary libraries recommended by the docs:
     # https://developers.google.com/v8/get_started#hello
-    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
./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.

Execute Integration Tests

cd /<source root>/rethinkdb
./test/run -j 4

Note: There is a known failure when running test cases of type FAIL regression.known_failures_1774. This can be safely ignored.

Reference

https://www.rethinkdb.com/

Clone this wiki locally