Install

Overview

ztsdb uses system calls that are specific to Linux and will not run on non-Linux platforms. It also requires a 64-bit OS.

In order to compile, ztsdb relies on a set of tools and libraries. We give below in the prerequisites section the step-by-step instructions for the installation of these tools and libraries for CentOS 7, Ubuntu 14.04 and Ubuntu 16.04. We expect it to compile and run on other flavours of Linux too and the installation should be similar.

Prerequisites

Installation of tools and libraries needed by ztsdb.

CentOS 7

boost

sudo yum install boost-filesystem-dev

flex

sudo yum install flex

C++ compiler

gcc 4.9 or higher is needed; for this we can choose from the following alternatives.

devtoolset-3: gcc 4.9.2

devtoolset-4: gcc 5.3.1

cmake

cmake >= 3.1 is needed.

    sudo yum install cmake3
    sudo ln -s /usr/bin/cmake3 /usr/local/bin/cmake 

bison

We need version >= 3.0.2, so it needs to be installed manually.

gengetopt

GNU command line option parsing tool.

sudo yum -y install epel-release
sudo yum repolist
sudo yum install gengetopt

double-conversion

Efficient conversion routines binary-decimal and decimal-binary for IEEE doubles.

sudo yum install double-conversion-devel

Ubuntu 14.04

boost

sudo apt-get install libboost-filesystem-dev

flex

sudo apt-get install flex

bison

sudo apt-get install bison

compiler

ztsdb is tested with both gcc and Clang. gcc version must be >= 4.9, while clang version must be >= 3.6. We show here how to install gcc:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update

sudo apt-get install gcc-4.9 g++-4.9 cpp-4.9

To get cmake to pick up the correct compiler version (wheter gcc or clang), one can use one of the following methods:

timezone info

A standard installation will install the time zone data, but if not (for instances in minimal installs), it must be installed:

sudo apt-get install tzdata

cmake

cmake >= 3.1 is needed.

double-conversion

Efficient binary-decimal and decimal-binary conversion routines for IEEE doubles.

sudo apt-get install libdouble-conversion-dev

getgetopt

GNU command line option parsing tool.

sudo apt-get install gengetopt

Ubuntu 16.04, 18.04, 20.04

The main difference with 14.04 is that the default gcc or clang have by default a high enough version to compile ztsdb.

basic packages

sudo apt install libboost-filesystem-dev cmake flex bison libdouble-conversion-dev gengetopt

timezone info

A standard installation will install the time zone data, but if it is not (for instances in minimal installs), it must be installed in order for ztsdb to run (otherwise ztsdb will fail with the error message "time zone initialization error: can't find directory /usr/share/zoneinfo/"):

sudo apt-get install tzdata

Or it can be installed non-interactively like this:

DEBIAN_FRONTEND=noninteractive apt install -y tzdata

compiler

For gcc:

sudo apt install gcc g++

For clang:

sudo apt install clang

Compiling ztsdb

Get the ztsdb code from GitLab:

git clone https://gitlab.com/lsilvest/ztsdb.git

ztsdb uses cmake. It is recommended to not build inside the source directories. For example make a build directory in the root ztsdb directory and compile like this:

mkdir build
cd build
cmake ..
make ztsdb

Running the R unit tests

From the same build directory run:

make rtest

Installing

To install the ztsdb executable, the library and the header files on a system:

sudo make install

Make sure the libraries are picked up by running:

sudo ldconfig

By default the root installation directory is /user/local; one can specify an alternate path like this:

sudo make DESTDIR=/some/alternate/directory install