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
- see https://www.softwarecollections.org/en/scls/rhscl/devtoolset-3/
install like this:
sudo yum install centos-release-scl (on readhat: sudo yum-config-manager --enable rhel-server-rhscl-7-rpms) sudo yum install devtoolset-3-gcc* scl enable devtoolset-3 bash
if compilation with asan is desired:
sudo yum install devtoolset-3-libasan-devel
devtoolset-4: gcc 5.3.1
install like this:
sudo yum install centos-release-scl (on readhat: sudo yum-config-manager --enable rhel-server-rhscl-7-rpms) sudo yum install devtoolset-4-gcc* scl enable devtoolset-4 bash
if compilation with asan is desired:
sudo yum install devtoolset-4-libasan-devel
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.
get http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz
curl -L http://ftp.gnu.org/gnu/bison/bison-3.0.4.tar.gz > bison-3.0.4.tar.gz tar xvf bison-3.0.4.tar.gz
compile and install as indicated in INSTALL.md
./configure make sudo make install
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:
update-alternatives:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
environment variables:
export CC=/usr/bin/gcc-4.9 export CXX=/usr/bin/g++-4.9
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.
If git is not installed on the system:
sudo apt-get install git
If make is not installed on the system:
sudo apt-get install make
Get the cmake source:
git clone https://cmake.org/cmake.git
If you want a version that is not the latest version:
look at the tags:
git tag
and set the version:
git checkout <tag>
Compile as indicated in the README file, currently:
./bootstrap && make sudo make install
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