Project

General

Profile

Instructions for setting up a development environment for uBooNE.

Login into the uboonedaq-evb or ubdaq-prod-evb node and make sure you have a valid kerberos ticket (klist).

1. Set the UBOONEDAQ_HOME_DIR environment variable.

This environment variable points to your private development area, which contains the project source code (${HOME}/development_daq/uboonedaq), out of source build files (${HOME}/development/build), and ups repository (${HOME}/development_daq/install) where the build binaries and header files are installed by the build process (make install). It needs to be set for each ssh session. For the convenience, it is set to ${HOME}/development_daq in the ~/.bash_profile. Use the following example to override the default value.

export UBOONEDAQ_HOME_DIR=${HOME}/development_daq

2. Setup your UPS environment and git.

source /uboonenew/setup_online.sh

The command above sets up your primary UPS repository (/uboonenew) with all development software and libraries. It also creates a couple of aliases and a helper function, which is described in the next step.
alias git-clone-uboone-online-source="git clone ssh://p-uboonedaq@cdcvs.fnal.gov/cvs/projects/uboonedaq/"
alias cd-build-directory="cd ${UBOONEDAQ_HOME_DIR}/build"

3. Download source code into the UBOONEDAQ_HOME_DIR directory and create a private ups repository for your development.

setup-development-source

The setup-development-source function needs to be executed only once when you create a new development area or need to recreate it from the git repository. In the later case, you will need to delete to existing (old) development area manually. The private UPS repository, which is located in the ${HOME}/development_daq/install directory is the location where the project libraries and header files will be installed by the build process (make install). The project source code is downloaded into the ${HOME}/development_daq/uboonedaq directory. All git and cmake rules and procedures are applicable to it and its subdirectories.

If you want to merely git pull the latest changes, you may replace a pull for the clone in the relevant spot. Do a '[echurch@uboonedaq-seb-01 build]$ type -a setup-development-source' to see the relevant spot.

3b. (optional) Setup a version of uboonedaq_datatypes to use, if you want to use a specific version (or build it yourself)

To see which versions are available, type
ups list -aK+ uboonedaq_datatypes
Note that even if a flag is listed as "debug:e7", it may not work unless you rearrange it "e7:debug".

For example, to set up version v6_11_05a, one would type
setup uboonedaq_datatypes v6_11_05a -qe7:debug

In case, you've recently setup a new version of datatypes and there's a conflict between that and the one uboonedaq expect you will need to:
  1. Change the version of unoonedaq-datatypes in the ${UBOONEDAQ_HOME_DIR}/uboonedaq/projects/ups/product_deps file to match the one which is setup
  2. Log out of the machine
  3. Log in again
  4. Start again from the beginning of this page

4. Setup your development environment.

cd ${UBOONEDAQ_HOME_DIR}/build (optional)

source ../uboonedaq/projects/ups/setup_for_development -d

note: where setup for development can be -d (debug) or -p (profile)

The setup_for_development command initializes the cetbuildtools package and should be executed in the ${HOME}/development_daq/build directory.
https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/Cetbuildtools_user_guide

The release number is maintained inside the ${UBOONEDAQ_HOME_DIR}/uboonedaq/projects/ups/product_deps file.
Look for the line containing the parent uboonedaq vXX_XX_00 string.

About Qualifiers

5. Run cmake as suggested by the setup_for_development script output.

env CC=gcc CXX=g++ FC=gfortran cmake -DCMAKE_INSTALL_PREFIX="${UBOONEDAQ_HOME_DIR}/install" -DCMAKE_BUILD_TYPE=${CETPKG_TYPE} "${CETPKG_SOURCE}"
make -j32

The build may fail the first time - this happens! Try make -j32 for a second time and it should work. If it fails again, sometimes it seems to work if you use a smaller number of cores (e.g. make -j10). I have no idea why this works, but it seems to.

This step uses the cmake build tool to initialize your build area and needs to be repeated if any of the CMakeLists.txt files were modified. Follow the cetbuildtools user guide and cmake guidelines while making changes to the CMakeLists.txt files.
https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/Cetbuildtools_user_guide

6. Finally, run make or make install, which compile and install uboone code in your private UPS repository.

make install

The only important thing to mention here is that you do need to install your binaries into the private UPS repository and set them up as shown in the next step before they can be run from the command line.

7. Run the precursors and "setup" command to make the newly built release available for use.

. ${UBOONEDAQ_HOME_DIR}/install/setup

Now you need to work out what version of the code you have installed so you can set it up. Look in ${UBOONEDAQ_HOME_DIR}/install/uboonedaq to see the versions of uboonedaq that you have built. If you have built multiple versions in the past then you will see them all here. Now look in ${UBOONEDAQ_HOME_DIR}/uboonedaq/projects/ups/product_deps. The first few lines of that file should look similar to this:

# The parent line must be the first non-comment line in the file
# This line defines the product name and version

parent uboonedaq   v6_27_01
defaultqual        e7

Here you can see the version of the code that you have just compiled, as well as the qualifier.

Now you can do:
setup uboonedaq [your version] -q debug:[your qualifier]
(in the example above, this would be setup uboonedaq v6_27_01 -q e7:debug)

This command prepends the location where the project binaries were installed to the PATH and LD_LIBRARY_PATH variables. In a similar way, it will also setup all required dependencies specified in the UPS table file for your project.

If you want to check it has worked correctly, type ups active to see your active products, and check that the version and directory listed next to uboonedaq are the version you set up above and your ${UBOONEDAQ_HOME_DIR} directory.

Done.

Other Stuff

cetbuildtools guide
https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/Cetbuildtools_user_guide

git tips and tricks
https://cdcvs.fnal.gov/redmine/projects/uboonedaq/wiki/Git
https://cdcvs.fnal.gov/redmine/projects/cet-is-public/wiki/GitTipsAndTricks