Update rivet.sh - set 3rd party paths via script, not _ROOT env#5264
Conversation
|
Hello @cholmcc, thanks for your investigation on such matters ! I mean,
What I would have foreseen:
Currently I get that your side bash script
Following what we would have done previously (like for alisw/rivet/3.1.6), we would have patched the rivet source Sorry, I may be slow to learn on such matters. |
Whoops, `grep`'ed for `cgal` where I wanted to grep for `GMP`.
|
Hi Antonin,
Yes, if the run-time module defines
I don't think that was Guilio's suggestion:
However, looking at the comment again, I see
so I guess you are also right. It's a good point that the recipe should in some sense be independent of cat <<EOF > 3rdparty.sh
# Define locations of 3rd party software
HEPMC3_ROOT=\`HepMC3-config --prefix\`
YODA_ROOT=\`yoda-config --prefix\`
FASTJET_ROOT=\`fastjet-config --prefix\`
CGAL_ROOT=\$(dirname \$(dirname \`which cgal_create_CMakeLists\`))
GMP_ROOT=\$(dirname \`echo \$LD_LIBRARY_PATH| tr ':' '\n' | grep GMP\`)
EOF
source 3rdparty.sh
CGAL_LDFLAGS="-L${CGAL_ROOT}/lib"
GMP_LDFLAGS="-L${GMP_ROOT}/lib"
LOCAL_LDFLAGS="${CGAL_LDFLAGS} ${GMP_LDFLAGS}"
case $ARCHITECTURE in
osx*)
./configure --prefix="$INSTALLROOT" \
--disable-silent-rules \
--disable-doxygen \
--with-yoda="$YODA_ROOT" \
--with-hepmc3="$HEPMC3_ROOT" \
--with-fastjet="$FASTJET_ROOT" \
LDFLAGS="${LOCAL_LDFLAGS}"
;;
*)
LOCAL_LDFLAGS="${LOCAL_LDFLAGS} -Wl,--no-as-needed"
./configure --prefix="$INSTALLROOT" \
--disable-silent-rules \
--disable-doxygen \
--with-yoda="$YODA_ROOT" \
--with-hepmc3="$HEPMC3_ROOT" \
--with-fastjet="$FASTJET_ROOT" \
LDFLAGS="${LOCAL_LDFLAGS}" \
CYTHON="$PYTHON_MODULES_ROOT/share/python-modules/bin/cython"
;;
esacand then later on, after cp 3rdparty.sh $INSTALLROOT/etc/3rdparty.shI.e., use the same approach (and script 😄) at both build- and run-time.
cat $INSTALLROOT/bin/rivet-config | sed -e "$SED_EXPR" > $INSTALLROOT/bin/rivet-config.0
csplit $INSTALLROOT/bin/rivet-config.0 '/^datarootdir=/+1'
cat xx00 source3rd xx01 > $INSTALLROOT/bin/rivet-config
chmod 0755 $INSTALLROOT/bin/rivet-configThat is, I
The installed script snippet
Correct, as it is now. However, see also above for how to make the recipe even more robust.
The goal is not to "insert the script [3rdparty.sh]" into the installed
Of course, the content of but I think I like the flexibility of a separate script snippet.
Partially correct. Instead of at run-time relying on
This is the line that is added to Perhaps it is worth to stipulate that
Yes, that's one way to go about it. However, here I prefer to more-or-less Monkey-patch, which allows us to use upstream code and only change the things that we absolutely need.
What I do, especially following Giulio's suggestion, is actually a step better than that. In that patching up, Antonio relied on specific environment variables (
You are right in that at build-time, there's still a dependency on the
No worries - I do play a few tricks, but not hazardly 😄 Yours, |
Following discussion on this MR, I made some changes so that at build-time, we deduce variables in same way as done at run-time (uses the same script snippet). The script snippet has been made more robust, and will exit out (build, rivet-config, rivet-build) in case of problems. If variables are set before hand (e.g., `HEPMC3_ROOT` is already set), then that value is used as-is.
|
The failure of The script snippet |
|
Hi all, This last commit fixed the build issue. The question is if this will also fix the run-time issue 😄 To settle that, I guess we need a merge and deployment on LXPLUS. Please let me know when I can try that out. Thanks. Yours, |
|
|
|
Thanks Christian for you detail answer (subtle tricks around...) and further investigations. |
|
Hi all, Doing in Yours, Christian |
|
Hi all, I've been away for a week or so, and I'm not quite sure were we are. Could someone remind me? Thanks. Also, as I said above, there's still some stuff left in the scripts when build on AliDist. Could someone remind me how to use Also, Merry Christmas 😄 Yours, |
…isw#5264) * Update rivet.sh - set 3rd party paths via script, not `_ROOT` env See alisw#5245 * Update rivet.sh - fixed wrong name Whoops, `grep`'ed for `cgal` where I wanted to grep for `GMP`. * Update rivet.sh - deduce variables at build-time as well as at run-time Following discussion on this MR, I made some changes so that at build-time, we deduce variables in same way as done at run-time (uses the same script snippet). The script snippet has been made more robust, and will exit out (build, rivet-config, rivet-build) in case of problems. If variables are set before hand (e.g., `HEPMC3_ROOT` is already set), then that value is used as-is. * Update rivet.sh - try to fix error in rivet_3rdparty.sh See 'env_err' test variables with 'ret=true', likely needed to make the 'source rivet_3rdparty.sh' command fly.
See #5245