5 # designed to work on Jenkins
7 echo "uboonedata version: $UBOONEDATA"
8 echo "larsoft qualifiers: $QUAL"
9 echo "build type: $BUILDTYPE"
10 echo "workspace: $WORKSPACE"
12 # Don't do ifdh build on macos.
14 #if uname | grep -q Darwin; then
15 # if ! echo $QUAL | grep -q noifdh; then
16 # echo "Ifdh build requested on macos. Quitting."
21 # Get number of cores to use.
23 if [ `uname` = Darwin ]; then
24 #ncores=`sysctl -n hw.ncpu`
25 #ncores=$(( $ncores / 4 ))
28 ncores=`cat /proc/cpuinfo 2>/dev/null | grep -c -e '^processor'`
30 if [ $ncores -lt 1 ]; then
33 echo "Building using $ncores cores."
35 # Environment setup, uses /grid/fermiapp or cvmfs.
37 echo "ls /cvmfs/uboone.opensciencegrid.org"
38 ls /cvmfs/uboone.opensciencegrid.org
41 if [ -f /grid/fermiapp/products/uboone/setup_uboone_bluearc.sh ]; then
42 source /grid/fermiapp/products/uboone/setup_uboone_bluearc.sh || exit 1
43 elif [ -f /cvmfs/uboone.opensciencegrid.org/products/setup_uboone.sh ]; then
44 if [ -x /cvmfs/grid.cern.ch/util/cvmfs-uptodate ]; then
45 /cvmfs/grid.cern.ch/util/cvmfs-uptodate /cvmfs/uboone.opensciencegrid.org/products
47 source /cvmfs/uboone.opensciencegrid.org/products/setup_uboone.sh || exit 1
49 echo "No setup file found."
53 # Use system git on macos.
55 if ! uname | grep -q Darwin; then
58 setup gitflow || exit 1
59 # skip around a version of mrb that does not work on macOS
61 if [ `uname` = Darwin ]; then
62 if [[ x`which mrb | grep v1_17_02` != x ]]; then
64 setup mrb v1_16_02 || exit 1
68 export MRB_PROJECT=uboone
73 rm -rf $WORKSPACE/temp || exit 1
74 mkdir -p $WORKSPACE/temp || exit 1
75 mkdir -p $WORKSPACE/copyBack || exit 1
76 rm -f $WORKSPACE/copyBack/* || exit 1
77 cd $WORKSPACE/temp || exit 1
78 mrb newDev -q $QUAL:$BUILDTYPE || exit 1
81 source localProducts*/setup || exit 1
82 echo "PRODUCTS=$PRODUCTS"
84 # some shenanigans so we can use getopt v1_1_6
85 if [ `uname` = Darwin ]; then
87 # curl --fail --silent --location --insecure -O http://scisoft.fnal.gov/scisoft/packages/getopt/v1_1_6/getopt-1.1.6-d13-x86_64.tar.bz2 || \
89 #ERROR: pull of http://scisoft.fnal.gov/scisoft/packages/getopt/v1_1_6/getopt-1.1.6-d13-x86_64.tar.bz2 failed
93 # tar xf getopt-1.1.6-d13-x86_64.tar.bz2 || exit 1
94 setup getopt v1_1_6 || exit 1
99 cd $MRB_SOURCE || exit 1
100 # make sure we get a read-only copy
101 mrb g -r -t $UBOONEDATA uboonedata || exit 1
103 cd $MRB_BUILDDIR || exit 1
105 mrb b -j$ncores || exit 1
106 mrb mp -n uboonedata -- -j$ncores || exit 1
110 mv *.bz2 $WORKSPACE/copyBack/ || exit 1
111 ls -l $WORKSPACE/copyBack/
112 cd $WORKSPACE || exit 1
113 rm -rf $WORKSPACE/temp || exit 1