Building BTrk
|
||
Working groups |
Blessed plots and figures |
Approving new results and publications |
Approval web pages - new results |
Approval web pages - new publications |
Mu2e Acronyn Dictionary |
Fermilab Meeting Rooms |
Fermilab Service Desk |
ReadyTalk : Home |
ReadyTalk : Help |
ReadyTalk : Toll Free Numbers |
The BTrk package is a repackaging of the BaBaR tracking code that Mu2e has used for many years. Previously the BaBaR code was maintained in an svn repository at LBL and was used by checking it out on top of Mu2e Offline source and building it as a part of Mu2e Offline.
The BTrk source code is now maintained in github, as a packaged named BTrk, and is distributed as the ups package named BTrk. Mu2e Offline finds the BTrk header files and shared libraries in the ups product. For convenience the BTrk source code is also distributed as part of the ups product (more precisely, the source code found in a version of the ups product is the code used to build that particular version of the product).
This page explains how to build, install and use your own version of the BTrk package.
To build, install and use your own version of BTrk, follow the steps listed here. Additional details for each step follow.
The repository is readable by the public. To clone a copy of the repository:
git clone https://github.com/KFTrack/BTrk.gitThis will create a subdirectory, named BTrk, in your current working directory You probably want to clone the repository onto a disk that is backed up, such as your home directory or /grid/fermiapp/mu2e/users.
Most of us will not have write access to the BTrk repository. Instead we will use a request to pull protocol.
cp -r /cvmfs/mu2e.opensciencegrid.org/artexternals/.upsfiles .
export PRODUCTS_INSTALL=/absolute/path/to/your/products/directory export PRODUCTS=${PRODUCTS_INSTALL}:${PRODUCTS}It is important that you do the second step after you do setup mu2e.
When you cloned the BTrk git repository, it created a directory named BTrk. In the following we will refer to this as your source directory.
The build scripts are configured to make two kinds of builds, prof and debug. The prof build is an optimized build with -DNDEBUG and with a partly stripped executable; enough symbols are retained that a code profiler will produce useful information, hence the name.
This build system does out-of-source builds. This means that the source code lives in one directory, you do the prof build in a second directory and, if you want a debug build, you do that build in a third directory. This will be spelled out in detail below. If you need more builds, with more variations, you do each in a separate directory.
In the following, the directories in which you do a build will be called a build directory.
We recommend that you create build directories in your disk space on /mu2e/app/users. Why? This is a large disk that is mounted exec and it is not backed up; we don't want to waste space on backed up disks with binaries that are easily recreated from backed up source.
Here are the steps to build code:
In your source directory do the following:
git checkout -b local_branch_name tag_namewhere local_branch_name is ususally something like tag_name_branch. By default you will build the head of the master branch.
export PACKAGE_VERSION=v1_00_08_test
The following instructions describe actions you take in your build directory. They will describe how to make a profile build; to make a debug build, change prof to debug everywhere in the instructions.
setup mu2eOr the equivalent at a remote site.
mkdir build_prof cd build_prof
source <path_to_your_source_directory>/scripts/newBuild.sh profIf the first argument is neither prof or debug the script will report an error and do nothing. This will create two files in the directory, setup.sh and SConstruct.
source setup.shThis tells the build system where your source directory is; it also tells the build system whether to do a debug or prof build (it remembers the argument that you gave to newBuild.sh).
scons -j 8The numerical value of the -j option sets the maximum amount of parallelism in the build.
source <path_to_your_source_directory>/scripts/install.shThis will create a subdirectory BTrk in your ups repository. Compare your ups repository to the Mu2e artexternals on cvmfs.
If you logout and log in again, you need to:
setup mu2e
export PRODUCTS_INSTALL=/absolute/path/to/your/products/directory export PRODUCTS=${PRODUCTS_INSTALL}:${PRODUCTS}
source setup.sh
setup mu2e
export PRODUCTS_INSTALL=/absolute/path/to/your/products/directory export PRODUCTS=${PRODUCTS_INSTALL}:${PRODUCTS}
git clone ssh://p-mu2eofflinesoftwaremu2eoffline@cdcvs.fnal.gov/cvs/projects/mu2eofflinesoftwaremu2eoffline/Offline.git cd Offline
source setup.sh
scons -j 8
If you do wish to contribute your changes to BTrk then read the rest of this section.
Mu2e will use BTrk to experiment with a way of contributing code that is new to us but is widely used elsewhere. If we decide that we like this method we will adopt some variation of it for all of our git repositories.
git clone git@github.com:<your github username>/BTrk
git push originBut now origin will point to your fork and not the main BTrk repository.
Security, Privacy, Legal |