diff --git a/pip/tensorflow.file b/pip/tensorflow.file
index 63f7bfca211..80bd7e135c8 100644
--- a/pip/tensorflow.file
+++ b/pip/tensorflow.file
@@ -1,7 +1,7 @@
Requires: py3-tensorboard py3-opt-einsum py3-tensorflow-estimator py3-wrapt py3-google-pasta py3-scipy
Requires: tensorflow-sources
%define PipPreBuildPy PIPFILE=${TENSORFLOW_SOURCES_ROOT}/tensorflow-%{realversion}-cp%{cms_python3_major_minor}-cp%{cms_python3_major_minor}-linux_%{_arch}.whl
-%define PipPostBuild rm -f %{i}/bin/tensorboard* ; rm -r %{i}/lib/python%{cms_python3_major_minor_version}/site-packages/tensorflow/xla_aot_runtime_src ; ls %{i}/bin/* | xargs -i mv '{}' '{}3'
+%define PipPostBuild rm -f %{i}/bin/tensorboard* ; ls %{i}/bin/* | xargs -i mv '{}' '{}3'
%define PipDepsPost | grep -v libclang
## INCLUDE tensorflow-requires
Requires: py3-funcsigs py3-pbr py3-packaging py3-appdirs py3-pyparsing py3-mock py3-Werkzeug
@@ -19,7 +19,8 @@ Requires: llvm
%define PipPostInstall \
for f in %{RelocateFiles} ; do \
[ ! -f %{i}/$f ] || sed -i -e 's|/[^ ]*/%{cmsplatf}/external/|%{cmsroot}/%{cmsplatf}/external/|' %{i}/$f \
- done
+ done ; \
+ sed -i 's/assert((arg_size(index)/assert(((size_t)arg_size(index)/' %{i}/lib/python%{cms_python3_major_minor_version}/site-packages/tensorflow/include/tensorflow/compiler/tf2xla/xla_compiled_cpu_function.h
%define PipPostPost \
for f in %{RelocateFiles} ; do \
diff --git a/scram-tools.file/tools/py3-tensorflow/py3-tensorflow.xml b/scram-tools.file/tools/py3-tensorflow/py3-tensorflow.xml
new file mode 100644
index 00000000000..944d82f7fbb
--- /dev/null
+++ b/scram-tools.file/tools/py3-tensorflow/py3-tensorflow.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/scram-tools.file/tools/py3-tensorflow/tensorflow-includes.xml b/scram-tools.file/tools/py3-tensorflow/tensorflow-includes.xml
new file mode 100644
index 00000000000..588e64bb8ba
--- /dev/null
+++ b/scram-tools.file/tools/py3-tensorflow/tensorflow-includes.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/scram-tools.file/tools/tensorflow-xla-runtime/tensorflow-xla-runtime.xml b/scram-tools.file/tools/tensorflow-xla-runtime/tensorflow-xla-runtime.xml
index 2976fcb58b4..1eb48313f87 100644
--- a/scram-tools.file/tools/tensorflow-xla-runtime/tensorflow-xla-runtime.xml
+++ b/scram-tools.file/tools/tensorflow-xla-runtime/tensorflow-xla-runtime.xml
@@ -6,4 +6,5 @@
+
diff --git a/scram-tools.file/tools/tensorflow-xla-runtime/vectorized.tmpl b/scram-tools.file/tools/tensorflow-xla-runtime/vectorized.tmpl
new file mode 100644
index 00000000000..505109e960f
--- /dev/null
+++ b/scram-tools.file/tools/tensorflow-xla-runtime/vectorized.tmpl
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/tensorflow-xla-runtime.spec b/tensorflow-xla-runtime.spec
index 5bc996e5bf2..079795866e2 100644
--- a/tensorflow-xla-runtime.spec
+++ b/tensorflow-xla-runtime.spec
@@ -1,32 +1,23 @@
### RPM external tensorflow-xla-runtime 2.12.0
+## INCLUDE cpp-standard
-Requires: eigen tensorflow-sources
+Requires: eigen py3-tensorflow
BuildRequires: cmake
%prep
-unzip -q -o ${TENSORFLOW_SOURCES_ROOT}/tensorflow-%{realversion}-cp%{cms_python3_major_minor}-cp%{cms_python3_major_minor}-linux_%{_arch}.whl
-%build
+cp -r ${PY3_TENSORFLOW_ROOT}/lib/python%{cms_python3_major_minor_version}/site-packages/tensorflow .
-# fix a single comparison between size_t and int
-sed -i -r 's/assert\(\(arg_size\(index\)/assert\(\(\(size_t\)arg_size\(index\)/' tensorflow/include/tensorflow/compiler/tf2xla/xla_compiled_cpu_function.h
+%build
export CPATH="${CPATH}:${EIGEN_ROOT}/include/eigen3"
-export CPATH="${CPATH}:%{i}/tensorflow/include"
-export CPATH="${CPATH}:%{i}/tensorflow/include/third_party/eigen3"
pushd tensorflow/xla_aot_runtime_src
- cmake . -DCMAKE_CXX_FLAGS="-fPIC -msse3"
+ cmake . -DCMAKE_CXX_FLAGS="-fPIC -msse3" -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DBUILD_SHARED_LIBS=OFF
make %{makeprocesses}
- # this builds a shared library, but when used some symbols are missig (e.g `tsl::mutex::unlock()')
- # so it does not seem intended to be used as a shared lib
- gcc -shared -o libtf_xla_runtime.so -Wl,--whole-archive libtf_xla_runtime.a -Wl,--no-whole-archive
popd
%install
-mv tensorflow/include %{i}
-
mkdir -p %{i}/lib/archive
mv tensorflow/xla_aot_runtime_src/libtf_xla_runtime.a %{i}/lib/archive/libtf_xla_runtime-static.a
-mv tensorflow/xla_aot_runtime_src/libtf_xla_runtime.so %{i}/lib/libtf_xla_runtime.so