Installing and building the lbne-artdaq code » History » Version 52
- Table of contents
- Installing the lbne-artdaq code
- Building the lbne-artdaq (and lbne-raw-data) code
- Before committing to the central repo
- An example of storing package info in a file
n.b. By default, the lbne-artdaq code relies on ZeroMQ being installed on your system; this is already the case with lbne35t-gateway01.fnal.gov . If you don't have this installed on your system (or you're not sure if you have it), then run the quick-start.sh script below to install the packages which lbne-artdaq depends on -- however, the build of lbne-artdaq itself will initially fail. To fix this, edit the CMakeLists.txt file in the base ./lbne-artdaq directory so that you swap out the line
set (ZEROMQ_IGNORED "FALSE") for
set (ZEROMQ_IGNORED "TRUE"). Once you've made this edit, then follow the instructions in the "Building the lbne-artdaq code" subsection, further down this document
Installing the lbne-artdaq code¶
As of Apr-7-2015, the lbne-artdaq package as well as all the packages it depends on (downloaded during the installation) take up 4.3 Gb of space, and the installation procedure takes about 6 minutes. On the gateway node, lbne35t-gateway01.fnal.gov, installation only takes up about one-tenth the space and one-half the time as most of the packages lbne-artdaq depends on are already installed in /data/lbnedaq/products. Installation can be done in just a few simple steps:
- Log into your system, and cd into an empty directory where you wish to install the code; for example:
cd $HOME ; mkdir lbne-artdaq-base ; cd lbne-artdaq-base
- Clone the git repository for lbne-artdaq. There are two ways to do this, depending on how you plan to use the package:
- EITHER if you're an lbne-artdaq (or lbne-raw-data) developer, run:
git clone ssh://email@example.com/cvs/projects/lbne-artdaq
- OR, if you're not planning to develop the code but are simply an end user, run:
git clone http://cdcvs.fnal.gov/projects/lbne-artdaq
- EITHER if you're an lbne-artdaq (or lbne-raw-data) developer, run:
- Run the quick-install script:
./lbne-artdaq/tools/quick-start.sh --tag=develop --not-lbne-raw-data-developer --not-artdaq-developer
This will install the version of lbne-artdaq at the head of its develop branch. If you'd like to choose a different version, replace the option "--tag=develop" with "--tag=<tagname>", where "<tagname>" is the git branch, git tag, or git commit hash of the version you want. Also, if you plan to modify lbne-raw-data, leave out the "--not-lbne-raw-data-developer" option. Finally, you can optionally add the "--run-demo" argument if you wish to automatically run a DAQ simulation demo after installation and building; please note that this will not work on lbne35t-gateway01.fnal.gov as of Apr-7-2015 due to lack of XWindows support.
Right after executing this command, you'll see the following:
Are you sure you want to download and install the artdaq demo dependent products in <BASEDIR>?
(where <BASEDIR> above is used as a placeholder for the actual directory you chose). Assuming you're in the directory you want to be in, respond with "y" followed by the enter/return key.
More generally: the instructions for installing and running the lbne-artdaq repository code are virtually the same as the instructions for installing and running the standard artdaq-demo package, found here and here . If you're curious to learn more about lbne-artdaq, or artdaq-based DAQ systems in general, you can click on those links.
Building the lbne-artdaq (and lbne-raw-data) code¶
Assuming you've already run the quick-start.sh script, then relative to the directory in which you performed the "
git clone" command described in the previous section (we'll call it $BASEDIR in this section), you'll see that the lbne-artdaq code is located within the ./lbne-artdaq directory, and it's here that you would perform your modifications. Once you've done this, in order to build it you'll want to cd back to $BASEDIR, and source a script called "setupLBNEARTDAQ" which is created during the installation process:
Now, whenever you modify the lbne-artdaq code, if you wish to rebuild you can simply type "
buildtool" and your changes will be built; if you wish to perform a clean build (i.e., rebuild everything) then cd into $BASEDIR/build_lbne-artdaq and type "
Note that sourcing "setupLBNEARTDAQ" will set up your environment such that you can build lbne-artdaq. If, on the other hand, it's lbne-raw-data which you modified, then you'll want to additionally do the following:
cd $BASEDIR/build_lbne-raw-data source ../lbne-raw-data/ups/setup_for_development -p <qualifier> buildtool -c -i -I $BASEDIR/products
Where as of Dec-14-2015, the "<qualifier>" for developers should be "e15:s7:online". The above commands will take you into the build area for lbne-raw-data, set up the build environment for the package, perform a clean build, and then install the clean build in the products/ directory. Note that if you wish to return to developing and building lbne-artdaq, you need only switch "lbne-artdaq" for "lbne-raw-data" in the first two of the above commands (i.e., the cd into the build directory and the source of the "setup_for_development" script).
PLEASE NOTE: before committing any changes to the central repository (particularly if you're working on the develop or master branches), make sure your code builds and runs. For more on this, see When you've completed your feature
Before committing to the central repo¶
n.b. This section is now obsolete and has been superseded by the When you've completed your feature section
As of 11/26/14, a script has been added to lbne35t-gateway01.fnal.gov:~lbnedaq/bin, called "update_and_build", which should be run on a package before it's committed to the develop branch in the central repo. It does the following:
- Goes to the "develop" branch of the local package
- Pulls the latest commits from the "develop" branch of the central repository
- Sets up the environment so as to allow builds of the package
- Performs a clean build of the package and installs it in the local products directory
If, for example, you've updated both lbne-raw-data and lbne-artdaq, before committing your changes to the central repository you would do the following (note that here, <basedir> is the directory that contains both packages as well as a local products/ directory):
cd $BASE source setupLBNEARTDAQ cd .. source ~/bin/update_and_build lbne-raw-data source ~/bin/update_and_build lbne-artdaq
During the source-ing of update_and_build, the script will issue an alert and exit out if any of the following occur:
- Expected directories are missing
- A merge conflict occurs during the pull
- The build fails
If none of these occurs, then feel free to push your commits to the central repository.
An example of storing package info in a file¶
A useful feature recently (8/19/14) added to lbne-artdaq is the ability to save info on the version and build times of both the lbne-artdaq package and the lbne-raw-data package on which it depends in output files. Formally, this code was added in response to Redmine Issue #6714. In artdaq, the ArtdaqBuildInfo module will add this info to a file, and in lbne-artdaq, the LbneArtdaqBuildInfo module will add this info. In ./lbne-artdaq/tools/fcl, the "driver.fcl" file will run these modules; you can put them into action if (assuming you've set up your environment by sourcing setupLBNEARTDAQ) you go to this directory and run
driver -c driver.fcl
The output will be a file, driver.root. You can then examine the contents of this file by passing the readRoot.fcl file to art itself, to wit:
art -c readRoot.fcl -s driver.root
and if you do this, you'll see something like the following:
artdaq-core package version: v1_02_01 artdaq-core package build time: 19-Aug-2014 13:03:28 UTC artdaq package version: v1_11_00 artdaq package build time: 19-Aug-2014 19:24:23 UTC lbne-raw-data package version: v0_00_03 lbne-raw-data package build time: 19-Aug-2014 19:25:16 UTC lbne-artdaq package version: v0_03_00 lbne-artdaq package build time: 19-Aug-2014 19:25:37 UTC
here, readRoot.fcl is using artdaq's PrintVersionInfo module and lbne-artdaq's LbneArtdaqPrintVersionInfo module to access the products added by ArtaqBuildInfo and LbneArtdaqBuildInfo, respectively, and printing them to the screen.