Skip to content
/ Vire Public

C++ library for the description and management of an experimental setup

License

Notifications You must be signed in to change notification settings

BxCppDev/Vire

Repository files navigation

Vire

C++ library for the description and management of an experimental setup

This README file is in progress

Warning: Do not even dare to dream to hope to use Vire now! It is still in intensive development phase and not ready for production or testing, even for fun!

Introduction

This is the Vire C++ software suite.

Vire ([vir]) stands for (Vir)tual (E)xperiment. It consists in a C++ library and some helper applications to model the components/devices (mechanics, electronic devices, cables...) that compose an experimental setup, typically for physics experiment. Vire is inspired by some other software architectures like the ones used in SystemC, Geant4/GDML and Bayeux.

The purpose of Vire is to provide basic tools to:

  • Describe an experimental setup, its architecture and hierarchy, components and connections (cable, pipe, abstract links) between components,
  • Define an addressing scheme for all (or parts of) the components in the system: devices, channels, cables, registers, configuration parameters and measurement data points, control and monitoring actions...
  • Define/generate cabling tables,
  • Build helper tools for setup management, simulation, data analysis...
  • Implement a real time control and monitoring system with:
    • Support for users, groups of users, roles and resources management,
    • Device configuration and system parametrization,
    • Build online control and monitoring applications (Command and control),

Vire team

The Vire design and development team is hosted at the Laboratoire de Physique Corpusculaire de Caen (LPC Caen, Normandie Univ, ENSICAEN, UNICAEN, CNRS/IN2P3):

The Vire/MOS and Vire/CMSLAPPInterface plugins are developped in collaboration with the authors of the Multipurpose OPCUA Server control and monitoring software at Laboratoire d'Annecy le Vieux de Physique des Particules (LAPP, CNRS/IN2P3, Université Savoie Mont Blanc) in the framework of the SuperNEMO double beta decay experiment.

License

Vire is free software, released under the GNU GENERAL PUBLIC LICENSE 3.0. See the LICENSE.txt file distributed together with the source code.

Prerequisites and dependencies

Vire supports Ubuntu Linux 16.04/18.04 system (x86_64), which is our main development system. Support for more flavors of Linux will come later (i.e. Scientific Linux 7.X).

Vire is built on top of the Bayeux library. We will assume you use the Linuxbrew management system to build and install dependee software. Some dependee may also be provided by the system (apt-get).

More, Vire depends on other third party software packages:

  • protobuf : Google Protocol Buffers (3.0)
  • librabbitmq-c : RabbitMQ C AMQP client library (version 0.8.0 with support for the AMQP protocol version 0.9.1)
  • BxProtobuftools : A C++ library which eases the use of the Google Protobuf Buffers serialization system for C++ classes (depends on protobuf).
  • BxJsontools : A C++ library which eases the serialization of C++ classes using JSON.
  • BxRabbitMQ : A C++ library which wraps parts of the librabbitmq C library (depends on librabbitmq-c and BxJsontools).
  • Java : OpenJDK Runtime Environment (version 1.8.0)

We warmly recommend to use Linuxbrew and the BxCppDev Linuxbrew tap to install Vire library's core dependencies.

Getting Vire

Vire is hosted at https://github.com/BxCppDev/Vire. From a directory of your choice, clone Vire source code and cd in the Vire source directory:

$ mkdir -p ${HOME}/Vire
$ cd ${HOME}/Vire # You can choose any suitable place to host the Vire repository
$ git clone https://github.com/BxCppDev/Vire Vire.git
$ cd Vire.git

The default branch is named develop. You way want to switch to the master stable branch before to build the Vire software:

$ git checkout master

Dependencies

WIP

List of required libraries and tools:

  • Build tools:
  • Third party libraries:
    • curlpp >= 0.8.1 (automatically installed from Linuxbrew)
    • rabbitmq-c >= 3.3.0 (automatically installed from Linuxbrew)
    • Java JDK (installed from the system)
  • BxCppDev software (installed from the https://github.col/BxCppDev/homebrew-bxtap Linuxbrew tap):
    • BxJsontools 0.1.0 (automatically installed from the Linuxbrew BxCppDev tap)
    • Protobuf 3.3.0 (automatically installed from the Linuxbrew BxCppDev tap)
    • BxProtobuftools 0.2.0 (installed from the Linuxbrew BxCppDev tap)
    • BxRabbitMQ 0.3.0 (installed from the Linuxbrew BxCppDev tap)
    • Bayeux >=3.2.0 (installed from the Linuxbrew BxCppDev tap)

Example of dependency installation for Ubuntu Linux 18.04:

$ sudo apt-get install libb64-dev libb64-0d
$ sudo apt-get install openjdk-11-jdk
$ brew tap bxcppdev/homebrew-bxtap
$ brew install bxcppdev/bxtap/bxrabbitmq --with-manager
$ brew install bxcppdev/bxtap/bxprotobuftools
$ brew install bxcppdev/bxtap/bayeux

Vire on Linuxbrew

WIP

No brew formula is provided yet for Vire from the bxcppdev/homebrew-bxtap.

Installation

Installation steps from the Vire develop source code:

  1. Setup Linuxbrew (visit https://github.com/BxCppDev/homebrew-bxtap/blob/master/README.md)
$ linuxbrew_setup
Your system PATH should be prefixed with the brew binary path, example:
$ echo $PATH
/path/to/Linuxbrew/installation/directory/bin:/some/other/directories/in/your/path...
You should also be able to guess the Linuxbrew installation directory through:
$ which clhep-config # check the brewed clhep-config is in your path.
...
$ clhep-config --prefix | tr -d '"' # check the CLHEP library installation path,
                                    # it should be the Linuxbrew prefix.
...
  1. Create a build directory for Vire and cd in it:
$ mkdir -m ${HOME}/Vire/_build.d
$ cd ${HOME}/Vire/_build.d
  1. Setup the Bayeux library with dedicated scripts:
$ [bayeux_setup] # your own setup function to activate a non-brewed Bayeux
$ which bxquery # check that bxquery is in your PATH
...
$ bxquery --prefix # check the Bayeux's installation path
...
Command between brackets is run only if Bayeux is not managed by Linuxbrew nor in your system path.
  1. Setup third party software:
$ [bxprotobuftools_setup] # your own setup function to activate a non-brewed bxprotobuftools.
$ [bxrabbitmq_setup] # your own setup function to activate a non-brewed bxrabbitmq.
$ bxprotobuftools-query --prefix # check BxProtobuftools installation path.
...
$ bxrabbitmq-query --prefix # check BxRabbitmq installation path.
...
  1. Configure:
$ cmake \
       -DCMAKE_BUILD_TYPE:STRING=Release \
       -DCMAKE_INSTALL_PREFIX:PATH=${HOME}/Vire/install-$(uname -s)-$(uname -m)-develop \
       -DCMAKE_FIND_ROOT_PATH:PATH="$(clhep-config --prefix | tr -d '"')" \
       -DVIRE_COMPILER_ERROR_ON_WARNING=ON \
       -DVIRE_CXX_STANDARD="11" \
       -DVIRE_ENABLE_TESTING=ON \
       -DVIRE_WITH_DOCS=ON \
       -DVIRE_WITH_DEVELOPER_TOOLS=ON \
       -DVIRE_WITH_PLUGINS=ON \
       -DVIRE_WITH_SANDBOX=OFF \
       -DVIRE_WITH_JAVA=ON \
       -DVIRE_WITH_PROTOBUF_JAVA=ON \
       -DBayeux_DIR:PATH="$(bxquery --cmakedir)" \
       -DBxRabbitMQ_DIR:PATH="$(bxrabbitmq-query --cmakedir)" \
       -DBxProtobuftools_DIR:PATH="$(bxprotobuftools-query --cmakedir)" \
       ${HOME}/Vire/Vire.git
  1. Build:
$ make -j4
  1. Run tests:
$ make test
  1. Install:
$ make install

Setup Vire in your environment

If you use a Bash environment, we recommend to create a function from your startup file ~/.bashrc :

function do_vire_develop_setup()
{
   # Some setup functions to activate dependees:
   # [linuxbrew_setup]
   # ...
   # [bxprotobuftools_setup]
   # [bxrabbitmq_setup]
   # [bayeux_setup]
   if [ -n "${VIRE_INSTALL_DIR}" ]; then
       echo "ERROR: Vire/develop is already setup ! Ignore!" >&2
       return 1
   fi
   export VIRE_INSTALL_DIR={Vire installation directory}
   export PATH=${VIRE_INSTALL_DIR}/bin:${PATH}
   echo "NOTICE: Vire/develop is now setup !" >&2
   return;
}
export -f do_vire_develop_setup
alias vire_dev_setup="do_vire_develop_setup"

where bxprotobuftools_setup, bxrabbitmq_setup and bayeux_setup are shell functions which setup the third party software packages not managed through Linuxbrew.

Then each time you want to use this version of Vire from a shell, type:

$ vire_dev_setup