Skip to content

Commit

Permalink
Merge pull request #9077 from cms-sw/backport-IB_CMSSW_14_0_X_master-…
Browse files Browse the repository at this point in the history
…9066

Add tf_cuda_support tool if TF is build with cuda support
  • Loading branch information
smuzaffar authored Mar 18, 2024
2 parents e731841 + 296ba1a commit 3fd7a09
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
23 changes: 15 additions & 8 deletions scram-tools.file/bin/get_tools
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/bin/bash -ex
#Usage: get_tool <tool-install-dir> <tool-version> <directory-to-install-toolfiles> <toolname>

function copy_tools (){
for xml in $(find $1 -type f -name "*.xml") ; do
bxml=$(basename $xml)
[ -f ${TOOLFILES_INSTALL_DIR}/tools/selected/$bxml ] && continue
[ -f ${TOOLFILES_INSTALL_DIR}/tools/available/$bxml ] && continue
cp $xml ${TOOLFILES_INSTALL_DIR}/tools/selected/${bxml}
perl -p -i -e 's|\@([a-zA-Z0-9_-]*)\@|$ENV{$1}|g' ${TOOLFILES_INSTALL_DIR}/tools/selected/${bxml}
echo " Copied $bxml"
done
}

export TOOL_ROOT=$1
export TOOL_VERSION=$2
export TOOLFILES_INSTALL_DIR=$3
Expand All @@ -16,11 +27,7 @@ if [ -f $tool_script ]; then source $tool_script; fi

#Copy all tools and replace the env placeholders @VARIABLES@
[ -d ${TOOLFILES_INSTALL_DIR}/tools/selected ] || mkdir -p ${TOOLFILES_INSTALL_DIR}/tools/selected
for xml in $(find $SCRAM_TOOL_SOURCE_DIR -type f -name "*.xml") ; do
bxml=$(basename $xml)
[ -f ${TOOLFILES_INSTALL_DIR}/tools/selected/$bxml ] && continue
[ -f ${TOOLFILES_INSTALL_DIR}/tools/available/$bxml ] && continue
cp $xml ${TOOLFILES_INSTALL_DIR}/tools/selected/${bxml}
perl -p -i -e 's|\@([a-zA-Z0-9_-]*)\@|$ENV{$1}|g' ${TOOLFILES_INSTALL_DIR}/tools/selected/${bxml}
echo " Copied $bxml"
done
copy_tools $SCRAM_TOOL_SOURCE_DIR
if [ -d ${TOOL_ROOT}/etc/scram.d ] ; then
copy_tools ${TOOL_ROOT}/etc/scram.d
fi
7 changes: 7 additions & 0 deletions tensorflow.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ esac
%install

tar xfz ${%{tf_root}}/libtensorflow_cc.tar.gz -C %{i}
%if %{enable_gpu}
mkdir -p %{i}/etc/scram.d
cat << \EOF_TOOLFILE >%{i}/etc/scram.d/tf_cuda_support.xml
<tool name="tf_cuda_support" version="1.0">
</tool>
EOF_TOOLFILE
%endif

%post
%{relocateConfig}lib/lib*.params

0 comments on commit 3fd7a09

Please sign in to comment.