forked from clearlinux-pkgs/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtensorflow.spec
318 lines (285 loc) · 15 KB
/
tensorflow.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
Name : tensorflow
Version : 2.0.1
Release : 98
URL : https://github.com/tensorflow/tensorflow/archive/v2.0.1.tar.gz
Source0 : https://github.com/tensorflow/tensorflow/archive/v2.0.1.tar.gz
Source9 : https://github.com/markdryan/eigen-git-mirror/archive/tf1.13.tar.gz
Source10 : https://bitbucket.org/eigen/eigen/get/049af2f56331.tar.gz
Source11 : https://github.com/abseil/abseil-cpp/archive/43ef2148c0936ebf7cb4be6b19927a9d9d145b8f.tar.gz
Source12 : https://github.com/hfp/libxsmm/archive/1.11.tar.gz
Source13 : https://mirror.bazel.build/github.com/google/or-tools/archive/253f7955c6a1fd805408fba2e42ac6d45b312d15.tar.gz
Source14 : https://github.com/google/re2/archive/506cfa4bffd060c06ec338ce50ea3468daa6c814.tar.gz
Source15 : https://github.com/googleapis/google-cloud-cpp/archive/v0.10.0.tar.gz
Source16 : https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz
Source17 : https://github.com/google/gemmlowp/archive/12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3.zip
Source18 : https://mirror.bazel.build/github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz
Source19 : http://mirror.bazel.build/github.com/google/highwayhash/archive/fd3d9af80465e4383162e4a7c5e2f406e82dd968.tar.gz
Source20 : https://mirror.bazel.build/www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2
Source21 : https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.0.tar.gz
Source22 : https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz
Source23 : https://www.sqlite.org/2019/sqlite-amalgamation-3300100.zip
Source24 : http://pilotfiber.dl.sourceforge.net/project/giflib/giflib-5.2.1.tar.gz
Source25 : https://mirror.bazel.build/pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz
Source26 : https://files.pythonhosted.org/packages/99/80/f9482277c919d28bebd85813c0a70117214149a96b08981b72b63240b84c/astor-0.7.1.tar.gz
Source27 : https://files.pythonhosted.org/packages/1f/04/4e36c33f8eb5c5b6c622a1f4859352a6acca7ab387257d4b3c191d23ec1d/gast-0.3.2.tar.gz
Source28 : https://mirror.bazel.build/pypi.python.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Source29 : https://github.com/abseil/abseil-py/archive/pypi-v0.7.1.tar.gz
Source30 : https://mirror.bazel.build/pypi.python.org/packages/bc/cc/3cdb0a02e7e96f6c70bd971bc8a90b8463fda83e264fa9c5c1c98ceabd81/backports.weakref-1.0rc1.tar.gz
Source31 : https://github.com/protocolbuffers/protobuf/archive/310ba5ee72661c081129eb878c1bbcec936b20f0.tar.gz
Source32 : https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/nsync/archive/1.20.2.tar.gz
Source33 : https://github.com/gflags/gflags/archive/v2.2.1.tar.gz
Source34 : https://mirror.bazel.build/ftp.exim.org/pub/pcre/pcre-8.42.tar.gz
Source35 : https://mirror.bazel.build/ufpr.dl.sourceforge.net/project/swig/swig/swig-3.0.8/swig-3.0.8.tar.gz
Source36 : https://storage.googleapis.com/mirror.tensorflow.org/curl.haxx.se/download/curl-7.66.0.tar.gz
Source37 : https://github.com/grpc/grpc/archive/4566c2a29ebec0835643b972eb99f4306c4234a3.tar.gz
Source38 : https://mirror.bazel.build/github.com/antirez/linenoise/archive/c894b9e59f02203dbe4e2be657572cf88c4230c3.tar.gz
Source39 : https://github.com/LMDB/lmdb/archive/LMDB_0.9.22.tar.gz
Source40 : https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz
Source41 : https://github.com/google/boringssl/archive/7f634429a04abc48e2eb041c81c5235816c96514.tar.gz
Source42 : https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz
Source43 : https://mirror.bazel.build/www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz
Source44 : https://mirror.bazel.build/github.com/google/snappy/archive/1.1.7.tar.gz
Source45 : https://mirror.bazel.build/github.com/jemalloc/jemalloc/archive/4.4.0.tar.gz
Source46 : https://mirror.bazel.build/github.com/google/pprof/archive/c0fb62ec88c411cc91194465e54db2632845b650.tar.gz
Source47 : https://github.com/google/double-conversion/archive/3992066a95b823efc8ccc1baf82a1cfc73f6e9b8.zip
Source48 : https://github.com/google/googletest/archive/b6cd405286ed8635ece71c72f118e659f4ade3fb.zip
Source49 : https://github.com/edenhill/librdkafka/archive/v0.11.5.tar.gz
Source50 : https://github.com/aws/aws-sdk-cpp/archive/1.5.8.tar.gz
Source51 : https://mirror.bazel.build/github.com/cython/cython/archive/0.28.4.tar.gz
Source52 : https://github.com/NVlabs/cub/archive/1.8.0.zip
Source53 : https://github.com/googleapis/googleapis/archive/f81082ea1e2f85c43649bee26e0d9871d4b41cdb.zip
Source54 : https://github.com/intel/ARM_NEON_2_x86_SSE/archive/1200fe90bb174a6224a525ee60148671a786a71f.tar.gz
Source55 : https://github.com/google/flatbuffers/archive/v1.11.0.tar.gz
Source57 : http://ftp.exim.org/pub/pcre/pcre-8.39.tar.gz
Source58 : https://github.com/unicode-org/icu/archive/release-62-1.tar.gz
Source59 : https://github.com/llvm-mirror/llvm/archive/b7d166cebcf619a3691eed3f994384aab3d80fa6.tar.gz
Source60 : https://github.com/bazelbuild/bazel-toolchains/archive/92dd8a7a518a2fb7ba992d47c8b38299fe0be825.tar.gz
Source62 : https://github.com/bazelbuild/bazel-skylib/archive/1.0.2.tar.gz
Source63 : https://github.com/bazelbuild/rules_apple/archive/0.13.0.tar.gz
Source64 : http://mirror.bazel.build/github.com/keras-team/keras-applications/archive/1.0.6.tar.gz
Source65 : https://github.com/nanopb/nanopb/archive/f8ac463766281625ad710900479130c7fcb4d63b.tar.gz
Source67 : https://github.com/bazelbuild/rules_swift/releases/download/0.11.1/rules_swift.0.11.1.tar.gz
Source68 : https://github.com/GrahamDumpleton/wrapt/archive/1.11.1.tar.gz
Source69 : https://github.com/google/pasta/archive/v0.1.2.tar.gz
Source70 : https://pypi.python.org/packages/bf/3e/31d502c25302814a7c2f1d3959d2a3b3f78e509002ba91aea64993936876/enum34-1.1.6.tar.gz
Source71 : https://download.open-mpi.org/release/hwloc/v2.0/hwloc-2.0.3.tar.gz
Source72 : https://github.com/intel/mkl-dnn/releases/download/v0.20-rc/mklml_lnx_2019.0.5.20190502.tgz
Source73 : https://storage.googleapis.com/mirror.tensorflow.org/docs.python.org/2.7/_sources/license.rst.txt
Source74 : https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/0d5f3f2768c6ca2faca0079a997a97ce22997a0c.zip
Source75 : https://github.com/bazelbuild/rules_docker/releases/download/v0.12.1/rules_docker-v0.12.1.tar.gz
Source76 : https://github.com/bazelbuild/rules_python/archive/f46e953f6e0315a3f884154f9395a32ec9999eab.tar.gz
Source77 : https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.2/bazel-gazelle-0.18.2.tar.gz
Source78 : https://storage.googleapis.com/bazel-mirror/github.com/bazelbuild/rules_go/releases/download/v0.20.1/rules_go-v0.20.1.tar.gz
Source79 : https://dl.google.com/go/go1.13.3.linux-amd64.tar.gz
Source80 : https://pypi.python.org/packages/f6/d6/44792ec668bcda7d91913c75237314e688f70415ab2acd7172c845f0b24f/opt_einsum-2.3.2.tar.gz
Source81 : https://pypi.python.org/packages/c5/60/6ac26ad05857c601308d8fb9e87fa36d0ebf889423f47c3502ef034365db/functools32-3.2.3-2.tar.gz
Source82 : https://mirror.bazel.build/github.com/bazelbuild/rules_java/archive/7cf3cefd652008d0a64a419c34c13bdca6c8f178.zip
Source83 : https://storage.googleapis.com/mirror.tensorflow.org/github.com/keras-team/keras-applications/archive/1.0.8.tar.gz
Source84 : https://github.com/mborgerding/kissfft/archive/36dbc057604f00aacfc0288ddad57e3b21cfc1b8.tar.gz
Source85 : https://storage.googleapis.com/mirror.tensorflow.org/www.kurims.kyoto-u.ac.jp/~ooura/fft2d.tgz
Source86 : https://github.com/pybind/pybind11/archive/v2.3.0.tar.gz
Source87 : https://github.com/tensorflow/probability/archive/0.8.0.tar.gz
Source88 : https://github.com/intel/mkl-dnn/archive/v0.20.3.tar.gz
Source89 : https://github.com/intel/mkl-dnn/archive/v1.0-pc2.tar.gz
Source90 : https://github.com/raspberrypi/tools/archive/0e906ebc527eab1cdbf7adabff5b474da9562e9f.tar.gz
Source91 : https://github.com/ROCmSoftwarePlatform/rocPRIM/archive/4a33d328f8352df1654271939da66914f2334424.tar.gz
Source101: answers.txt
Source103: MNIST_example.ipynb
Patch2 : setuptools.patch
Patch3 : 0001-Patch-Eigen-for-TF-1.13.patch
Patch4 : 0001-fixed-curl-dependency-issue.patch
Patch5 : 0001-Updated-curl.patch
Patch6 : 0001-Add-grpc-fix-for-gettid.patch
Patch7 : CVE-2019-15133.patch
Patch8 : 0001-WORKSPACE-changes-as-bazel-version-update.patch
Patch10 : 0001-gast-update-to-0.3.2.patch
Patch11 : 3a48a5c1541daa1fc3f49b9dbe0da247e7cd90f3.patch
Patch12 : 0001-disable-ryu-build-with-avx512.patch
Patch13 : 0001-Fix-TensorFlow-on-Python-3.8-logger-issue.patch
Patch14 : 0002-Update-comment-explaining-python-3.8-change-for-find.patch
#Source104: 0001-enum34-is-only-required-for-Python-3.4.patch
Summary : No detailed summary available
Group : Development/Tools
License : Apache-2.0 GPL-3.0 MPL-2.0-no-copyleft-exception
BuildRequires : pip
BuildRequires : python3-dev
BuildRequires : setuptools
BuildRequires : wheel
BuildRequires : openjdk
BuildRequires : openjdk-dev
BuildRequires : numpy
#BuildRequires : six
#BuildRequires : protobuf
#BuildRequires : protobuf-c
BuildRequires : bazel
BuildRequires : Keras
BuildRequires : Keras_Applications
BuildRequires : Keras_Preprocessing
BuildRequires : mkl-dnn-dev
BuildRequires : c-ares-dev
Requires: Werkzeug
Requires: Markdown
Requires: bleach
Requires: backports.weakref
Requires: opt_einsum
Requires: tensorboard
Requires: absl-py
Requires: astor
Requires: grpcio
Requires: gast
Requires : Keras
Requires : Keras_Applications
Requires : Keras_Preprocessing
Requires : termcolor
Requires : wrapt
Requires : google-pasta
Requires : tensorflow-estimator
%description
TensorFlow
%prep
%setup -q -n tensorflow-2.0.1
#%patch2 -p1
#%patch3 -p1
#%patch4 -p1
#%patch5 -p1
%patch6 -p1
#%patch7 -p1
%patch8 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%build
export no_proxy=localhost,127.0.0.1,0.0.0.0
export LANG=C
export SOURCE_DATE_EPOCH=1485959355
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${buildroot}/usr/lib64:${buildroot}/usr/lib:${builddir}/usr/://tensorflow/contrib
InstallCache() {
sha256=`sha256sum $1 | cut -f1 -d" "`
mkdir -p /tmp/cache/content_addressable/sha256/$sha256/
cp $1 /tmp/cache/content_addressable/sha256/$sha256/file
}
InstallCache %{SOURCE10}
InstallCache %{SOURCE11}
InstallCache %{SOURCE12}
InstallCache %{SOURCE13}
InstallCache %{SOURCE14}
InstallCache %{SOURCE15}
InstallCache %{SOURCE16}
InstallCache %{SOURCE17}
InstallCache %{SOURCE18}
InstallCache %{SOURCE19}
InstallCache %{SOURCE20}
InstallCache %{SOURCE21}
InstallCache %{SOURCE22}
InstallCache %{SOURCE23}
InstallCache %{SOURCE24}
InstallCache %{SOURCE25}
InstallCache %{SOURCE26}
InstallCache %{SOURCE27}
InstallCache %{SOURCE28}
InstallCache %{SOURCE29}
InstallCache %{SOURCE30}
InstallCache %{SOURCE31}
InstallCache %{SOURCE32}
InstallCache %{SOURCE33}
InstallCache %{SOURCE34}
InstallCache %{SOURCE35}
InstallCache %{SOURCE36}
InstallCache %{SOURCE37}
InstallCache %{SOURCE38}
InstallCache %{SOURCE39}
InstallCache %{SOURCE40}
InstallCache %{SOURCE41}
InstallCache %{SOURCE42}
InstallCache %{SOURCE43}
InstallCache %{SOURCE44}
InstallCache %{SOURCE45}
InstallCache %{SOURCE46}
InstallCache %{SOURCE47}
InstallCache %{SOURCE48}
InstallCache %{SOURCE49}
InstallCache %{SOURCE50}
InstallCache %{SOURCE51}
InstallCache %{SOURCE52}
InstallCache %{SOURCE53}
InstallCache %{SOURCE54}
InstallCache %{SOURCE55}
InstallCache %{SOURCE57}
InstallCache %{SOURCE58}
InstallCache %{SOURCE59}
InstallCache %{SOURCE60}
InstallCache %{SOURCE62}
InstallCache %{SOURCE63}
InstallCache %{SOURCE64}
InstallCache %{SOURCE65}
InstallCache %{SOURCE67}
InstallCache %{SOURCE68}
InstallCache %{SOURCE69}
InstallCache %{SOURCE70}
InstallCache %{SOURCE71}
InstallCache %{SOURCE72}
InstallCache %{SOURCE73}
InstallCache %{SOURCE74}
InstallCache %{SOURCE75}
InstallCache %{SOURCE76}
InstallCache %{SOURCE77}
InstallCache %{SOURCE78}
InstallCache %{SOURCE79}
InstallCache %{SOURCE80}
InstallCache %{SOURCE81}
InstallCache %{SOURCE82}
InstallCache %{SOURCE83}
InstallCache %{SOURCE84}
InstallCache %{SOURCE85}
InstallCache %{SOURCE86}
InstallCache %{SOURCE87}
InstallCache %{SOURCE88}
InstallCache %{SOURCE89}
InstallCache %{SOURCE90}
InstallCache %{SOURCE91}
./configure < %{SOURCE101}
bazel --output_base=/tmp/bazel build --repository_cache=/tmp/cache --config=v2 --config=opt --copt=-Wno-sign-compare --incompatible_no_support_tools_in_action_inputs=false //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp
bazel clean
export TF_BUILD_MAVX=MAVX2
./configure < %{SOURCE101}
mkdir /tmp/avx2
bazel --output_base=/tmp/bazel build --repository_cache=/tmp/cache --config=v2 --config=opt --copt=-mavx2 --copt=-march=haswell --copt=-mfma --incompatible_no_support_tools_in_action_inputs=false //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/avx2/
bazel clean
export TF_BUILD_MAVX=MAVX512
./configure < %{SOURCE101}
mkdir /tmp/avx512
bazel --output_base=/tmp/bazel build --repository_cache=/tmp/cache --config=v2 --config=opt --copt=-mavx2 --copt=-march=skylake-avx512 --copt=-mfma --incompatible_no_support_tools_in_action_inputs=false //tensorflow/tools/pip_package:build_pip_package
bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/avx512/
%install
export SOURCE_DATE_EPOCH=1485959355
pip3 install --no-deps --user --force-reinstall /tmp/avx512/tensorflow-2.0.1-cp38-cp38-linux_x86_64.whl
for i in `find /builddir/.local/ -name "*.so.2" `; do mv $i $i.avx512 ; done
mkdir -p /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/avx512_1
mv /builddir/.local/lib/python3.8/site-packages/tensorflow_core/libtensorflow_framework.so.2.avx512 /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/avx512_1/libtensorflow_framework.so.2.avx512 || :
pip3 install --no-deps --user --force-reinstall /tmp/avx2/tensorflow-2.0.1-cp38-cp38-linux_x86_64.whl
for i in `find /builddir/.local/ -name "*.so.2" `; do mv $i $i.avx2 ; done
mv /builddir/.local/lib/python3.8/site-packages/tensorflow_core/libtensorflow_framework.so.2.avx2 /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/libtensorflow_framework.so.2.avx2 || :
# Add python examples
mkdir -p %{buildroot}/usr/share/tensorflow/eager/python/
cp -r tensorflow/contrib/eager/python/examples/ %{buildroot}/usr/share/tensorflow/eager/python/
install -m 0644 -D %{SOURCE103} %{buildroot}/usr/share/doc/tensorflow/MNIST_example.ipynb
pip3 install --no-deps --force-reinstall --user /tmp/tensorflow-2.0.1-cp38-cp38-linux_x86_64.whl
mv /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/avx512_1/libtensorflow_framework.so.2.avx512 /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/avx512_1/libtensorflow_framework.so.2
mv /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/libtensorflow_framework.so.2.avx2 /builddir/.local/lib/python3.8/site-packages/tensorflow_core/haswell/libtensorflow_framework.so.2
rm /builddir/.local/bin/tf_upgrade_v2
mv /builddir/.local/bin/ %{buildroot}/usr/
mv /builddir/.local/lib/ %{buildroot}/usr/
%files
%defattr(-,root,root,-)
/usr/bin/saved_model_cli
%exclude /usr/bin/tensorboard
/usr/bin/tflite_convert
/usr/bin/toco
/usr/bin/toco_from_protos
/usr/lib/python3*/site-packages/*
/usr/share/doc/tensorflow/MNIST_example.ipynb
/usr/share/tensorflow