Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tf_cuda_support tool if TF is build with cuda support #9077

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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