buildLBNEutil.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 # build lbnecode
4 # use mrb
5 # designed to work on Jenkins
6 # this is a proof of concept script
7 
8 echo "lbneutil version: $LBNEUTILVER"
9 echo "base qualifiers: $QUAL"
10 echo "build type: $BUILDTYPE"
11 echo "workspace: $WORKSPACE"
12 
13 ncores=`cat /proc/cpuinfo 2>/dev/null | grep -c -e '^processor'`
14 
15 
16 source /grid/fermiapp/lbne/software/setup_lbne.sh || exit 1
17 
18 setup git || exit 1
19 setup gitflow || exit 1
20 setup mrb || exit 1
21 # skip around a version of mrb that does not work on macOS
22 
23 if [ `uname` = Darwin ]; then
24  if [[ x`which mrb | grep v1_17_02` != x ]]; then
25  unsetup mrb || exit 1
26  setup mrb v1_16_02 || exit 1
27  fi
28 fi
29 
30 export MRB_PROJECT=lbne
31 which mrb
32 
33 set -x
34 rm -rf $WORKSPACE/temp || exit 1
35 mkdir -p $WORKSPACE/temp || exit 1
36 mkdir -p $WORKSPACE/copyBack || exit 1
37 rm -f $WORKSPACE/copyBack/* || exit 1
38 cd $WORKSPACE/temp || exit 1
39 mrb newDev -v $LBNEUTILVER -q $QUAL:$BUILDTYPE || exit 1
40 set +x
41 
42 source localProducts*/setup || exit 1
43 
44 set -x
45 cd $MRB_SOURCE || exit 1
46 # make sure we get a read-only copy
47 mrb g -r -t $LBNEUTILVER lbneutil || exit 1
48 cd $MRB_BUILDDIR || exit 1
49 mrbsetenv || exit 1
50 mrb b -j$ncores || exit 1
51 mrb mp -j$ncores || exit 1
52 mv *.bz2 $WORKSPACE/copyBack/ || exit 1
53 ls -l $WORKSPACE/copyBack/
54 cd $WORKSPACE || exit 1
55 rm -rf $WORKSPACE/temp || exit 1
56 set +x
57 
58 exit 0