Skip to content

Building Kong on s390x

Carole Corley edited this page Oct 21, 2020 · 25 revisions

Building Kong on s390x

The instructions provided below specify the steps to build Kong version 2.1.4 and 'next' on Linux on IBM Z for the following distributions:

Ubuntu (18.04)

General Note: When following the steps below you will need root access, so you will likely need to sudo su.

Step 1 : Building Kong

Adapting the example below


1.1) Build using script If you'd like to build CouchDB using the manual steps, please go to STEP 1.2.

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

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/CouchDB/3.1.0/build_couchdb.sh

Build CouchDB

bash build_couchdb.sh [Provide -t option for executing build with tests] If the build completes successfully, go to STEP 2.2. In case of any errors, check logs for more details or go to STEP 1.2 to follow the manual build steps.

1.2) Install dependencies export SOURCE_ROOT=/<source_root> RHEL (7.6, 7.7, 7.8)

sudo yum install -y libicu-devel libcurl-devel wget tar m4 pkgconfig make libtool which gcc-c++ gcc openssl openssl-devel patch js-devel java-1.8.0-openjdk-devel perl-devel gettext-devel unixODBC-devel fop bzip2-devel gdbm-devel libdb-devel libffi-devel libuuid-devel ncurses-devel readline-devel sqlite-devel tk-devel xz xz-devel zlib-devel RHEL 8.1

sudo yum install -y autoconf flex flex-devel gawk gzip hostname libxml2-devel libxslt libicu-devel libcurl-devel wget tar m4 pkgconfig make libtool which gcc-c++ gcc openssl openssl-devel patch mozjs60-devel java-1.8.0-openjdk-devel perl-devel gettext-devel unixODBC-devel python36-devel git ncurses-devel glibc-common Note:

Make sure to install at least mozjs60-devel-60.9.0-4 otherwise some of the tests will fail due to some bugs on s390x in earlier releases. RHEL 8.2

sudo yum install -y autoconf flex flex-devel gawk gzip hostname libxml2-devel libxslt libicu-devel libcurl-devel wget tar m4 pkgconfig make libtool which gcc-c++ gcc openssl openssl-devel patch mozjs60-devel java-1.8.0-openjdk-devel perl-devel gettext-devel unixODBC-devel python38 python38-devel git ncurses-devel glibc-common Note:

Make sure to install at least mozjs60-devel-60.9.0-4 otherwise some of the tests will fail due to some bugs on s390x in earlier releases. Ubuntu 18.04

sudo apt-get update sudo apt-get install -y build-essential pkg-config ncurses-base g++-5 gcc-5 python python3 python3-pip python3-venv curl git patch wget tar make zip autoconf2.13 automake libicu-dev libcurl4-openssl-dev libncurses5-dev locales libncurses-dev libssl-dev unixodbc-dev libwxgtk3.0-dev openjdk-8-jdk xsltproc fop libxml2-utils

sudo rm -rf /usr/bin/gcc /usr/bin/g++ /usr/bin/cc sudo ln -s /usr/bin/gcc-5 /usr/bin/gcc sudo ln -s /usr/bin/g++-5 /usr/bin/g++ sudo ln -s /usr/bin/gcc /usr/bin/cc Ubuntu 20.04

sudo apt-get update sudo apt-get install -y build-essential pkg-config ncurses-base g++ gcc python python3 python3-pip python3-venv curl git patch wget tar make zip libicu-dev libcurl4-openssl-dev libncurses5-dev locales libncurses-dev libssl-dev unixodbc-dev libwxgtk3.0-gtk3-dev openjdk-8-jdk xsltproc fop libxml2-utils libmozjs-68-dev 1.3) Install git 2.16.0 (Only for RHEL 7.x) cd $SOURCE_ROOT wget https://github.com/git/git/archive/v2.16.0.tar.gz tar -zxf v2.16.0.tar.gz cd git-2.16.0 make configure ./configure --prefix=/usr make sudo make install 1.4) Install python 3.8 (Only for RHEL 7.X) wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz tar -xzf Python-3.8.2.tgz cd Python-3.8.2 ./configure --prefix=/usr --exec-prefix=/usr make sudo make install 1.5) Install needed python packages sudo pip3 install --upgrade sphinx sphinx_rtd_theme nose requests hypothesis virtualenv 1.6) Install Erlang cd $SOURCE_ROOT wget http://www.erlang.org/download/otp_src_22.2.tar.gz tar zxf otp_src_22.2.tar.gz cd otp_src_22.2 export ERL_TOP=$SOURCE_ROOT/otp_src_22.2 ./configure --prefix=/usr make sudo make install 1.7) Install elixir cd $SOURCE_ROOT git clone https://github.com/elixir-lang/elixir.git cd elixir git checkout v1.10.2 export LANG=en_US.UTF-8 sudo locale-gen en_US.UTF-8 # for Ubuntu make sudo make install elixir -v 1.8) Install node and npm cd $SOURCE_ROOT sudo mkdir -p /usr/local/lib/nodejs wget https://nodejs.org/dist/v14.2.0/node-v14.2.0-linux-s390x.tar.gz sudo tar xzvf node-v14.2.0-linux-s390x.tar.gz -C /usr/local/lib/nodejs sudo ln -s /usr/local/lib/nodejs/node-v14.2.0-linux-s390x/bin/* /usr/bin/ node -v npm -v 1.9) Install SpiderMonkey 1.8.5 from source (Only for Ubuntu 18.04) Get the source, extract it, and patch with needed changes.

cd $SOURCE_ROOT wget http://ftp.mozilla.org/pub/mozilla.org/js/js185-1.0.0.tar.gz tar zxf js185-1.0.0.tar.gz export PATCH_URL="https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/CouchDB/3.1.0/patch" curl -o jsval.h.diff $PATCH_URL/jsval.h.diff patch "$SOURCE_ROOT/js-1.8.5/js/src/jsval.h" jsval.h.diff curl -o jsvalue.h.diff $PATCH_URL/jsvalue.h.diff patch "$SOURCE_ROOT/js-1.8.5/js/src/jsvalue.h" jsvalue.h.diff curl -o Makefile.in.diff $PATCH_URL/Makefile.in.diff patch "$SOURCE_ROOT/js-1.8.5/js/src/Makefile.in" Makefile.in.diff
Prepare the source code

cd $SOURCE_ROOT/js-1.8.5/js/src
autoconf2.13
Configure, build & install SpiderMonkey

mkdir $SOURCE_ROOT/js-1.8.5/js/src/build_OPT.OBJ cd $SOURCE_ROOT/js-1.8.5/js/src/build_OPT.OBJ ../configure --prefix=/usr make sudo make install 1.10) Download the CouchDB source code cd $SOURCE_ROOT git clone https://github.com/apache/couchdb.git cd couchdb git checkout 3.1.0 1.11) build CouchDB cd $SOURCE_ROOT/couchdb export LD_LIBRARY_PATH=/usr/lib Ubuntu 20.04

./configure --dev --spidermonkey-version 68 make RHEL (8.1, 8.2)

./configure --dev --spidermonkey-version 60 make Everything else

./configure --dev make Notes:

--dev is equivalent to -c --disable-docs --disable-fauxton If a release build is wanted instead of a dev one, remove --dev from configure and use make release instead of make. Step 2: Testing (Optional) 2.1) Run all test cases Reconfigure for testing. Make sure to append the correct spidermonkey version flag as well if needed. cd $SOURCE_ROOT/couchdb ./configure -c make check |& tee couchdb_test_results.log 2.2) Start the CouchDB server $SOURCE_ROOT/couchdb/dev/run & Note: In case of an error /usr/bin/env: python3: No such file or directory on RHEL run command as sudo env PATH=$PATH $SOURCE_ROOT/couchdb/dev/run &

2.3) Make sure it's up and running Verify that the server is up and running by using the curl http://127.0.0.1:15984/ command. The output should be similar to the following: {"couchdb":"Welcome","version":"3.1.0","git_sha":"ff0feea","uuid":"fake_uuid_for_dev","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}} References: CouchDB 3.1.0 Documentation

Clone this wiki locally