3 # pull source code in ${working_dir}/source
4 # build in ${working_dir}/build
5 # copyback directory is ${working_dir}/copyBack
10 Usage: $(basename ${0}) [-
h]
11 env WORKSPACE=<workspace> LARVER=<larsoft
version>
QUAL=<qualifier> BUILDTYPE=<
debug|
prof> $(basename ${0})
21 for label
in "${labels[@]}";
do
22 for wanted in
"$@";
do
23 [[
"${label}" ==
"${wanted}" ]] &&
return 0
41 shift `expr $OPTIND - 1`
44 working_dir=
"${WORKSPACE:-$(pwd)}"
46 qual_set=
"${2:-${QUAL}}"
48 build_type=
"${3:-${BUILDTYPE}}"
51 for onequal
in "${quals[@]}";
do
52 if [[
"${onequal}" =~ ^([ec])([0-9]+)$ ]]; then
54 elif [[
"${onequal}" =~ ^(
s)([1-9][0-9]+)$ ]]; then
61 echo
"basequal ${basequal} squal ${squal} labels ${labels}"
71 # create copyBack so artifact
copy does not fail on early
exit
72 rm -rf
"${working_dir}/copyBack"
75 # Find platform flavor.
77 if [
"${OS}" =
"Linux" ]
80 if [
"${id}" =
"Ubuntu" ]
82 flvr=u`lsb_release -
r | sed -
e 's/[[:space:]]//g' | cut -f2 -d
":" | cut -f1 -d
"."`
84 flvr=slf`lsb_release -
r | sed -
e 's/[[:space:]]//g' | cut -f2 -d
":" | cut -f1 -d
"."`
86 elif [
"${OS}" =
"Darwin" ]
88 flvr=d`uname -
r | cut -f1 -d
"."`
98 echo
"ERROR: unrecognized operating system ${OS}"
102 # Check supported builds.
103 if [[ `uname -
s` ==
Darwin ]]; then
104 OSnum=`uname -
r | cut -f1 -d
"."`
105 xver=`xcodebuild -
version | grep Xcode | cut -f2 -d
" " | cut -f1 -d
"."`
106 xcver=`xcodebuild -
version | grep Xcode`
107 if { [[ ${basequal} =~ ^
e(9$|[1-9][0-9]) ]] && \
108 [[ ${xver} < 7 ]] && \
109 [[ ${OSnum} > 13 ]]; }; then
110 # XCode too old on this platform.
111 echo
"${basequal} build not supported on `uname -s`${OSnum} with ${xcver}"
112 echo
"${basequal} build not supported on `uname -s`${OSnum} with ${xcver}" > \
113 "${working_dir}/copyBack/skipping_build"
115 elif { [[
"$basequal" ==
e* ]] || \
116 { [[
"$basequal" == c* ]] && (( $OSnum < 15 )); }; }; then
117 if want_unsupported; then
118 echo
"Building unsupported ${basequal} on `uname -s`${OSnum} due to \$CET_BUILD_UNSUPPORTED=${CET_BUILD_UNSUPPORTED}"
120 # Don't normally support GCC builds on MacOS.
121 msg=
"${basequal} build not supported on `uname -s`${OSnum} -- export CET_BUILD_UNSUPPORTED=1 to override."
123 echo
"$msg" >
"${working_dir}/copyBack/skipping_build"
128 msg=
"We are not building for Python2 on Darwin."
130 echo
"${msg}" >
"${working_dir}/copyBack/skipping_build"
133 elif [[
"${flvr}" == slf6 ]]; then
135 echo
"Building for supported Python2 on SLF6"
137 if [[
"$basequal" != e17 ]] && [[
"$basequal" != c2 ]]; then
138 msg=
"Python3 builds not supported on SLF6."
140 echo
"${msg}" >
"${working_dir}/copyBack/skipping_build"
146 dotver=`echo ${
version} | sed -
e 's/_/./g' | sed -
e 's/^v//'`
148 echo
"building the larsoft distribution for ${version} ${dotver} ${qual_set} ${build_type}"
149 echo
"build flavor is ${flvr}"
152 qualdir=`echo ${qual_set} | sed -
e 's%:%-%'`
156 blddir=${working_dir}/build
157 srcdir=${working_dir}/
source
158 # start with clean directories
161 # now make the dfirectories
166 buildFW=
"${working_dir}/artutilscripts/tools/buildFW"
167 tensorflow_spack_install=
"${working_dir}/artutilscripts/tools/tensorflow_spack_install.sh"
171 if [ -
z "${buildFW}" ]; then
172 curl --fail --silent --location --insecure -
O http:
174 buildFW=
"${blddir}/buildFW"
181 if [ -d ${blddir}/packages/spack ]; then
182 echo
"spack packages already exist"
184 "${tensorflow_spack_install}" packages
186 export PRODUCTS=${blddir}:${blddir}/packages
187 (( ${#
labels[@]} > 0 )) && lopt=-l
189 ${lopt} $(
IFS=:; printf
'%s' "${labels[*]}") \
190 ${blddir} ${build_type} lar_product_stack-${
version} || \
process_name opflash particleana ie ie ie z
*usage exit esac done shift expr $OPTIND OPTIND
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 source cvmfs dune opensciencegrid org products dune setup_dune sh exit elif[-f/grid/fermiapp/products/dune/setup_dune_fermiapp.sh]
do case in h help echo Usage
if &&[-z"$BASH_VERSION"] then echo Attempting to switch to bash bash shellSwitch exit fi &&["$1"= 'shellSwitch'] shift declare a IncludeDirectives for Dir in
then echo File list $list not found else cat $list while read file do echo $file sed s
s7[0-9] s8[0-9] s9[0-9] squal