Skip to content

Commit

Permalink
Merge pull request #11 from rlcee/210401
Browse files Browse the repository at this point in the history
210401
  • Loading branch information
rlcee authored Apr 1, 2021
2 parents b7e509c + fe54742 commit 4602bc6
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 30 deletions.
33 changes: 21 additions & 12 deletions bin/mgit
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,31 @@ mg_test_clean() {
mg_init() {
local USERNAME="$1"

if [ ! -d Offline ]; then
git init Offline || exit 1
CWD=$(basename $PWD)
if [[ "$CWD" == "Offline" || -d Offline ]]; then
echo "mgit - mgit can't turn an existing repo into a partial checkout"
exit 1
fi


git init -b master Offline || exit 1
cd Offline

echo "mgit - adding and fetching remote mu2e from: github/Mu2e"
TEST=$( git remote -v | grep fetch | awk '{if($1=="mu2e") print $1}' )
if [ -z "$TEST" ]; then
git remote add mu2e https://github.com/Mu2e/Offline || exit 1
fi

git fetch mu2e || exit 1
git fetch -q mu2e || exit 1

if [ -n "$USERNAME" ]; then
echo "mgit - adding and fetching remote origin from: github/$USERNAME"
TEST=$( git remote -v | grep fetch | awk '{if($1=="origin") print $1}' )
if [ -z "$TEST" ]; then
git remote add origin [email protected]:${USERNAME}/Offline || exit 1
fi
git fetch origin || exit 1
git fetch -q origin || exit 1
fi

# save variables to .git/config
Expand All @@ -127,8 +134,9 @@ mg_init() {
echo "/.gitignore" >> .git/info/sparse-checkout
# echo "/site_scons" >> .git/info/sparse-checkout

git checkout -b mgit_work mu2e/master || exit 1
git read-tree --reset -u HEAD || exit 1
#git checkout -b mgit_work mu2e/master || exit 1
#git read-tree --reset -u HEAD || exit 1
git read-tree --empty || exit 1

return 0

Expand Down Expand Up @@ -225,7 +233,7 @@ mg_add() {
fi
done

git checkout $BRANCH
git checkout -q $BRANCH

}

Expand Down Expand Up @@ -264,9 +272,9 @@ mg_rm() {
done

# this acts on the change
git checkout $BRANCH
git checkout -q $BRANCH

echo "mgit - *** use \"muse build -c\" to remove build products from removed local source code ***"
echo "mgit - *** use \"muse build -c\" to remove build products from local build area ***"

}

Expand Down Expand Up @@ -315,19 +323,19 @@ shift
if [ -z "$command" ]; then
echo -e "\nERROR - no command\n"
mg_help
return 1
exit 1
elif [ "$command" == "init" ]; then
if [[ -n "$MUSE_WORKING_DIR" && "$PWD" != "$MUSE_WORKING_DIR" ]]; then
# if muse setup was run, the only reasonable place to run init is the working dir
echo -e "\nERROR - muse setup has been run, please cd to MUSE_WORKING_DIR to init\n"
return 1
exit 1
fi
elif [ "$command" != "help" ]; then
THISDIR=$( basename $PWD)
if [[ "$THISDIR" != "Offline" || ! -d .git ]]; then
# all other commands are run in Offline directory
echo -e "\nERROR - mgit must be run in an Offline repo area\n"
return 1
exit 1
fi
fi

Expand Down Expand Up @@ -356,4 +364,5 @@ case "$command" in
;;
esac

exit 0

1 change: 1 addition & 0 deletions bin/museBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ fi

cd $MUSE_WORK_DIR

mkdir -p $MUSE_BUILD_DIR
echo -n "$(date +'%D %H:%M:%S to ')" > $MUSE_BUILD_DIR/.musebuild


Expand Down
38 changes: 21 additions & 17 deletions bin/museSetup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/bash -x
#
# script to drive the muse command to setup and build Mu2e analysis repos
#
Expand Down Expand Up @@ -188,35 +188,39 @@ fi

if [ -z "$MUSE_ENVSET" ]; then
# look for a local recommendation in a package
DIRS=$( find $MUSE_WORK_DIR -maxdepth 1 -mindepth 1 -type d | sed 's|\./||' |\
DIRS=$( find -L . ./link -maxdepth 2 -name .muse | sed -e 's|^\./||' -e 's|/\.muse$||' |\
awk '{if($1!="Offline" && $1!="link/Offline") print $0}' )
# check these first
[ -d link/Offline ] && DIRS="link/Offline $DIRS"
[ -d Offline ] && DIRS="Offline $DIRS"
# put these in the front of the search list
[ -f link/Offline/.muse ] && DIRS="link/Offline $DIRS"
[ -f Offline/.muse ] && DIRS="Offline $DIRS"

WARN=false
for DIR in $DIRS ; do

if [ -f $DIR/.muse ]; then
WORD=$( cat $DIR/.muse | \
awk '{if($1=="ENVSET") print $2}' )
if [ -n "$WORD" ]; then
export MUSE_ENVSET=$WORD
if [ $MUSE_VERBOSE -gt 0 ]; then
echo "INFO - using environment $MUSE_ENVSET from"
echo " \$MUSE_WORK_DIR/$DIR/.muse"
fi
break
WORD=$( cat $DIR/.muse | \
awk '{if($1=="ENVSET") print $2}' )
if [[ -n "$WORD" && -z "$MUSE_ENVSET" ]]; then
# take the first in this loop
export MUSE_ENVSET=$WORD
if [ $MUSE_VERBOSE -gt 0 ]; then
echo "INFO - using environment $MUSE_ENVSET from"
echo " \$MUSE_WORK_DIR/$DIR/.muse"
fi
fi
[[ -n "$WORD" && -n "$MUSE_ENVSET" && "$WORD" != "$MUSE_ENVSET" ]] && WARN=true

done

if [ "$WARN" == "true" ]; then
echo "WARNING - local or linked packages have conflicting ENVSET recommendations"
echo " in .muse files. Using $MUSE_ENVSET selected by search algorithm."
fi

fi

if [ -z "$MUSE_ENVSET" ]; then
if [[ -z "$MUSE_ENVSET" && -d $MUSE_WORK_DIR/muse ]]; then

# take the latest from the env sets in the user area

WORD=$( find $MUSE_WORK_DIR/muse -maxdepth 1 -type f -regex ".*u[0-9]..$" -printf "%f\n" | sort | tail -1 )
if [ -n "$WORD" ]; then
export MUSE_ENVSET=$WORD
Expand Down
19 changes: 18 additions & 1 deletion bin/museTarball.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ eval set -- "$PARAMS"

TMPDIR=/mu2e/data/users/$USER/museTarball
EXPORTDIR=/mu2e/data/users/$USER/museTarball
#EXPORTDIR=/pnfs/mu2e/resilient/users/$USER/museTarball
RELEASE=false

while true
Expand Down Expand Up @@ -194,5 +193,23 @@ fi

echo Tarball: $EXPORTSDIR/Code.tar.bz2

#
# finally, give the user a warning if the tarball areas are filling up
#

SIZE=$( du -ms $TMPDIR | awk '{print $1}' )
if [ $SIZE -gt 5000 ]; then
echo "WARNING - more than 5 GB in temp dir $TMPDIR"
fi
if [ "$TMPDIR" != "$EXPORTDIR" ]; then
SIZE=$( du -ms $EXPORTDIR | awk '{print $1}' )
if [ $SIZE -gt 5000 ]; then
echo "WARNING - more than 5 GB in export dir $EXPORTDIR"
fi
fi

#EXPORTDIR=/pnfs/mu2e/resilient/users/$USER/museTarball


exit 0

83 changes: 83 additions & 0 deletions config/p001
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

# the lines starting with two hashes are documentation which can be printed
## Adding KinKal 4/1/2021

#
# use preferred build type, if none requested
#
if [ -z "$MUSE_BUILD" ]; then
export MUSE_BUILD=prof
if [ $MUSE_VERBOSE -gt 0 ]; then
echo "INFO - MUSE_BUILD defaulting to $MUSE_BUILD in $MUSE_ENVSET"
fi
fi

#
# use preferred compiler, if none requested
#
if [ -z "$MUSE_COMPILER_E" ]; then
export MUSE_COMPILER_E=e20
if [ $MUSE_VERBOSE -gt 0 ]; then
echo "INFO - MUSE_COMPILER_E defaulting to $MUSE_COMPILER_E in $MUSE_ENVSET"
fi
fi

#
# use preferred python flag, if none requested
#
if [ -z "$MUSE_PYTHON" ]; then
export MUSE_PYTHON=p383b
if [ $MUSE_VERBOSE -gt 0 ]; then
echo "INFO - MUSE_PYTHON defaulting to $MUSE_PYTHON in $MUSE_ENVSET"
fi
fi

# art
# these two lines must be coordinated
setup -B art_root_io v1_05_01 -q${MUSE_BUILD}:+${MUSE_COMPILER_E}
export MUSE_ART=s105


#
# geant4
#
GFLAGS=+${MUSE_BUILD}:+${MUSE_COMPILER_E}
if [ -z "$MUSE_G4ST" ]; then
GFLAGS=${GFLAGS}:+mt
fi
if [ -n "$MUSE_G4VG" ]; then
GFLAGS=${GFLAGS}:+vg
fi
if [ "$MUSE_G4VIS" == "qt" ]; then
GFLAGS=${GFLAGS}:+qt
fi

setup -B geant4 v4_10_6_p02b -q${GFLAGS}

#
# everything else
#

setup -B xerces_c v3_2_3 -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}
setup -B mu2e_artdaq_core v1_05_04 -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}:+${MUSE_ART}:offline
setup -B heppdt v03_04_02 -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}
setup -B BTrk v1_02_30 -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}:+${MUSE_PYTHON}
setup -B KinKal v00_01_04 -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}:+${MUSE_PYTHON}
setup -B cry v1_7n -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}
setup -B gsl v2_6a
setup curl v7_64_1
setup cryptopp v08_02_00 -q +${MUSE_BUILD}:+${MUSE_COMPILER_E}
setup -B scons v3_1_2 -q +${MUSE_PYTHON}
setup -B gdb v9_2


setup -B gallery v1_16_01 -q+${MUSE_BUILD}:+${MUSE_COMPILER_E}
#setup -B ifdhc v2_5_8 -q e20:p383b:prof
setup -B cetbuildtools v7_17_01
setup -B valgrind v3_16_1
setup -B cmake v3_17_3

# Local Variables:
# mode: sh
# End:
# vi:syntax=sh
1 change: 1 addition & 0 deletions python/sconstruct_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def cppPath(mu2eOpts):
os.environ['ART_ROOT_IO_INC'],
os.environ['CANVAS_INC'],
os.environ['BTRK_INC'],
os.environ['KINKAL_INC'],
os.environ['MESSAGEFACILITY_INC'],
os.environ['FHICLCPP_INC'],
os.environ['HEP_CONCURRENCY_INC'],
Expand Down

0 comments on commit 4602bc6

Please sign in to comment.