NUstar ReaDout library - nurdlib

NUstar ReaDout library - nurdlib (yes, this is just a test version ("en näve salt..."))

Men and gentleladies, after countless attempts at generalizing the readout of data sampling modules commonly used in nuclear physics experiments, the NUSTAR group had enough and decided to develop a unified, fast, easily and safely configurable library for this purpose.

This, is nurdlib.

Purpose

The old and tried method of copying and pasting readout code for every module is error prone and time-consuming. The exact effect of some module settings and the interplay between several modules can at times be non-trivial, especially when more "exotic" readout modes are introduced. In order to circumvent this treacherous approach, but also to reduce the maintenance with the upcoming NDAQ infrastructure at FAIR, nurdlib has been designed from the ground up as unit tested configure-driven library implementing the most common readout modes for many modules that are used by NUSTAR experiments, and other parties who have presented an interest.

Features

Below the most amazing features are listed:

And next comes the spectacular list of modules currently supported and tested:

Building and using

The short version for a debug build:

$ hg clone https://bitbucket.org/hanstt/htools
$ make -C htools
$ export HTOOLS_PATH=`pwd`/htools
$ git clone <url to nurdlib>
$ cd nurdlib
$ export NURDLIB_DEF_PATH=`pwd`/cfg/default
$ make

The short version for testing:

make test

The short version for testing coverage:
nurdlib must first be built in the gcov build mode:

$ make BUILD_MODE=gcov test
$ make BUILD_MODE=gcov gcov
$ make BUILD_MODE=gcov gcov_files
$ make BUILD_MODE=gcov gcov_funcs

The short version for a release build:

$ make BUILD_MODE=release

The short version for running a tool:

$ ./bin/rwdump -a 0x02000000 -r 32

The long version:
The nurdlib build system is based on non-recursive GNU makefiles and makes extensive use of the htools library. All generated files are placed inside nurdlib in a directory of the form:

build_<gcc machine>_<gcc version>_<build mode>/
including the static library libnurdlib.a. Link your DAQ binary with this library and you're done. Note that the somewhat complicated build directory name eliminates all collisions between several builds across platforms and build modes.

Coverage analysis of testing is done with gcov. All code involved in building and linking the tested code needs to be built with special GCC flags which makes the binaries very slow. htools/htest will properly flush gcov results htools/hgmake will provide nurdlib with the necessary compilation and linking flags. nurdlib also has three coverage specific build targets to report the results after the test target has been invoked at least once:

Development status

We believe in community support and openness when developing this library, and therefore publish an updated development status regularly right here!

People involved

Haik Simon, Håkan T. Johansson, Alexandre Charpy, Bastian Löher, Michael Munch, Hans Törnqvist.