3 # build lariatsoft, lariatutil and lbne_raw_data 
    5 # designed to work on Jenkins 
    6 # this is a proof of concept script 
    8 echo 
"lariatsoft version: $LARIAT" 
    9 echo 
"base qualifiers: $QUAL" 
   10 echo 
"larsoft qualifiers: $LARSOFT_QUAL" 
   11 echo 
"build type: $BUILDTYPE" 
   12 echo 
"workspace: $WORKSPACE" 
   14 # Don't do ifdh build on macos. 
   16 #if uname | grep -q Darwin; then 
   17 #  if ! echo $QUAL | grep -q noifdh; then 
   18 #    echo "Ifdh build requested on macos.  Quitting." 
   23 # Get number of cores to use. 
   25 if [ `uname` = 
Darwin ]; then
 
   26   #ncores=`sysctl -n hw.ncpu` 
   27   #ncores=$(( $ncores / 4 )) 
   32 if [ $ncores -lt 1 ]; then
 
   35 echo 
"Building using $ncores cores." 
   37 # Environment setup, uses /grid/fermiapp or cvmfs. 
   39 #echo "ls /cvmfs/lariat.opensciencegrid.org/products/lariat/" 
   40 #ls /cvmfs/lariat.opensciencegrid.org/products/lariat/ 
   43 if [ -f /
grid/fermiapp/lariat/setup_lariat.sh ]; then
 
   46   echo 
"No setup file found." 
   49 # skip around a version of mrb that does not work on macOS 
   51 if [ `uname` = 
Darwin ]; then
 
   52   if [[ 
x`which 
mrb | grep v1_17_02` != 
x ]]; then
 
   58 # Use system git on macos. 
   60 if ! uname | grep -
q Darwin; then
 
   69 rm -rf $WORKSPACE/temp || 
exit 1
 
   72 rm -f $WORKSPACE/copyBack
 
   79 # some shenanigans so we can use getopt v1_1_6 
   80 if [ `uname` = 
Darwin ]; then
 
   82 #  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 || \ 
   84 #ERROR: pull of http://scisoft.fnal.gov/scisoft/packages/getopt/v1_1_6/getopt-1.1.6-d13-x86_64.tar.bz2 failed 
   88 #  tar xf getopt-1.1.6-d13-x86_64.tar.bz2 || exit 1 
   95 # make sure we get a read-only copy 
   98 # Extract lariatutil version from lariatsoft product_deps 
   99 lariatutil_version=`grep lariatutil $MRB_SOURCE/lariatsoft/ups/product_deps | grep -v qualifier | awk 
'{print $2}'`
 
  100 echo 
"lariatuitil version: $lariatutil_version" 
  101 mrb g -d lariatutil -t $lariatutil_version http:
 
  103 # Extract lariatfragments version from lariatsoft product_deps 
  104 lariatfragments_version=`grep lariatfragments $MRB_SOURCE/lariatsoft/ups/product_deps | grep -v qualifier | awk 
'{print $2}'`
 
  105 echo 
"ubuitil version: $lariatfragments_version" 
  106 mrb g -d lariatfragments -t $lariatfragments_version http:
 
  108 cd $MRB_BUILDDIR || 
exit 1
 
  111 mrb mp -
n lariat -- -j$ncores || 
exit 1
 
  115 if echo $QUAL | grep -
q nobeam; then
 
  118 # add LariatBeamFiles to the manifest 
  119 # currently does not exist on scisoft 
  120     LariatBeamFiles_version=`grep LariatBeamFiles $MRB_SOURCE/lariatsoft/ups/product_deps | grep -v qualifier | awk 
'{print $2}'`
 
  121     LariatBeamFiles_dot_version=`echo ${LariatBeamFiles_version} | sed -
e 's/_/./g' | sed -
e 's/^v//'`
 
  122 #    echo "LariatBeamFiles      ${LariatBeamFiles_version}          LariatBeamFiles-${LariatBeamFiles_dot_version}-noarch.tar.bz2" >>  $manifest 
  125 LariatFilters_version=`grep LariatFilters $MRB_SOURCE/lariatsoft/ups/product_deps | grep -v qualifier | awk 
'{print $2}'`
 
  126 LariatFilters_dot_version=`echo ${LariatFilters_version} | sed -
e 's/_/./g' | sed -
e 's/^v//'`
 
  127 echo 
"LariatFilters        ${LariatFilters_version}          LariatFilters-${LariatFilters_dot_version}-noarch.tar.gz" >>  $manifest
 
  129 # Extract larsoft version from product_deps. 
  131 larsoft_version=`grep larsoft $MRB_SOURCE/lariatsoft/ups/product_deps | grep -v qualifier | awk 
'{print $2}'`
 
  132 larsoft_dot_version=`echo ${larsoft_version} |  sed -
e 's/_/./g' | sed -
e 's/^v//'`
 
  137 if uname | grep -
q Darwin; then
 
  143 # Construct name of larsoft manifest. 
  145 larsoft_hyphen_qual=`echo $LARSOFT_QUAL | tr : - | sed 
's/-noifdh//'`
 
  146 larsoft_manifest=larsoft-${larsoft_dot_version}-${
flvr}-${larsoft_hyphen_qual}-${BUILDTYPE}_MANIFEST.txt
 
  147 echo 
"Larsoft manifest:" 
  148 echo $larsoft_manifest
 
  151 # Fetch laraoft manifest from scisoft and append to lariatsoft manifest. 
  153 curl --fail --silent --location --insecure http:
 
  155 # Special handling of noifdh builds goes here. 
  157 if echo $QUAL | grep -
q noifdh; then
 
  159   if uname | grep -
q Darwin; then
 
  161     # If this is a macos build, then rename the manifest to remove noifdh qualifier in the name 
  164     mv $manifest $noifdh_manifest
 
  168     # Otherwise (for slf builds), delete the manifest entirely. 
  177 mv *.bz2  $WORKSPACE/copyBack/ || 
exit 1
 
  179 if [ -f $manifest ]; then
 
  180   mv $manifest  $WORKSPACE/copyBack/ || 
exit 1
 
  182 #cp $MRB_BUILDDIR/lariatsoft/releaseDB 
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 cp usr lib64 libXmu so sbncode lib fi mrb mp n sbn j $ncores exit manifest