From 720bf837a6cc11adc9afef270b823aacb8a07ee7 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Mon, 28 Oct 2024 10:58:07 +0100 Subject: [PATCH] add bin/python for multi-vector builds --- scram-project-build.file | 2 +- .../tools/OpenBLAS/vectorized.tmpl | 1 + scram-tools.file/tools/cmssw/cmssw.xml | 1 - scram-tools.file/tools/coral/coral.xml | 1 - scram-tools.file/tools/lwtnn/vectorized.tmpl | 1 + scram-tools.file/tools/opencv/vectorized.tmpl | 1 + scram-tools.file/tools/rivet/rivet.xml | 36 ++++++++-------- scram-tools.file/tools/rivet/vectorized.tmpl | 1 + .../tools/tensorflow/vectorized.tmpl | 1 + scram/tool-conf-src.file | 42 ++++++++++++++----- 10 files changed, 56 insertions(+), 31 deletions(-) diff --git a/scram-project-build.file b/scram-project-build.file index 6a902a02a8c..d7d0eb83a0d 100644 --- a/scram-project-build.file +++ b/scram-project-build.file @@ -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" diff --git a/scram-tools.file/tools/OpenBLAS/vectorized.tmpl b/scram-tools.file/tools/OpenBLAS/vectorized.tmpl index 8c20d40a7f2..aab35d9abe7 100644 --- a/scram-tools.file/tools/OpenBLAS/vectorized.tmpl +++ b/scram-tools.file/tools/OpenBLAS/vectorized.tmpl @@ -1,5 +1,6 @@ + diff --git a/scram-tools.file/tools/cmssw/cmssw.xml b/scram-tools.file/tools/cmssw/cmssw.xml index 53a20400515..9fc205d9a5c 100644 --- a/scram-tools.file/tools/cmssw/cmssw.xml +++ b/scram-tools.file/tools/cmssw/cmssw.xml @@ -11,7 +11,6 @@ - diff --git a/scram-tools.file/tools/coral/coral.xml b/scram-tools.file/tools/coral/coral.xml index 4bd5f88edc3..ffc0f65b734 100644 --- a/scram-tools.file/tools/coral/coral.xml +++ b/scram-tools.file/tools/coral/coral.xml @@ -5,7 +5,6 @@ - diff --git a/scram-tools.file/tools/lwtnn/vectorized.tmpl b/scram-tools.file/tools/lwtnn/vectorized.tmpl index bf1f5e0e3eb..e2b7ba305ab 100644 --- a/scram-tools.file/tools/lwtnn/vectorized.tmpl +++ b/scram-tools.file/tools/lwtnn/vectorized.tmpl @@ -2,4 +2,5 @@ + diff --git a/scram-tools.file/tools/opencv/vectorized.tmpl b/scram-tools.file/tools/opencv/vectorized.tmpl index 438cbea6312..d56fb3cfacf 100644 --- a/scram-tools.file/tools/opencv/vectorized.tmpl +++ b/scram-tools.file/tools/opencv/vectorized.tmpl @@ -1,5 +1,6 @@ + diff --git a/scram-tools.file/tools/rivet/rivet.xml b/scram-tools.file/tools/rivet/rivet.xml index f0d4eb311d1..d300c183c86 100644 --- a/scram-tools.file/tools/rivet/rivet.xml +++ b/scram-tools.file/tools/rivet/rivet.xml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/scram-tools.file/tools/rivet/vectorized.tmpl b/scram-tools.file/tools/rivet/vectorized.tmpl index 908580e7064..38db31510be 100644 --- a/scram-tools.file/tools/rivet/vectorized.tmpl +++ b/scram-tools.file/tools/rivet/vectorized.tmpl @@ -2,4 +2,5 @@ + diff --git a/scram-tools.file/tools/tensorflow/vectorized.tmpl b/scram-tools.file/tools/tensorflow/vectorized.tmpl index 709e5ea6f71..8b868606734 100644 --- a/scram-tools.file/tools/tensorflow/vectorized.tmpl +++ b/scram-tools.file/tools/tensorflow/vectorized.tmpl @@ -2,4 +2,5 @@ + diff --git a/scram/tool-conf-src.file b/scram/tool-conf-src.file index 30e7f84c13d..fc7c01215ed 100644 --- a/scram/tool-conf-src.file +++ b/scram/tool-conf-src.file @@ -78,16 +78,6 @@ if [ -e $SCRAMV1_ROOT/bin/chktool ] ; then fi echo '' > %{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 ' ' >> %{i}/tools/selected/python-paths.xml -fi if [ "${PYTHON3PATH}" != "" ] ; then py3List=`echo ${PYTHON3PATH} | tr ':' '\n'` @@ -100,6 +90,38 @@ if [ "${PYTHON3PATH}" != "" ] ; then echo ' ' >> %{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 ' ' >> %{i}/tools/selected/python-paths.xml + done +done +%endif +%endif + echo '' >> %{i}/tools/selected/python-paths.xml ALL_PY_BIN=""