Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/tensorflow/files/, sci-libs/tensorflow/
Date: Sat, 03 Aug 2019 12:04:53
Message-Id: 1564833338.b684f751b6ad2029191c65b50ce0eacc4de001a3.perfinion@gentoo
1 commit: b684f751b6ad2029191c65b50ce0eacc4de001a3
2 Author: Jason Zaman <perfinion <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 2 14:21:01 2019 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Sat Aug 3 11:55:38 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b684f751
7
8 sci-libs/tensorflow-1.14.0-r1: Fix build issues
9
10 - Header paths were mangled
11 - Jsoncpp-1.9 build error
12 - Newer GRPC needed a bumped google-cloud-cpp dep
13 - Build failed with python2 if future was not installed
14 - Add tensorflow_cc pkgconfig file
15
16 Closes: https://bugs.gentoo.org/688594
17 Closes: https://bugs.gentoo.org/689282
18 Closes: https://bugs.gentoo.org/690212
19 Package-Manager: Portage-2.3.69, Repoman-2.3.16
20 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
21
22 ...ll_headers-fix-paths-of-generated-headers.patch | 38 ++++++++++++++++++
23 ...jsoncpp-update-header-symlinks-for-jsoncp.patch | 27 +++++++++++++
24 ...g-generate-tensorflow_cc-pkg-config-entry.patch | 46 ++++++++++++++++++++++
25 ...source-builtins-does-not-exist-in-python2.patch | 25 ++++++++++++
26 ...w-1.14.0.ebuild => tensorflow-1.14.0-r1.ebuild} | 16 +++++---
27 5 files changed, 146 insertions(+), 6 deletions(-)
28
29 diff --git a/sci-libs/tensorflow/files/tensorflow-1.14.0-0002-install_headers-fix-paths-of-generated-headers.patch b/sci-libs/tensorflow/files/tensorflow-1.14.0-0002-install_headers-fix-paths-of-generated-headers.patch
30 new file mode 100644
31 index 00000000000..566f2874376
32 --- /dev/null
33 +++ b/sci-libs/tensorflow/files/tensorflow-1.14.0-0002-install_headers-fix-paths-of-generated-headers.patch
34 @@ -0,0 +1,38 @@
35 +From 5176e1feb22fac2f9d4ca9d8ad261ef6893d3c76 Mon Sep 17 00:00:00 2001
36 +From: Jason Zaman <jason@×××××××××.com>
37 +Date: Mon, 29 Jul 2019 01:17:06 +0800
38 +Subject: [PATCH 2/3] install_headers: fix paths of generated headers
39 +
40 +Signed-off-by: Jason Zaman <jason@×××××××××.com>
41 +---
42 + tensorflow/BUILD | 7 +++++--
43 + 1 file changed, 5 insertions(+), 2 deletions(-)
44 +
45 +diff --git a/tensorflow/BUILD b/tensorflow/BUILD
46 +index a04ddf9f8a..1e0cc9207b 100644
47 +--- a/tensorflow/BUILD
48 ++++ b/tensorflow/BUILD
49 +@@ -703,8 +703,8 @@ genrule(
50 + mkdir $@
51 + for f in $(SRCS); do
52 + d="$${f%/*}"
53 +- d="$${d#bazel-out*genfiles/}"
54 +- d="$${d#*external/eigen_archive/}"
55 ++ d="$${d#bazel-out/*/genfiles/}"
56 ++ d="$${d#bazel-out/*/bin/}"
57 +
58 + if [[ $${d} == *local_config_* ]]; then
59 + continue
60 +@@ -716,6 +716,9 @@ genrule(
61 + if [[ $${TF_SYSTEM_LIBS:-} == *$${extname}* ]]; then
62 + continue
63 + fi
64 ++
65 ++ d="$${d#*external/farmhash_archive/src}"
66 ++ d="$${d#*external/$${extname}/}"
67 + fi
68 +
69 + mkdir -p "$@/$${d}"
70 +--
71 +2.21.0
72 +
73
74 diff --git a/sci-libs/tensorflow/files/tensorflow-1.14.0-0003-systemlibs-jsoncpp-update-header-symlinks-for-jsoncp.patch b/sci-libs/tensorflow/files/tensorflow-1.14.0-0003-systemlibs-jsoncpp-update-header-symlinks-for-jsoncp.patch
75 new file mode 100644
76 index 00000000000..3ccdf493373
77 --- /dev/null
78 +++ b/sci-libs/tensorflow/files/tensorflow-1.14.0-0003-systemlibs-jsoncpp-update-header-symlinks-for-jsoncp.patch
79 @@ -0,0 +1,27 @@
80 +From 22275f7dbfa2d483ed4778427b137e83144bac3d Mon Sep 17 00:00:00 2001
81 +From: Jason Zaman <jason@×××××××××.com>
82 +Date: Fri, 2 Aug 2019 20:06:33 +0800
83 +Subject: [PATCH 3/3] systemlibs: jsoncpp: update header symlinks for jsoncpp
84 + 1.9
85 +
86 +Signed-off-by: Jason Zaman <jason@×××××××××.com>
87 +---
88 + third_party/systemlibs/jsoncpp.BUILD | 2 ++
89 + 1 file changed, 2 insertions(+)
90 +
91 +diff --git a/third_party/systemlibs/jsoncpp.BUILD b/third_party/systemlibs/jsoncpp.BUILD
92 +index 526fd0c418..7d54f9289b 100644
93 +--- a/third_party/systemlibs/jsoncpp.BUILD
94 ++++ b/third_party/systemlibs/jsoncpp.BUILD
95 +@@ -6,6 +6,8 @@ filegroup(
96 + )
97 +
98 + HEADERS = [
99 ++ "include/json/allocator.h",
100 ++ "include/json/assertions.h",
101 + "include/json/autolink.h",
102 + "include/json/config.h",
103 + "include/json/features.h",
104 +--
105 +2.21.0
106 +
107
108 diff --git a/sci-libs/tensorflow/files/tensorflow-1.14.0-0004-pkgconfig-generate-tensorflow_cc-pkg-config-entry.patch b/sci-libs/tensorflow/files/tensorflow-1.14.0-0004-pkgconfig-generate-tensorflow_cc-pkg-config-entry.patch
109 new file mode 100644
110 index 00000000000..5e65c413e77
111 --- /dev/null
112 +++ b/sci-libs/tensorflow/files/tensorflow-1.14.0-0004-pkgconfig-generate-tensorflow_cc-pkg-config-entry.patch
113 @@ -0,0 +1,46 @@
114 +From a8144189b257d515f1eb72a4b50098e9f4abd4ea Mon Sep 17 00:00:00 2001
115 +From: Jason Zaman <jason@×××××××××.com>
116 +Date: Fri, 2 Aug 2019 22:21:25 +0800
117 +Subject: [PATCH 4/5] pkgconfig: generate tensorflow_cc pkg-config entry
118 +
119 +Signed-off-by: Jason Zaman <jason@×××××××××.com>
120 +---
121 + tensorflow/c/generate-pc.sh | 18 ++++++++++++++++--
122 + 1 file changed, 16 insertions(+), 2 deletions(-)
123 +
124 +diff --git a/tensorflow/c/generate-pc.sh b/tensorflow/c/generate-pc.sh
125 +index 7184ad68fb..a4d51a1b3b 100755
126 +--- a/tensorflow/c/generate-pc.sh
127 ++++ b/tensorflow/c/generate-pc.sh
128 +@@ -63,12 +63,26 @@ cat << EOF > tensorflow.pc
129 + prefix=${TF_PREFIX}
130 + exec_prefix=\${prefix}
131 + libdir=\${exec_prefix}/${LIBDIR}
132 +-includedir=\${prefix}/include
133 ++includedir=\${prefix}/include/tensorflow
134 +
135 + Name: TensorFlow
136 + Version: ${TF_VERSION}
137 + Description: Library for computation using data flow graphs for scalable machine learning
138 + Requires:
139 +-Libs: -L\${libdir} -ltensorflow
140 ++Libs: -L\${libdir} -ltensorflow -ltensorflow_framework
141 ++Cflags: -I\${includedir}
142 ++EOF
143 ++
144 ++cat << EOF > tensorflow_cc.pc
145 ++prefix=${TF_PREFIX}
146 ++exec_prefix=\${prefix}
147 ++libdir=\${exec_prefix}/${LIBDIR}
148 ++includedir=\${prefix}/include/tensorflow
149 ++
150 ++Name: TensorFlow
151 ++Version: ${TF_VERSION}
152 ++Description: Library for computation using data flow graphs for scalable machine learning
153 ++Requires:
154 ++Libs: -L\${libdir} -ltensorflow_cc -ltensorflow_framework
155 + Cflags: -I\${includedir}
156 + EOF
157 +--
158 +2.21.0
159 +
160
161 diff --git a/sci-libs/tensorflow/files/tensorflow-1.14.0-0005-gen_git_source-builtins-does-not-exist-in-python2.patch b/sci-libs/tensorflow/files/tensorflow-1.14.0-0005-gen_git_source-builtins-does-not-exist-in-python2.patch
162 new file mode 100644
163 index 00000000000..fc2e1fe92cb
164 --- /dev/null
165 +++ b/sci-libs/tensorflow/files/tensorflow-1.14.0-0005-gen_git_source-builtins-does-not-exist-in-python2.patch
166 @@ -0,0 +1,25 @@
167 +From bdbe7a572ed248bf8e53df200ffa5e66bf77b16f Mon Sep 17 00:00:00 2001
168 +From: Jason Zaman <jason@×××××××××.com>
169 +Date: Fri, 2 Aug 2019 22:22:53 +0800
170 +Subject: [PATCH 5/5] gen_git_source: builtins does not exist in python2
171 +
172 +Signed-off-by: Jason Zaman <jason@×××××××××.com>
173 +---
174 + tensorflow/tools/git/gen_git_source.py | 1 -
175 + 1 file changed, 1 deletion(-)
176 +
177 +diff --git a/tensorflow/tools/git/gen_git_source.py b/tensorflow/tools/git/gen_git_source.py
178 +index 6cefd3900b..4d52c1fccf 100755
179 +--- a/tensorflow/tools/git/gen_git_source.py
180 ++++ b/tensorflow/tools/git/gen_git_source.py
181 +@@ -26,7 +26,6 @@ NOTE: this script is only used in opensource.
182 + from __future__ import absolute_import
183 + from __future__ import division
184 + from __future__ import print_function
185 +-from builtins import bytes # pylint: disable=redefined-builtin
186 + import argparse
187 + import json
188 + import os
189 +--
190 +2.21.0
191 +
192
193 diff --git a/sci-libs/tensorflow/tensorflow-1.14.0.ebuild b/sci-libs/tensorflow/tensorflow-1.14.0-r1.ebuild
194 similarity index 94%
195 rename from sci-libs/tensorflow/tensorflow-1.14.0.ebuild
196 rename to sci-libs/tensorflow/tensorflow-1.14.0-r1.ebuild
197 index 93428020020..0d050e7f370 100644
198 --- a/sci-libs/tensorflow/tensorflow-1.14.0.ebuild
199 +++ b/sci-libs/tensorflow/tensorflow-1.14.0-r1.ebuild
200 @@ -53,7 +53,7 @@ RDEPEND="
201 dev-db/lmdb
202 dev-db/sqlite
203 dev-libs/icu
204 - >=dev-libs/jsoncpp-1.8.4
205 + >=dev-libs/jsoncpp-1.9
206 dev-libs/libpcre
207 dev-libs/nsync
208 dev-libs/openssl:0=
209 @@ -62,7 +62,7 @@ RDEPEND="
210 media-libs/giflib
211 media-libs/libjpeg-turbo
212 media-libs/libpng:0
213 - >=net-libs/grpc-1.16.0
214 + >=net-libs/grpc-1.22.0
215 net-misc/curl
216 sys-libs/zlib
217 >=sys-apps/hwloc-2
218 @@ -82,9 +82,9 @@ RDEPEND="
219 >=dev-python/protobuf-python-3.6.0[${PYTHON_USEDEP}]
220 dev-python/six[${PYTHON_USEDEP}]
221 dev-python/termcolor[${PYTHON_USEDEP}]
222 - dev-python/grpcio[${PYTHON_USEDEP}]
223 + >=dev-python/grpcio-1.22.0[${PYTHON_USEDEP}]
224 >=dev-python/wrapt-1.11.1[${PYTHON_USEDEP}]
225 - >=net-libs/google-cloud-cpp-0.9.0
226 + >=net-libs/google-cloud-cpp-0.10.0
227 >=sci-libs/keras-applications-1.0.6[${PYTHON_USEDEP}]
228 >=sci-libs/keras-preprocessing-1.0.5[${PYTHON_USEDEP}]
229 >=sci-visualization/tensorboard-1.13.0[${PYTHON_USEDEP}]
230 @@ -112,7 +112,7 @@ BDEPEND="
231 )
232 !python? ( dev-lang/python )
233 python? (
234 - dev-python/grpcio-tools
235 + >=dev-python/grpcio-tools-1.22.0
236 )"
237 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
238
239 @@ -120,6 +120,10 @@ S="${WORKDIR}/${MY_P}"
240
241 PATCHES=(
242 "${FILESDIR}/tensorflow-1.14.0-0001-systemlibs-unbundle-enum34.patch"
243 + "${FILESDIR}/tensorflow-1.14.0-0002-install_headers-fix-paths-of-generated-headers.patch"
244 + "${FILESDIR}/tensorflow-1.14.0-0003-systemlibs-jsoncpp-update-header-symlinks-for-jsoncp.patch"
245 + "${FILESDIR}/tensorflow-1.14.0-0004-pkgconfig-generate-tensorflow_cc-pkg-config-entry.patch"
246 + "${FILESDIR}/tensorflow-1.14.0-0005-gen_git_source-builtins-does-not-exist-in-python2.patch"
247 )
248 DOCS=( AUTHORS CONTRIBUTING.md ISSUE_TEMPLATE.md README.md RELEASE.md )
249 CHECKREQS_MEMORY="5G"
250 @@ -328,7 +332,7 @@ src_install() {
251 # Generate pkg-config file
252 ${PN}/c/generate-pc.sh --prefix="${EPREFIX}"/usr --libdir=$(get_libdir) --version=${MY_PV} || die
253 insinto /usr/$(get_libdir)/pkgconfig
254 - doins ${PN}.pc
255 + doins ${PN}.pc ${PN}_cc.pc
256
257 for l in libtensorflow{,_framework,_cc}.so; do
258 dolib.so bazel-bin/tensorflow/${l}