@@ -36,6 +36,13 @@ Source: git+https://github.com/%{github_user}/tensorflow.git?obj=%{branch}/%{tag
36
36
%setup -q -n tensorflow-%{realversion}
37
37
sed -i -e 's|lib/python[^/]*/site-packages/|lib/python%{cms_python3_major_minor_version}/site-packages/|' third_party/systemlibs/pybind11.BUILD
38
38
39
+ #EL7: Include stdarg.h before zlib.h to avoid 'va_list' has not been declared error.
40
+ %if 0%{?rhel} == 7
41
+ sed -i -e 's|#include <zlib.h>|#include <stdarg.h>\n#include <zlib.h>|' \
42
+ third_party/xla/third_party/tsl/tsl/lib/io/zlib_outputbuffer.h \
43
+ tensorflow/core/lib/png/png_io.cc
44
+ %endif
45
+
39
46
%build
40
47
41
48
export PYTHON_BIN_PATH="$(which python3)"
@@ -144,6 +151,8 @@ export PYTHONPATH=$PYTHON3PATH
144
151
145
152
./configure
146
153
# build tensorflow python targets
154
+ bazel $BAZEL_OPTS @ducc//:fft
155
+ bazel $BAZEL_OPTS @ducc//:fft_wrapper
147
156
bazel $BAZEL_OPTS //tensorflow/tools/pip_package:build_pip_package
148
157
bazel $BAZEL_OPTS //tensorflow:tensorflow
149
158
bazel $BAZEL_OPTS //tensorflow:tensorflow_cc
@@ -180,10 +189,13 @@ mkdir -p $bindir $incdir $libdir
180
189
181
190
# copy targets
182
191
srcdir="$PWD/bazel-bin/tensorflow"
192
+ srcdir_ext="$PWD/bazel-bin/external"
183
193
184
194
cp -p $srcdir/libtensorflow*.so* $libdir/
185
195
cp -p $srcdir/compiler/tf2xla/lib*.so* $libdir/
186
196
197
+ cp -p ${srcdir_ext}/ducc/*.so $libdir/
198
+
187
199
for l in tensorflow_cc tensorflow_framework tensorflow ; do
188
200
# check if the actual lib exists
189
201
[ -f $libdir/lib${l}.so.%{tfversion} ] || exit 1
225
237
#FIXME: Create missing externals links
226
238
pushd bazel-tensorflow-%{realversion}/external
227
239
srcdir=$(dirname $(readlink zlib))
228
- for e in ducc farmhash_gpu_archive stablehlo ; do
240
+ for e in ducc farmhash_gpu_archive stablehlo cudnn_frontend_archive ; do
229
241
echo "Check external link: $e"
230
242
if [ -e ${srcdir}/$e ] ; then
231
243
if [ ! -e $e ] ; then
@@ -236,6 +248,14 @@ pushd bazel-tensorflow-%{realversion}/external
236
248
done
237
249
popd
238
250
239
- # create the wheel file that is installed in py2 -tensorflow
251
+ # create the wheel file that is installed in py3 -tensorflow
240
252
export PYTHONPATH=$PYTHON3PATH
241
253
bash -ex bazel-bin/tensorflow/tools/pip_package/build_pip_package %{i}
254
+
255
+ mkdir %{i}/lib-xla-runtime
256
+ cp $outdir/lib/libfft.so %{i}/lib-xla-runtime
257
+ cp $outdir/lib/libfft_wrapper.so %{i}/lib-xla-runtime
258
+ find $srcdir/.. -name 'libmutex.pic.a' -path '*k8-opt/bin/external/local_tsl*' -exec cp {} %{i}/lib-xla-runtime \;
259
+ find $srcdir/.. -name 'libnsync_cpp.pic.a' -path '*k8-opt*' -exec cp {} %{i}/lib-xla-runtime \;
260
+ [ -e %{i}/lib-xla-runtime/libmutex.pic.a ]
261
+ [ -e %{i}/lib-xla-runtime/libnsync_cpp.pic.a ]
0 commit comments