Skip to content

Commit 4e35c84

Browse files
authored
Merge pull request #103 from kutschke/importKinKal_to_UPS
Import KinKal_to_UPS
2 parents 3669f05 + a7ac6f3 commit 4e35c84

File tree

12 files changed

+976
-1
lines changed

12 files changed

+976
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*~
2+
\#*\#

KinKal_to_UPS/README.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# KinKal_to_UPS
2+
Tools to build the KinKal package and install it in UPS.
3+
4+
## Introduction
5+
6+
There are two extreme ways to use this package:
7+
1) If you already have an exisiting build, you can create a UPS repository and install the existing build there.
8+
2) Start with nothing, clone, checkout, and, for both build prof and debug, build, test and install.
9+
10+
There are command line options to choose intermediate amounts of work.
11+
12+
## Instructions for case 1
13+
14+
The simplest example is that you have a working directory that contains 2 directories:
15+
16+
> KinKal build_debug
17+
18+
19+
and you already have a UPS **debug** version of root set up in the environment. In that directory do
20+
the following:
21+
22+
* setup mu2e
23+
* setup codetools
24+
* kk2ups -h # to see the help
25+
* kk2ups -v <git_tag_name> -i
26+
27+
This will look for the source in the subdirectory KinKal and for the built debug version in
28+
the subdirectory build_debug. It will install the already built git tag and into the default UPS
29+
repository, which is ./artexternals; the UPS repository will be created if necessary. The git tag
30+
is needed in order to name the UPS product version.
31+
32+
For example, if git_tag_name is v0.1.1, the UPS installation will be located at:
33+
34+
artexternals/KinKal/v00_01_01
35+
36+
and the UPS qualifiers will be copied from the underlying root UPS pacakge.
37+
38+
To use this UPS product:
39+
40+
* export PRODUCTS=${PWD}/artexternals:${PRODUCTS}
41+
* ups list -aK+ KinKal
42+
* setup -B KinKal VERSION -qQUALIFIERS
43+
44+
You can access the headers and libraries with the usual -I$KINKAL_INC and -L$KINKAL_LIB. An include directive within a .cc file should look like:
45+
46+
#include "KinKal/Fit/Track.hh"
47+
48+
49+
## Instructions for Case 2
50+
51+
Start in a clean working directory with no UPS version of root or cmake already setup.
52+
53+
* setup mu2e
54+
* setup codetools
55+
* kk2ups -v "v0.1.1" -n -b -t -i -z -c "v3_18_2" -r "v6_20_08a -q+e20:+p383b:+prof" -j 24 -d ${PWD}/artexternals
56+
57+
This will do the following
58+
* For the requested git tag of KinKal this will clone, checkout, cmake, make, make tests, install into UPS, and make tar files for installation on cvmfs.
59+
* The ups repository into which it is installed is given by the -d option; the default is ${PWD}/artexternals.
60+
* It will use the indicated versions of cmake and root; there is a default for cmake but only sort-of for root (see below).
61+
* The make step will do a 24 way parallel build, which is appropriate for mu2ebuild01; the default is a one thread build.
62+
* It will build both prof and debug; it knows that cmake spells these Release and Debug.
63+
* It assumes that debug version of ROOT differs from the prof version by the exchange prof->debug in the qualifier string
64+
* If you omit the -r qualifier, and if there is already a UPS version of root set up in the environment, this command will only build and install one of prof/debug, the one matching the version of root already set up.
65+
* If you omit the -r qualifier, and if there is no UPS version of root setup in the environment, it is an error.
66+
67+
When this is complete you will see the following subdirectories of clean_working_dir
68+
* KinKal_to_UPS - this package
69+
* KinKal - the cloned source
70+
* kinkal_profile - the working space for the Release (prof) build
71+
* kinkal_debug - the working space for the Debug (debug) build
72+
* artexternals - the UPS repo into which the code is installed.
73+
74+
You will also see two files:
75+
* KinKal_prof.tar.bz2
76+
* KinKal_debug.tar.bz2
77+
78+
These tar.bz2 files are formatted to be unwound into /cvmfs/mu2e.opensciencegrid.org/artexternals .
79+
80+
You can point the UPS repo at an arbitrary directory using the -d option but the other four directory names are hard coded.
81+
82+
The default behaviour is to abort if the KinKal directory already exists; it will overwrite existing files in kinkal_profile, kinkal_debug
83+
and artexternals/KinKal.
84+
85+
## Fixmes, Todos and questions
86+
87+
* For Jenkins, Ray prefers separate commands for prof/debug not one command to do both
88+
* For the development environment, Dave is OK with separate commands for prof/debug but would like to do both with a single command.
89+
* Do not needlessly rerun cmake; check for one of it's artifacts and skip.
90+
* git clone will fail if the directory KinKal exists and is non-empty. Is it acceptable to count on this or do we want our own check?
91+
* Is there a better name than KinKal_to_UPS?
92+
* Should KinKal_to_UPS be installed in UPS?
93+
* In the case of installing a prebuilt version of KinKal, is there a way to automatically determine the git tag so that it does not need to be given by hand in the install command?
94+
* Add an option to add additional qualifiers to the KinKal product
95+
* What additional checks for corner cases are needed?
96+
* I need to roll up the return statuses to one overall exit status and update the exit message.
97+
* Rename the tar.bz2 files to match the scisoft standard.
98+
* If we do a git checkout of the named tag, we assume that \<tagname\>_branch is a valid git branch name. Is that safe?
99+
* What else?
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.git
2+
.gitignore
3+
*.cc
4+
*~
5+
*.sh
6+
*.old
7+
*.sav
8+
.clang-format
9+
.clang-tidy
10+
.travis.yml
11+
CMakeLists.txt
12+
README.md
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.git
2+
.gitignore
3+
*~
4+
*.old
5+
*.sav

KinKal_to_UPS/funcs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#
2+
# Convert the git tag into UPS version number style
3+
# Examples: v0.1.1 to v00_01_01
4+
# v0.100.1 to v00_100_01
5+
# Note: awk printf will expand field width to support numbers larger than 99.
6+
# Fixme: add more error checking and support other style tags, for example
7+
# a suffix after the version number?
8+
#
9+
setUPSVersion() {
10+
nn=`echo $gitVersion | awk 'BEGIN{FS="."} { print NF }'`
11+
if [ "${nn}" != "3" ]; then
12+
echo "Git version is not in a supported style: " ${gitVersion}
13+
return 1
14+
fi
15+
ups_style_version=`echo $gitVersion | sed 's/v//' | awk 'BEGIN{FS="."} { printf ( "v%02d_%02d_%02d\n", $1, $2, $3) }'`"$versionSuffix"
16+
return 0
17+
}

0 commit comments

Comments
 (0)