Building Enduro/X On GNU/Linux Platform

Madars Vitolins

Revision History
Revision 1.02015-11MV
Initial draft

Table of Contents

1. About manual
2. Configuring Linux Kernel parameters
2.1. Security Configuration
2.2. Message Queue Configuration
3. Getting the source & building
3.1. OS dependency installation
3.1.1. System level dependencies - for Gentoo Linux
3.1.2. System level dependencies - for Debian 8.2
3.1.3. System level dependencies - for Ubuntu 14.04
3.1.4. System level dependencies - for Ubuntu 16.04 (Mint 18)
3.1.5. System level dependencies - for Centos 6.x
3.1.6. System level dependencies - for Centos/RHEL/Oracle Linux 7.x
3.1.7. AsciiDoc Integration with Dia
3.2. Getting the Source code
3.3. Enduro/X basic Environment configuration for HOME directory
3.4. Building the code
4. Unit Testing
4.1. UBF/FML Unit testing
4.2. XATMI Unit testing
5. Conclusions
Additional documentation

Chapter 1. About manual

This manual describes how to build Enduro/X on fresh installed Ubuntu 14.04 and Centos 6.x. Process includes description of kernel configuration, required package installation and finally finishing all with unit test completion.

This installation manual assumes that OS user for installation is user1, located at /home/user1. The Enduro/X system will build at path /home/user1/endurox.

Chapter 2. Configuring Linux Kernel parameters

Kernel parameter configuration is needed for Enduro/X runtime. But as we plan here to build the system and run unit-tests, then we need a configuration for runtime.

2.1. Security Configuration

$ sudo -s
# cat << EOF >> /etc/security/limits.conf

# Do not limit message Q Count.
# Some Linux 3.x series kernels have a bug, that limits 1024
# queues for one system user.
# In 2.6.x and 4.x this is fixed, to have
# unlimited count of queues (memory limit).
# ealrier and later Linuxes have fixed this issue.
*               soft    msgqueue        -1
*               hard    msgqueue        -1

# Increase the number of open files
*               soft    nofile  1024
*               hard    nofile  65536

EOF
# exit
$

2.2. Message Queue Configuration

At the startup of the system needs to mount a Posix Queues folder, and needs to set a appropriate limits. To do this automatically at system startup, Linuxes which supports /etc/rc.local, must add following lines before "exit 0":

# Mount the /dev/mqueue
# Not for Debian 8.x: queue is readly mounted, thus test:

if [ ! -d /dev/mqueue ]; then
        mkdir /dev/mqueue
        mount -t mqueue none /dev/mqueue
fi

# Max Messages in Queue
echo 10000 > /proc/sys/fs/mqueue/msg_max

# Max message size (Currently Enduro/X supports only 32K as max)
echo 64000 > /proc/sys/fs/mqueue/msgsize_max

# Max number of queues for user
echo 10000 > /proc/sys/fs/mqueue/queues_max

Note for Centos/RHEL/Oracle Linux 7 you need to give execute permissions for rc.local:

# chmod +x /etc/rc.local

Chapter 3. Getting the source & building

3.1. OS dependency installation

3.1.1. System level dependencies - for Gentoo Linux

$ su - root
# emerge sync
# emerge -av indent asciidoc dblatex libxml2 cmake dia \
        flex bison zlib openssl app-crypt/gpgme dev-vcs/git

3.1.2. System level dependencies - for Debian 8.2

The same goes on Raspbian (Raspberry Pi OS)

$ sudo apt-get update
$ sudo apt-get install indent asciidoc dblatex libxml2-dev \
        cmake dia flex bison gcc g++ zlib1g-dev \
        libssl-dev libcrypto++9 libcrypto++-dev \
        libgpgme11-dev libxml2-dev git

3.1.3. System level dependencies - for Ubuntu 14.04

$ sudo apt-get update
$ sudo apt-get install indent asciidoc dblatex libxml2-dev \
        cmake dia flex bison gcc g++ zlib1g-dev \
        libssl-dev libcrypto++9 libcrypto++-dev \
        libgpgme11-dev libxml2-dev git

3.1.4. System level dependencies - for Ubuntu 16.04 (Mint 18)

$ sudo apt-get update
$ sudo apt-get install indent asciidoc dblatex libxml2-dev \
        cmake dia flex bison gcc g++ zlib1g-dev \
        libssl-dev libcrypto++-dev \
        libgpgme11-dev libxml2-dev libxml2-utils git

3.1.5. System level dependencies - for Centos 6.x

As some packages like ‘dia’ does not exists in base Centos install, then few of them we will borrow from Fedora project via epel-release. Which should be installed in following way: Download the latest epel-release rpm from (e.g. epel-release-6-8.noarch.rpm or later) http://dl.fedoraproject.org/pub/epel/6/x86_64/ Install epel-release rpm:

$ su - root
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -Uvh epel-release*rpm

Now install system depenencies

# yum update
# yum groupinstall 'Development Tools'
# yum install git cmake asciidoc \
        openssl openssl-devel \
        gpgme-devel dia libxml2-devel
# exit
$

3.1.6. System level dependencies - for Centos/RHEL/Oracle Linux 7.x

Now install system depenencies

But if you run build on Oracle Linux, you need to enable optional repo for asciidoc/gpgme-devel/dblatex

# yum install yum-utils
# yum-config-manager --enable ol7_optional_latest
# yum groupinstall 'Development Tools'
# yum install git cmake asciidoc openssl openssl-devel \
        gpgme-devel redhat-lsb dblatex libxml2-devel

Centos 7 does not ship with ‘dia’ package. Thus we will install Fodra Core package: dia-0.97.2-5.fc19.x86_64.rpm. Also we need to install additional deps to run dia.

# yum install -y cairo-gobject-devel gtk2 gtk2-devel gdk-pixbuf2-devel \
                libglade2-devel libgnomeui.x86_64 wget libgnomeui
# wget http://ftp.scientificlinux.org/linux/fedora/releases/19/Fedora/x86_64/os/Packages/d/dia-0.97.2-5.fc19.x86_64.rpm
# rpm -i --nodeps dia-0.97.2-5.fc19.x86_64.rpm

Seems that RHEL/Centos/Oracle Linux 7 ship with old CMake package which generates defective RPMs. Thus it The installation might give you following errors

$ sudo rpm -i *.rpm
        file /usr/share/man from install of endurox-3.5.1-1.x86_64 conflicts with file from package filesystem-3.2-21.el7.x86_64
        file /usr/share/man/man3 from install of endurox-3.5.1-1.x86_64 conflicts with file from package filesystem-3.2-21.el7.x86_64
        file /usr/share/man/man5 from install of endurox-3.5.1-1.x86_64 conflicts with file from package filesystem-3.2-21.el7.x86_64
        file /usr/share/man/man8 from install of endurox-3.5.1-1.x86_64 conflicts with file from package filesystem-3.2-21.el7.x86_64

$ cmake --version
cmake version 2.8.12.2

Install new CMake from sources:

$ su - root
# yum remove cmake
# exit
$ cd
$ wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz
$ tar -xzf cmake-3.7.2.tar.gz
$ cd cmake-3.7.2
$ ./configure
$ make
$ su - root
# make install
# cmake --version
cmake version 3.7.2

CMake suite maintained and supported by Kitware (kitware.com/cmake).

3.1.7. AsciiDoc Integration with Dia

Also Enduro/X includes documentation in sources, thus additional config is needed so that Dia package can build illustrations needed for manuals.

$ sudo mkdir /etc/asciidoc/filters/dia
$ sudo -s
# cat << EOF > /etc/asciidoc/filters/dia/dia-filter.conf
#
# AsciiDoc Dia filter configuration file.
#
# Version: 0.1

[blockdef-listing]
dia-style=template="dia-block",subs=(),posattrs=("style","file","target","size"),filter='dia -t png -e "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" "{outdir}/{file}" {size?-s {size}} > /dev/null'

[dia-block]
template::[image-blockmacro]
EOF

3.2. Getting the Source code

# useradd -m user1
# su - user1
$ cd /home/user1
$ git clone https://github.com/endurox-dev/endurox endurox

3.3. Enduro/X basic Environment configuration for HOME directory

This code bellow creates ndrx_home executable file which loads basic environment, so that you can use sample configuration provided by Enduro/X in sampleconfig directory. This also assumes that you are going to install to $HOME/endurox/dist folder.

$ cat << EOF > $HOME/ndrx_home
#!/bin/bash

# Where app domain lives
export NDRX_APPHOME=$HOME/endurox
# Where NDRX runtime lives
export NDRX_HOME=$HOME/endurox/dist/bin
# Debug config too
export NDRX_DEBUG_CONF=$HOME/endurox/sampleconfig/debug.conf

# NDRX config too.
export NDRX_CONFIG=$HOME/endurox/sampleconfig/ndrxconfig.xml

# Access for binaries
export PATH=$PATH:$HOME/endurox/dist/bin

# LIBPATH for .so
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/endurox/dist/lib:$HOME/endurox/dist/lib64

# UBF/FML field tables
export FLDTBLDIR=$HOME/endurox/ubftest/ubftab

EOF

$ chmod +x $HOME/ndrx_home

Note

If you develop in Gnome (e.g. Mate) session, then do ‘export DESKTOP_SESSION=gnome’ before run IDE (e.g. NetBeans).

3.4. Building the code

$ cd /home/user1/endurox
# If you want to have install folder to /home/user1/endurox/dist
# if you want system level install then run just $ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/dist .
$ make
$ make install

Chapter 4. Unit Testing

Enduro/X basically consists of two parts: . XATMI runtime; . UBF/FML buffer processing. Each of these two sub-systems have own units tests.

4.1. UBF/FML Unit testing

$ cd /home/user1/endurox/ubftest
$ ./ubfunit1 2>/dev/null
Running "main"...
Completed "main": 5751 passes, 0 failures, 0 exceptions.

4.2. XATMI Unit testing

ATMI testing might take some time. Also ensure that you have few Gigabytes of free disk space, as logging requires some space. To run the ATMI tests do following:

$ cd /home/user1/endurox/atmitest
$ nohup ./run.sh &
$ tail -f /home/user1/endurox/atmitest/test.out
...
Setting domain 2
Server executable = tpbridge    Id = 101 :      Shutdown succeeded.
Server executable = convsv21    Id = 50 :       Shutdown succeeded.
Server executable = atmi.sv21   Id = 30 :       Shutdown succeeded.
Server executable = tmsrv       Id = 10 :       Shutdown succeeded.
Shutdown finished. 4 processes stopped.
atmiclt21: no process found
************ FINISHED TEST: [test021_xafull/run.sh] with 0 ************
Running "main"...
Running "main"...
Completed "main": 21 passes, 0 failures, 0 exceptions.

Chapter 5. Conclusions

At finish you have a configured system which is read to process the transactions by Enduro/X runtime. It is possible to copy the binary version (dist) folder to other same architecture machine and run it there with out need of building. This process is described in [BINARY_INSTALL] guide.

Additional documentation

This section lists additional related documents.

Resources

[BINARY_INSTALL] See Enduro/X binary_install manual.