How to build the dSS

Get the source

Get the dSS release tarballs from the dss developer site. Packages for all dSS11 projects can be found on the dss download site.

If you like to work with the current development snapshot get the source via git as explained here. These development snapshots may have changed dependencies or build instructions or may even have functional limitations.

Dependencies

The dSS relies on some external libraries. To build it from source your system needs the following libraries and their development headers.

apt/rpm packages required

To get you started we've compiled detailed instructions on how to get started on the following platforms:

Building the dS485 Stack

On top of general dependencies we need to access the digitalSTROM devices, this is handled by the dSM-API libraries, which pulls in half a dozen of libraries.

https://git.digitalstrom.org/groups/ds485-stack
https://git.digitalstrom.org/dss-misc/libcommchannel

Instead of typing declaring these variables over and over again put them into a shell environment env.sh script, and always source that before configuring one of the libraries or running the dSS

export PREFIX=$HOME/dSS/sysroot

# pkg-config --list-all to find packages installed in $PREFIX
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig

# dsm-api-v2
export DSDATA_PATH=$PREFIX/share/digitalstrom
export PYTHONPATH=$PYTHONPATH:$PREFIX/lib/python2.7/dist-packages
export LUA_CPATH=$PREFIX/lib/lua/5.2/?.so # TODO pls fix

# find libraries installed in PREFIX, e.g. needed when running dss
export LD_LIBRARY_PATH=$PREFIX/lib
export PATH=$PATH:$PREFIX/bin

# MacOS X:
export DYLD_LIBRARY_PATH=$PREFIX/lib

Build libdsuid, ds485-core, ds485-netlib, ds485-client, libcommchannel (autoconf)

git clone <git://>
autoreconf -i # only needed after fresh checkout
source ../env.sh
./configure --prefix=$PREFIX
make -j8
make install

Run unit tests if avalaible

make check

Verify it installed

source env.sh
pkg-config --list-all | grep -e ds485 -e suid -e commchannel

digitalSTROM-Meter API dsm-api (cmake)

source ../env.sh
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX

To debug which paths were included, passing -DCMAKE_VERBOSE_MAKEFILE=true will prove useful. This causes the exact compiler calls to be shown.

make -j8
make install

Install tables with known digitalSTROM devices

To lookup capabilities based on dsuid (think dS mac address), dsm-api needs descriptions of known devices

git clone https://git.digitalstrom.org/ds485-stack/dsdata.git
source env.sh
make install

Compiling/install digitalSTROM Server (dss-mainline)

autoreconf -i
source ../env.sh
./configure --prefix=$PREFIX --with-search=$PREFIX
make -j8

Install dSS

Install at least once to create the common paths such as webroot, where the web-content will be installed.
Typically you will run the application out of the source folder.

make install

Frequently run the unit tests

./build/dsstests [-t unittest_moudule/unittest]

or more tests
make check

Advanced configuration

To see all options

./configure --help

Common Features

--enable-http           build with HTTP support (default: HTTPS only)
--disable-bonjour       build with bonjour support (default: enabled)

Out of tree build

If you want to use the same source tree to build x86 and arm versions the generated object files must be put into separate folders

mkdir build-x86
cd build-x86
../configure --prefix=$PREFIX --with-search=$PREFIX \
  --enable-debug \
  --enable-http \
  --enable-stack-protect \
  --enable-libtcmalloc \
  --disable-sendmail \
  --enable-insecure-cookie

Non-packaged standard libraries

Few software packages do not have an equivalent package, hence we need to install them locally. We follow the same procedures as we did building the digitalSTROM stack

RapidJSON

At the time of this writing, no major distribution includes rapidjson package, but this might have changed since then

http://pkgs.org/fedora-rawhide/fedora-i386/rapidjson-devel-0.12-0.1.git20140801.67143c2.fc22.noarch.rpm.html
https://packages.debian.org/sid/rapidjson-dev

clone rapidjson repository

Here installed under external/rapidjson

source ../../env.sh
cmake -DCMAKE_INSTALL_PREFIX=$PREFIX
make -j8
make install

librrd 1.5.6

Our wrapper for librrd needs legacy version. Newer versions have an API break. Download legacy version from

wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.5.6.tar.gz

Compile and install like env.sh above. Here installed under external/rrdtool-1.5.6

#!/bin/sh
. ../../env.sh
./configure --prefix=$PREFIX \
  --with-systemdsystemunitdir=${PREFIX}/lib/systemd/system/