5 # designed to work on Jenkins
6 # this is a proof of concept script
8 # Tom Junk, August 22, 2018
9 # copied from the dune_raw_data build script in dune's artdaq_utilities repository
11 echo
"garsoft version: $GARSOFT_VERSION"
12 echo
"target qualifier: $QUAL"
13 echo
"build type: $BUILDTYPE"
14 echo
"workspace: $WORKSPACE"
16 # Don't do ifdh build on macos.
18 #if uname | grep -q Darwin; then
19 # if ! echo $QUAL | grep -q noifdh; then
20 # echo "Ifdh build requested on macos. Quitting."
25 # Get number of cores to use.
27 if [ `uname` =
Darwin ]; then
28 #ncores=`sysctl -n hw.ncpu`
29 #ncores=$(( $ncores / 4 ))
34 if [ $ncores -lt 1 ]; then
37 echo
"Building using $ncores cores."
39 # Environment setup, uses cvmfs.
41 echo
"ls /cvmfs/dune.opensciencegrid.org/products/dune/"
42 ls /cvmfs/dune.opensciencegrid.org/products/dune/
45 echo
"ls /cvmfs/larsoft.opensciencegrid.org/products/"
46 ls /cvmfs/larsoft.opensciencegrid.org/products/
49 echo
"ls /cvmfs/fermilab.opensciencegrid.org/products/common/db"
50 ls /cvmfs/fermilab.opensciencegrid.org/products/
common/
db
53 if [ `uname` =
Darwin -
a -f /
grid/fermiapp/products/dune/setup_dune_fermiapp.sh ]; then
54 source /
grid/fermiapp/products/dune/setup_dune_fermiapp.sh ||
exit 1
55 elif [ -f /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh ]; then
56 if [ -
x /cvmfs/
grid.cern.ch/util/cvmfs-uptodate ]; then
57 /cvmfs/
grid.cern.ch/util/cvmfs-uptodate /cvmfs/dune.opensciencegrid.org/products
59 source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh ||
exit 1
61 echo
"No setup file found."
65 # skip around a version of mrb that does not work on macOS
67 if [ `uname` =
Darwin ]; then
68 if [[
x`which
mrb | grep v1_17_02` !=
x ]]; then
74 # Use system git on macos.
76 if ! uname | grep -
q Darwin; then
85 rm -rf $WORKSPACE/temp ||
exit 1
88 rm -f $WORKSPACE/copyBack
98 # some shenanigans so we can use getopt v1_1_6
99 if [ `uname` =
Darwin ]; then
101 # 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 || \
103 #ERROR: pull of http://scisoft.fnal.gov/scisoft/packages/getopt/v1_1_6/getopt-1.1.6-d13-x86_64.tar.bz2 failed
107 # tar xf getopt-1.1.6-d13-x86_64.tar.bz2 || exit 1
114 # check out a readonly version
115 mrb g -
r -t $GARSOFT_VERSION -d garsoft garsoft-garsoft ||
exit 1
117 cd $MRB_BUILDDIR ||
exit 1
120 mrb mp -
n garsoft -- -j$ncores ||
exit 1
125 if uname | grep -
q Darwin; then
134 mv *.bz2 $WORKSPACE/copyBack/ ||
exit 1
136 ls -l $WORKSPACE/copyBack/
138 rm -rf $WORKSPACE/temp ||
exit 1
then source grid fermiapp products dune setup_dune_fermiapp sh exit else echo No setup file found exit fi setup
process_name opflash particleana ie x
then cvmfs grid cern ch util cvmfs uptodate cvmfs uboone opensciencegrid org products fi source cvmfs uboone opensciencegrid org products setup_uboone sh exit else echo No setup file found exit fi if!uname grep q Darwin
then setup git exit fi setup gitflow exit export MRB_PROJECT
then source cvmfs dune opensciencegrid org products dune setup_dune sh exit elif[-f/grid/fermiapp/products/dune/setup_dune_fermiapp.sh]
then echo Invalid dCache scratch not copying back else ifdh ls
esac shift done rm f *xml find $SBNDCODE_DIR source fcl gen name *fcl while read fcl do if!echo $fcl grep q common
height to which particles are projected pnfs larsoft persistent physics cosmics Fermilab CORSIKA standard He_showers_ * db