Project

General

Profile

Building the artdaq code

For the beamline DAQ, we are just using the LArIAT DAQ, since this does all of what we require and is a stable system. This page will describe how to build a version of our code -- for details on lariat, see the instructions for building the LArIAT online code.

This will walk you through building the lariat-online-lariatfragments and lariat-online code, and setting up the environment for development. Feel free to contact Mike regarding anything here ().

Quick overview

Our online code consists of a fragments package (containing the DAQ data formats, shared between online and offline), lariat-online-lariatfragments, and all the online code, lariat-online. In both packages we are using the novabeamlinedaq branch. Note, since we are using our own build of lariatfragments it is (currently) a requirement to check out our own version of this to build against, rather than setting up a version in ups. lariat-online-lariatfragments must be set up first since lariat-online depends on it.

In the following instructions, it is assumed that you have a working directory in which to put the required software bases and local product builds. This will be referred to as our $BASE.

IMPORTANT
We regularly change the tags of the code in ups, so this page will inevitably become out of date, no matter how hard I try! For up-to-date version numbers, see Beamline software versions. And Slack me if you're unsure!

Setting up a pre-built release

If you have followed the process detailed below and have your own build of the software, you can set this up when logging back in by simply doing:

source /grid/fermiapp/products/lariat/setup
source /grid/fermiapp/products/artdaq/setup
export PRODUCTS=$BASE/local_product_installation:${PRODUCTS}
setup lariatonline v07_00_04nova -q e15:prof:s67    # our default version

This sets up all the required dependencies automatically, including the correct version of novabeamlinefragments which is built either locally at $BASE/local_product_installation or in the nova externals area.

Setting up for development

If instead you want to develop code, rather than just set up the previously built release, you can execute the following:

source /grid/fermiapp/products/lariat/setup
source /grid/fermiapp/products/nova/externals/setup
source /grid/fermiapp/products/artdaq/setup
export PRODUCTS=$BASE/local_product_installation:${PRODUCTS}
cd ${BASE}/build_lariat-online
source ../lariat-online/ups/setup_for_development -p

Again, this sets up all the required dependencies. Once set up, you can develop code, build using

buildtool -i -I $BASE/local_product_installation

as before, and commit as required.

Updating existing release

To update your local checkouts to reflect the most recent changes in the repo, just update the git packages and rebuild. In most cases, you will not need to rebuild your local checkout of lariat-online-lariatfragments (only if something in here has changed). In this case, skip ahead and just update lariat-online.

To update lariat-online-lariatfragments:

cd $BASE/lariat-online-lariatfragments
git pull
cd $BASE/build_lariat-online-fragments
source $BASE/lariat-online-lariatfragments/ups/setup_for_development -p
buildtool -c -j8 -i -I $BASE/local_product_installation

To update lariat-online:

cd $BASE/lariat-online
git pull
cd $BASE/build_lariat-online
source $BASE/lariat-online/ups/setup_for_development -p
buildtool -c -j8 -i -I $BASE/local_product_installation

New release from scratch

This will put everything in $BASE by default -- change the base directory if required.

Setup the required prerequisites:

source /grid/fermiapp/products/lariat/setup
source /grid/fermiapp/products/artdaq/setup

We will build our code and install it in a local directory. To make this:

cd $BASE
mkdir local_product_installation

We will be using ups to set up our local builds. If the config files haven't already been copied, they can be from the lariat area. Also, the location of the builds should be added to your $PRODUCTS path.

cp -R /grid/fermiapp/products/lariat/.upsfiles ${BASE}/local_product_installation/
export PRODUCTS=$BASE/local_product_installation:${PRODUCTS}

Fragments package

The fragments package contains definitions for the formatting of the data saved by the DAQ. It is a required dependence of both the online code (lariatonline) and the offline framework (novasoft).

You do not need to check out the code and build locally, if you will not making changes to it. In this case, you can just set up the version in the nova externals ups area:

source /grid/fermiapp/products/nova/externals/setup
setup novabeamlinefragments v07_00_02 -q e15:prof

and that's it! If you have set this up, you can skip to the next section (building lariatonline).

If you want to check out your own version of the repo, this process depends on whether or not you have developer access to the repo (hint: if you don't know whether or not you have developer access to a lariat repository, you probably don't! That's not a problem, you just can't commit code):

cd $BASE
git clone ssh://p-lariat-online@cdcvs.fnal.gov/cvs/projects/lariat-online-lariatfragments       # developer
git clone https://cdcvs.fnal.gov/projects/lariat-online-lariatfragments     # read-only

Next, switch to our branch and make the build directory:

mkdir build_lariat-online-fragments
cd lariat-online-lariatfragments
git checkout novabeamlinedaq

Make a directory to put our local builds in and put this in our path

Now we're ready to build:

cd $BASE/build_lariat-online-fragments
source ../lariat-online-lariatfragments/ups/setup_for_development -p e15
buildtool -c -j 16 -i -I ../local_product_installation

We should now be able to list the relevant products:

ups list -aK+ novabeamlinefragments

and can choose one to set up. By default, the version for our branch is

setup novabeamlinefragments v07_00_02 -q e15:prof

When looking at active ups products (`ups active`), you should see the location of the novabeamlinefragments setup to be in $HOME/local_product_installation.

Online package

Once you have a version of novabeamlinefragments set up, we are ready to check out and build lariat-online. First, check out the code:

cd $BASE
git clone ssh://p-lariat-online@cdcvs.fnal.gov/cvs/projects/lariat-online      # developer
git clone https://cdcvs.fnal.gov/projects/lariat-online    # read-only

Next, switch to our branch and make the build directory:

mkdir build_lariat-online
cd lariat-online
git checkout novabeamlinedaq

And we can build!

cd $BASE/build_lariat-online
source ../lariat-online/ups/setup_for_development -p e15:s67
buildtool -c -j 16 -i -I ../local_product_installation

This should now also be available to set up as a ups product:

ups list -aK+ lariatonline
setup lariatonline v07_00_04nova -q e15:prof:s67    # our default version

And we are good to go!

Configuring a new machine

There are some additional libraries which aren't provided by ups. If building the code on a new machine the following packages need to be install (e.g. yum install ...):
  • zeromq3
  • zeromq3-devel
  • openssl-devel

NOvA Test Beam specific (deprecated)

This is deprecated but is left here for reference. As of June 2018 we are not using our own version of the code but we are working off a branch in the lariat-online repository.

Description of building the novatestbeam code against a local checkout of novatestbeam-fragments. I used these steps to build the DAQ code on the novatestbeamdaq(00/01) machines. This is partly based on the instructions for building the LArIAT online code.

New release from scratch

Setup artdaq (and root, which doesn't seem to be set up any more...)

source /grid/fermiapp/larsoft/products/setup
setup root v6_06_04a -q e10:prof

Then check out and build the novatestbeam-fragments package. First clone the repo. For non-developers:

git clone https://cdcvs.fnal.gov/projects/novatestbeam-fragments

and for developers:

git clone ssh://p-novatestbeam@cdcvs.fnal.gov/cvs/projects/novatestbeam-fragments

Then make a build directory and a directory in which to place the local products:

mkdir build_novatestbeam-fragments
mkdir local_product_installation

From the build directory, setup and build the code:

cd build_novatestbeam-fragments
source ../novatestbeam-fragments/ups/setup_for_development -p e10
buildtool -j 16 -i -I ../local_product_installation

Here, -p e10 are the qualifiers (prof, e10 compiler), -j is number of cores, -i installs the code and -I is the location in which to install the code.

Before setting up the new ups product, add some additional magic:

cp -R /grid/fermiapp/products/lariat/.upsfiles ${HOME}/local_product_installation/
export PRODUCTS=${HOME}/local_product_installation:/grid/fermiapp/products/artdaq/:${PRODUCTS}

Then you can list the ups package and setup the relevant product.

ups list -aK+ novatestbeamfragments
setup novatestbeamfragments vXX_YY_ZZ -q e10:prof

This can then be used to build novatestbeam against. From the base dir, clone the repo. For non-developers:

git clone https://cdcvs.fnal.gov/projects/novatestbeam

and for developers:

git clone ssh://p-novatestbeam@cdcvs.fnal.gov/cvs/projects/novatestbeam

As before, make a build directory and build the code in there:

mkdir build_novatestbeam
cd build_novatestbeam
source ../novatestbeam/ups/setup_for_development -p e10
buildtool -j 16 -i -I ../local_product_installation

You can now set up the ups product to use!

ups list -aK+ novatestbeam
setup novatestbeam vXX_YY_ZZ -e e10:prof

Updating release

After making changes to the code, the base release should be updated. On novabeamlinedaq00, this is as simple as:

cd build_novatestbeam
source ../novatestbeam/ups/setup_for_development -p e10
buildtool -j 16 -i -I ../local_product_installation

Everything required to run the beamline software

When starting to run the beamline software on novabeamline00, multiple external packages were required. These are some brief notes overviewing all the changes which were required to get the software in a state the DAQ could run in. For context, these problems were faced (and hopefully solved, but this is ongoing!) after configuring all the DAQ software and putting the correct files in the correct places, so the first time it ran and tried to bring the board readers, event builders and other artdaq components up.

The external packages were added using RPM (couldn't find the necessary binaries using yum), so were obtained using (e.g.):

wget https://rpmfind.net/linux/centos/7.5.1804/os/x86_64/Packages/xz-libs-5.2.2-1.el7.x86_64.rpm
rpm -ihv (--force) xz-libs-5.2.2-1.el7.x86_64.rpm

All were retrieved from rpmfind.net.

liblzma

xz-libs-4.999.9-0.3.beta.20091007git.el6.x86_64.rpm

with dependencies
xz-libs-5.2.2-1.el7.x86_64.rpm
xz-libs-5.1.2-4alpha.fc19.x86_64.rpm

libpcre