Skip to content

Commit

Permalink
Merge pull request #111 from rlcee/ldd_240628
Browse files Browse the repository at this point in the history
add LD_LIBRARY_PATH for ntuples
  • Loading branch information
rlcee authored Jun 29, 2024
2 parents e63c6a9 + 166629a commit 7950061
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions bin/museSetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,16 @@ export MUSE_LINK_ORDER=$(cat $TEMP | sed 's/#.*$//' | tr "\n\t" " " | tr -s " "
MUSE_REPOS=""
MUSE_LOCAL_REPOS=""

# in spack, the root ntuples need LD_LIBRARY_PATH set to find dictionaries
NEED_NTUPLE_LDD=""
NTUPLE_LDD=""

for BDIR in $MUSE_BACKING_REV $MUSE_WORK_DIR
do

# add the paths that point to the build areas
if [ $MUSE_VERBOSE -gt 0 ]; then
echo "Adding build area paths for $BDIR"
echo "INFO - Adding build area paths for $BDIR"
fi
export MU2E_SEARCH_PATH=$( mdropit $MU2E_SEARCH_PATH $BDIR )
export FHICL_FILE_PATH=$( mdropit $FHICL_FILE_PATH $BDIR )
Expand Down Expand Up @@ -620,7 +624,7 @@ do
BUILD=$BDIR/build/$MUSE_STUB/$REPO

if [ $MUSE_VERBOSE -gt 0 ]; then
echo "Adding repo path $BUILD"
echo "INFO - Adding repo path $BUILD"
fi

# create INC variables for each Muse repo
Expand All @@ -637,7 +641,6 @@ do
export MU2E_SEARCH_PATH=$( mdropit $MU2E_SEARCH_PATH $TEMP )
fi


# libraries built in each package
if [ "$MU2E_SPACK" ]; then
export MUSE_LIBRARY_PATH=$( mdropit $MUSE_LIBRARY_PATH $BUILD/lib )
Expand Down Expand Up @@ -675,11 +678,31 @@ do
export FHICL_FILE_PATH=$( mdropit $FHICL_FILE_PATH $RDIR/$PA )
done

# if the repo has the ROOT_NTUPLE flag, then add its libraries to the LD_LIBRARY_PATH
RNT_TEST=$(cat $RDIR/.muse | awk '{if($1=="ROOT_NTUPLE") print "RNT"}')
if [ "$RNT_TEST" ]; then
NEED_NTUPLE_LDD="true"
export NTUPLE_LDD=$( mdropit $NTUPLE_LDD $BUILD/lib )
fi
if [ "$REPO" == "Offline" ]; then
# building LD_LIBRARY_PATH for root ntuples in spack
export NTUPLE_LDD=$( mdropit $NTUPLE_LDD $BUILD/lib )
fi


done # loop over repos in a build area


done # big loop over backing build dirs

# if there is a root ntuple in the build and this is spack, then add Offline and the ntuple repo
# to LD_LIBRARY_PATH so root can find dictionaries
if [[ "$MU2E_SPACK" && "$NEED_NTUPLE_LDD" ]]; then
[ $MUSE_VERBOSE -gt 0 ] && echo "INFO - Adding LD_LIBRARY_PATH for root ntuples in spack mode"
export LD_LIBRARY_PATH=$( mdropit $LD_LIBRARY_PATH $NTUPLE_LDD )
fi


# clean whitespace
export MUSE_LINK_ORDER=$(echo $MUSE_LINK_ORDER)
export MUSE_REPOS=$(echo $MUSE_REPOS)
Expand Down

0 comments on commit 7950061

Please sign in to comment.