Skip to content

Commit

Permalink
add bin/python for multi-vector builds
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Oct 28, 2024
1 parent f7cfdba commit 720bf83
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 31 deletions.
2 changes: 1 addition & 1 deletion scram-project-build.file
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BuildRequires: dwz
%endif

%if "%{?configtag:set}" != "set"
%define configtag V09-04-23
%define configtag V09-05-00
%endif

%if "%{?buildarch:set}" != "set"
Expand Down
1 change: 1 addition & 0 deletions scram-tools.file/tools/OpenBLAS/vectorized.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<tool name="openblas_@TOOL_VECTORIZATION@" version="@TOOL_VERSION@">
<client>
<environment name="@TOOL_VECTORIZATION_KEY@_LIBDIR" default="@TOOL_ROOT@/lib"/>
<environment name="@TOOL_VECTORIZATION_KEY@_BINDIR" default="@TOOL_ROOT@/bin"/>
</client>
</tool>
1 change: 0 additions & 1 deletion scram-tools.file/tools/cmssw/cmssw.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<runtime name="@OS_RUNTIME_LDPATH_NAME@" value="$CMSSW_BASE/lib/$SCRAM_ARCH" type="path"/>
<runtime name="RIVET_ANALYSIS_PATH" value="$LOCALTOP/lib/$SCRAM_ARCH" type="path"/>
<runtime name="PATH" value="$CMSSW_BINDIR" type="path"/>
<runtime name="PYTHON3PATH" value="$CMSSW_BASE/lib/$SCRAM_ARCH" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$CMSSW_BASE/src" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$CMSSW_BASE/include/$SCRAM_ARCH/include" type="path" handler="warn"/>
<runtime name="CMSSW_FULL_RELEASE_BASE" value="$CMSSW_BASE"/>
Expand Down
1 change: 0 additions & 1 deletion scram-tools.file/tools/coral/coral.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<environment name="INCLUDE" default="$CORAL_BASE/include/LCG"/>
</client>
<runtime name="PYTHON3PATH" default="$CORAL_BASE/$SCRAM_ARCH/python" type="path"/>
<runtime name="PYTHON3PATH" default="$CORAL_BASE/$SCRAM_ARCH/lib" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="root_cxxdefaults"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/lwtnn/vectorized.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<client>
<environment name="@TOOL_VECTORIZATION_KEY@_LIBDIR" default="@TOOL_ROOT@/lib"/>
</client>
<runtime name="@TOOL_VECTORIZATION_KEY@_PATH" value="@TOOL_ROOT@/bin" type="path"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/opencv/vectorized.tmpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<tool name="opencv_@TOOL_VECTORIZATION@" version="@TOOL_VERSION@">
<client>
<environment name="@TOOL_VECTORIZATION_KEY@_LIBDIR" default="@TOOL_ROOT@/lib"/>
<environment name="@TOOL_VECTORIZATION_KEY@_BINDIR" default="@TOOL_ROOT@/bin"/>
</client>
</tool>
36 changes: 18 additions & 18 deletions scram-tools.file/tools/rivet/rivet.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<tool name="rivet" version="@TOOL_VERSION@">
<lib name="Rivet"/>
<client>
<environment name="RIVET_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$RIVET_BASE/lib"/>
<environment name="INCLUDE" default="$RIVET_BASE/include"/>
</client>
<runtime name="PATH" value="$RIVET_BASE/bin" type="path"/>
<runtime name="RIVET_DATA_PATH" value="$RIVET_BASE/share/Rivet" type="path"/>
<runtime name="PDFPATH" default="$RIVET_BASE/share" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="hepmc"/>
<use name="fastjet"/>
<use name="fastjet-contrib"/>
<use name="gsl"/>
<use name="yoda"/>
<use name="hdf5"/>
<use name="highfive"/>
<use name="onnxruntime"/>
<lib name="Rivet"/>
<client>
<environment name="RIVET_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$RIVET_BASE/lib"/>
<environment name="INCLUDE" default="$RIVET_BASE/include"/>
</client>
<runtime name="PATH" value="$RIVET_BASE/bin" type="path"/>
<runtime name="RIVET_DATA_PATH" value="$RIVET_BASE/share/Rivet" type="path"/>
<runtime name="PDFPATH" default="$RIVET_BASE/share" type="path"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="hepmc"/>
<use name="fastjet"/>
<use name="fastjet-contrib"/>
<use name="gsl"/>
<use name="yoda"/>
<use name="hdf5"/>
<use name="highfive"/>
<use name="onnxruntime"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/rivet/vectorized.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<client>
<environment name="@TOOL_VECTORIZATION_KEY@_LIBDIR" default="@TOOL_ROOT@/lib"/>
</client>
<runtime name="@TOOL_VECTORIZATION_KEY@_PATH" value="@TOOL_ROOT@/bin" type="path"/>
</tool>
1 change: 1 addition & 0 deletions scram-tools.file/tools/tensorflow/vectorized.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<client>
<environment name="@TOOL_VECTORIZATION_KEY@_LIBDIR" default="@TOOL_ROOT@/lib"/>
</client>
<runtime name="@TOOL_VECTORIZATION_KEY@_PATH" value="@TOOL_ROOT@/bin" type="path"/>
</tool>
42 changes: 32 additions & 10 deletions scram/tool-conf-src.file
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ if [ -e $SCRAMV1_ROOT/bin/chktool ] ; then
fi

echo '<tool name="python-paths" version="1.0">' > %{i}/tools/selected/python-paths.xml
if [ "${PYTHON27PATH}" != "" ] ; then
py27List=`echo ${PYTHON27PATH} | tr ':' '\n'`
mkdir -p %{i}/${PYTHON_LIB_SITE_PACKAGES}
touch %{i}/${PYTHON_LIB_SITE_PACKAGES}/tool-deps.pth
for pkg in ${py27List} ; do
echo "adding $pkg"
echo "$pkg" >> %{i}/${PYTHON_LIB_SITE_PACKAGES}/tool-deps.pth
done
echo ' <runtime name="PYTHON27PATH" value="%{i}/'${PYTHON_LIB_SITE_PACKAGES}'" type="path"/>' >> %{i}/tools/selected/python-paths.xml
fi

if [ "${PYTHON3PATH}" != "" ] ; then
py3List=`echo ${PYTHON3PATH} | tr ':' '\n'`
Expand All @@ -100,6 +90,38 @@ if [ "${PYTHON3PATH}" != "" ] ; then
echo ' <runtime name="PYTHON3PATH" value="%{i}/'${PYTHON3_LIB_SITE_PACKAGES}'" type="path"/>' >> %{i}/tools/selected/python-paths.xml
fi

%if "%{package_vectorization}"
%if "%{vectorized_packages}"
for pth in %{i}/${PYTHON_LIB_SITE_PACKAGES}/tool-deps.pth %{i}/${PYTHON3_LIB_SITE_PACKAGES}/tool-deps.pth ; do
[ -f ${pth} ] || continue
dir=$(dirname $pth)
for tool in %{vectorized_packages} ; do
for vec in %{package_vectorization} ; do
uctool=`echo ${tool}_${vec}_ROOT | tr '[a-z-]' '[A-Z_]'`
toolbase=`eval echo \\$${uctool}`
if [ $(grep "${toolbase}/" ${pth} |wc -l) -gt 0 ] ; then
mkdir -p ${dir}/scram_${vec}
grep "${toolbase}/" ${pth} >> ${dir}/scram_${vec}/tool-deps.pth
sed -i -e "\#^${toolbase}#d" ${pth}
fi
done
done
done
for vec in default %{package_vectorization} ; do
xvar=`echo ${vec}_${vec}_ROOT | tr '[a-z-]' '[A-Z_]'`
for item in PYTHON3PATH:${PYTHON3_LIB_SITE_PACKAGES} ; do
pydir=$(echo $item | sed 's|.*:||')
dir=%{i}/${pydir}/${vec}
[ "${vec}" != "default" ] && dir=%{i}/${pydir}/scram_${vec}
[ -f ${dir}/tool-deps.pth ] || continue
var=$(echo $item | sed 's|:.*||')
xvar=`echo ${vec}_${var} | tr '[a-z-]' '[A-Z_]'`
echo ' <runtime name="'${xvar}'" value="'${dir}'" type="path"/>' >> %{i}/tools/selected/python-paths.xml
done
done
%endif
%endif

echo '</tool>' >> %{i}/tools/selected/python-paths.xml

ALL_PY_BIN=""
Expand Down

0 comments on commit 720bf83

Please sign in to comment.