5 # designed to work on Jenkins
6 # this is a proof of concept script
8 echo "duneutil version: $DUNEUTILVER"
9 echo "base qualifiers: $QUAL"
10 echo "build type: $BUILDTYPE"
11 echo "workspace: $WORKSPACE"
13 echo "----------------------------"
14 echo "ls /grid/fermiapp/products/dune"
15 ls /grid/fermiapp/products/dune
16 echo "----------------------------"
17 echo "ls /cvmfs/dune.opensciencegrid.org/products/dune"
18 ls /cvmfs/dune.opensciencegrid.org/products/dune
19 echo "----------------------------"
22 # Don't do ifdh build on macos.
24 #if uname | grep -q Darwin; then
25 # if ! echo $QUAL | grep -q noifdh; then
26 # echo "Ifdh build requested on macos. Quitting."
31 # Get number of cores to use.
33 if [ `uname` = Darwin ]; then
34 #ncores=`sysctl -n hw.ncpu`
35 #ncores=$(( $ncores / 4 ))
38 ncores=`cat /proc/cpuinfo 2>/dev/null | grep -c -e '^processor'`
40 if [ $ncores -lt 1 ]; then
43 echo "Building using $ncores cores."
45 if [ `uname` = Darwin -a -f /grid/fermiapp/products/dune/setup_dune_fermiapp.sh ]; then
46 source /grid/fermiapp/products/dune/setup_dune_fermiapp.sh || exit 1
47 elif [ -f /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh ]; then
48 if [ -x /cvmfs/grid.cern.ch/util/cvmfs-uptodate ]; then
49 /cvmfs/grid.cern.ch/util/cvmfs-uptodate /cvmfs/dune.opensciencegrid.org/products
51 source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh || exit 1
53 echo "No setup file found."
57 # Use system git on macos.
59 if ! uname | grep -q Darwin; then
63 # skip around a version of mrb that does not work on macOS
65 if [ `uname` = Darwin ]; then
66 if [[ x`which mrb | grep v1_17_02` != x ]]; then
68 setup mrb v1_16_02 || exit 1
72 setup gitflow || exit 1
73 export MRB_PROJECT=dune
78 rm -rf $WORKSPACE/temp || exit 1
79 mkdir -p $WORKSPACE/temp || exit 1
80 mkdir -p $WORKSPACE/copyBack || exit 1
81 rm -f $WORKSPACE/copyBack/* || exit 1
82 cd $WORKSPACE/temp || exit 1
83 mrb newDev -v $DUNEUTILVER -q $QUAL:$BUILDTYPE || exit 1
86 source localProducts*/setup || exit 1
88 # some shenanigans so we can use getopt v1_1_6
89 if [ `uname` = Darwin ]; then
91 # 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 || \
93 #ERROR: pull of http://scisoft.fnal.gov/scisoft/packages/getopt/v1_1_6/getopt-1.1.6-d13-x86_64.tar.bz2 failed
97 # tar xf getopt-1.1.6-d13-x86_64.tar.bz2 || exit 1
98 setup getopt v1_1_6 || exit 1
103 cd $MRB_SOURCE || exit 1
104 # make sure we get a read-only copy
105 mrb g -r -t $DUNEUTILVER --repo-type github -g DUNE duneutil || exit 1
106 cd $MRB_BUILDDIR || exit 1
108 mrb b -j$ncores || exit 1
109 mrb mp -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