[arch-commits] Commit in tensorflow/repos/community-x86_64 (16 files)

Sven-Hendrik Haase svenstaro at archlinux.org
Sat Nov 10 03:17:26 UTC 2018


    Date: Saturday, November 10, 2018 @ 03:17:26
  Author: svenstaro
Revision: 405616

archrelease: copy trunk to community-x86_64

Added:
  tensorflow/repos/community-x86_64/21017.patch
    (from rev 405615, tensorflow/trunk/21017.patch)
  tensorflow/repos/community-x86_64/PKGBUILD
    (from rev 405615, tensorflow/trunk/PKGBUILD)
  tensorflow/repos/community-x86_64/explicitly_import_bazelrc.patch
    (from rev 405615, tensorflow/trunk/explicitly_import_bazelrc.patch)
  tensorflow/repos/community-x86_64/protobuf-python37-apply.patch
    (from rev 405615, tensorflow/trunk/protobuf-python37-apply.patch)
  tensorflow/repos/community-x86_64/protobuf-python37.patch
    (from rev 405615, tensorflow/trunk/protobuf-python37.patch)
  tensorflow/repos/community-x86_64/protobuf-version-bump.patch
    (from rev 405615, tensorflow/trunk/protobuf-version-bump.patch)
  tensorflow/repos/community-x86_64/python37.patch
    (from rev 405615, tensorflow/trunk/python37.patch)
  tensorflow/repos/community-x86_64/update-cython.patch
    (from rev 405615, tensorflow/trunk/update-cython.patch)
  tensorflow/repos/community-x86_64/update-protobuf.patch
    (from rev 405615, tensorflow/trunk/update-protobuf.patch)
Deleted:
  tensorflow/repos/community-x86_64/21017.patch
  tensorflow/repos/community-x86_64/PKGBUILD
  tensorflow/repos/community-x86_64/protobuf-python37-apply.patch
  tensorflow/repos/community-x86_64/protobuf-python37.patch
  tensorflow/repos/community-x86_64/python37.patch
  tensorflow/repos/community-x86_64/update-cython.patch
  tensorflow/repos/community-x86_64/update-protobuf.patch

---------------------------------+
 21017.patch                     |   42 +--
 PKGBUILD                        |  485 +++++++++++++++++++-------------------
 explicitly_import_bazelrc.patch |   24 +
 protobuf-python37-apply.patch   |   56 ++--
 protobuf-python37.patch         |  182 +++++++-------
 protobuf-version-bump.patch     |   30 ++
 python37.patch                  |  140 +++++-----
 update-cython.patch             |   68 ++---
 update-protobuf.patch           |  292 +++++++++++-----------
 9 files changed, 692 insertions(+), 627 deletions(-)

Deleted: 21017.patch
===================================================================
--- 21017.patch	2018-11-10 03:17:00 UTC (rev 405615)
+++ 21017.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,21 +0,0 @@
-From fb8d1ca4eaefe58d42c27b6fc676f64f137f4675 Mon Sep 17 00:00:00 2001
-From: Ray Kim <msca8h at naver.com>
-Date: Sat, 21 Jul 2018 21:42:15 +0900
-Subject: [PATCH] fixed build error on gcc-7
-
----
- tensorflow/compiler/xla/service/gpu/xfeed_queue.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/tensorflow/compiler/xla/service/gpu/xfeed_queue.h b/tensorflow/compiler/xla/service/gpu/xfeed_queue.h
-index 737c7eb0253..dd46ff433ba 100644
---- a/tensorflow/compiler/xla/service/gpu/xfeed_queue.h
-+++ b/tensorflow/compiler/xla/service/gpu/xfeed_queue.h
-@@ -17,6 +17,7 @@ limitations under the License.
- #define TENSORFLOW_COMPILER_XLA_SERVICE_GPU_XFEED_QUEUE_H_
- 
- #include <deque>
-+#include <functional>
- #include <vector>
- 
- #include "tensorflow/core/platform/mutex.h"

Copied: tensorflow/repos/community-x86_64/21017.patch (from rev 405615, tensorflow/trunk/21017.patch)
===================================================================
--- 21017.patch	                        (rev 0)
+++ 21017.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,21 @@
+From fb8d1ca4eaefe58d42c27b6fc676f64f137f4675 Mon Sep 17 00:00:00 2001
+From: Ray Kim <msca8h at naver.com>
+Date: Sat, 21 Jul 2018 21:42:15 +0900
+Subject: [PATCH] fixed build error on gcc-7
+
+---
+ tensorflow/compiler/xla/service/gpu/xfeed_queue.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tensorflow/compiler/xla/service/gpu/xfeed_queue.h b/tensorflow/compiler/xla/service/gpu/xfeed_queue.h
+index 737c7eb0253..dd46ff433ba 100644
+--- a/tensorflow/compiler/xla/service/gpu/xfeed_queue.h
++++ b/tensorflow/compiler/xla/service/gpu/xfeed_queue.h
+@@ -17,6 +17,7 @@ limitations under the License.
+ #define TENSORFLOW_COMPILER_XLA_SERVICE_GPU_XFEED_QUEUE_H_
+ 
+ #include <deque>
++#include <functional>
+ #include <vector>
+ 
+ #include "tensorflow/core/platform/mutex.h"

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2018-11-10 03:17:00 UTC (rev 405615)
+++ PKGBUILD	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,237 +0,0 @@
-# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
-# Contributor: Adria Arrufat (archdria) <adria.arrufat+AUR at protonmail.ch>
-# Contributor: Thibault Lorrain (fredszaq) <fredszaq at gmail.com>
-
-pkgbase=tensorflow
-pkgname=(tensorflow tensorflow-opt tensorflow-cuda tensorflow-opt-cuda python-tensorflow python-tensorflow-opt python-tensorflow-cuda python-tensorflow-opt-cuda)
-pkgver=1.11.0
-_pkgver=1.11.0
-pkgrel=2
-pkgdesc="Library for computation using data flow graphs for scalable machine learning"
-url="https://www.tensorflow.org/"
-license=('APACHE')
-arch=('x86_64')
-makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl'
-             'cudnn' 'python-pip' 'python-wheel' 'python-setuptools' 'python-h5py'
-             'python-keras-applications' 'python-keras-preprocessing')
-optdepends=('tensorboard: Tensorflow visualization toolkit')
-source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz"
-        python37.patch
-        protobuf-python37.patch
-        protobuf-python37-apply.patch)
-sha512sums=('26e9542c43e11a663cbc5cf42859ae7b6dc0e92cfa88775fd4d1badba7f08c59b60c05010fd9f3ec501313be5c042f39b17323bb4753babf365ba2a48af836c2'
-            '9e3954c10f9dc11d3b6a6a0162061511eaa81b934debaf4f159f11f60e235e6f2762a216d10927695497e8cf7065855d343cd1573727da3f6355e669ea7c6788'
-            'a248658d9466bd3aba854b429ce2c1981c5efff5196dead7b2a8c216b9a6cac781a9f487db5ff4513becc4e6d6cc14c494768a859e1f51a9eea848d8f0178204'
-            '081ff5e35b643c63d3fc28d75266fe13fe70f8f274c862ff7959ec360654ae15593e8c45379a6b23c91fb475af6b9315188f3bfec866fddbbb86a0613d3aa738')
-
-prepare() {
-  # https://github.com/tensorflow/tensorflow/issues/20517
-  # patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/python37.patch
-  # https://github.com/tensorflow/tensorflow/issues/20950
-  patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/protobuf-python37-apply.patch
-  cp ${srcdir}/protobuf-python37.patch tensorflow-${_pkgver}/third_party/
-
-  cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt
-  cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-cuda
-  cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt-cuda
-  # These environment variables influence the behavior of the configure call below.
-  export PYTHON_BIN_PATH=/usr/bin/python
-  export USE_DEFAULT_PYTHON_LIB_PATH=1
-  export TF_NEED_JEMALLOC=1
-  export TF_NEED_KAFKA=0
-  export TF_NEED_OPENCL_SYCL=0
-  export TF_NEED_AWS=0
-  export TF_NEED_GCP=0
-  export TF_NEED_HDFS=0
-  export TF_NEED_S3=0
-  export TF_ENABLE_XLA=1
-  export TF_NEED_GDR=0
-  export TF_NEED_VERBS=0
-  export TF_NEED_OPENCL=0
-  export TF_NEED_MPI=0
-  export TF_NEED_TENSORRT=0
-  export TF_NEED_NGRAPH=0
-  export TF_SET_ANDROID_WORKSPACE=0
-  export TF_DOWNLOAD_CLANG=0
-  export TF_NCCL_VERSION=2.3
-  export NCCL_INSTALL_PATH=/usr
-}
-
-build() {
-  cd ${srcdir}/tensorflow-${_pkgver}
-  export CC_OPT_FLAGS="-march=x86-64"
-  export TF_NEED_CUDA=0
-  ./configure
-  bazel build --config=opt //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmp
-
-  cd ${srcdir}/tensorflow-${_pkgver}-cuda
-  export CC_OPT_FLAGS="-march=x86-64"
-  export TF_NEED_CUDA=1
-  export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7
-  export TF_CUDA_CLANG=0
-  # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
-  export CUDA_TOOLKIT_PATH=/opt/cuda
-  export TF_CUDA_VERSION=$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
-  export CUDNN_INSTALL_PATH=/opt/cuda
-  export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h)
-  export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2,6.1,6.2,7.0,7.2,7.5
-  ./configure
-  bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcuda
-
-  cd ${srcdir}/tensorflow-${_pkgver}-opt
-  export CC_OPT_FLAGS="-march=haswell"
-  export TF_NEED_CUDA=0
-  ./configure
-  bazel build --config=opt //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpopt
-
-  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
-  export CC_OPT_FLAGS="-march=haswell"
-  export TF_NEED_CUDA=1
-  export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7
-  export TF_CUDA_CLANG=0
-  # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
-  export CUDA_TOOLKIT_PATH=/opt/cuda
-  export TF_CUDA_VERSION=$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
-  export CUDNN_INSTALL_PATH=/opt/cuda
-  export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h)
-  export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2,6.1,6.2,7.0,7.2,7.5
-  ./configure
-  bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcudaopt
-}
-
-package_tensorflow() {
-  cd ${srcdir}/tensorflow-${_pkgver}
-
-  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_tensorflow-opt() {
-  conflicts=(tensorflow)
-  provides=(tensorflow)
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
-
-  cd ${srcdir}/tensorflow-${_pkgver}-opt
-
-  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_tensorflow-cuda() {
-  depends=(cuda cudnn nccl)
-  conflicts=(tensorflow)
-  provides=(tensorflow)
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
-
-  cd ${srcdir}/tensorflow-${_pkgver}-cuda
-
-  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_tensorflow-opt-cuda() {
-  depends=(cuda cudnn nccl)
-  conflicts=(tensorflow)
-  provides=(tensorflow tensorflow-cuda)
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
-
-  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
-
-  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_python-tensorflow() {
-  depends=(python-termcolor python-astor python-gast python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing)
-
-  cd ${srcdir}/tensorflow-${_pkgver}
-
-  WHEEL_PACKAGE=$(find ${srcdir}/tmp -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
-
-  # tensorboard has been separated from upstream but they still install it with
-  # tensorflow. I don't know what kind of sense that makes but we have to clean
-  # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
-
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_python-tensorflow-opt() {
-  depends=(python-termcolor python-astor python-gast python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing)
-  conflicts=(python-tensorflow)
-  provides=(python-tensorflow)
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
-
-  cd ${srcdir}/tensorflow-${_pkgver}-opt
-
-  WHEEL_PACKAGE=$(find ${srcdir}/tmpopt -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
-
-  # tensorboard has been separated from upstream but they still install it with
-  # tensorflow. I don't know what kind of sense that makes but we have to clean
-  # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
-
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_python-tensorflow-cuda() {
-  depends=(python-termcolor python-astor python-gast python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing)
-  conflicts=(python-tensorflow)
-  provides=(python-tensorflow)
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
-
-  cd ${srcdir}/tensorflow-${_pkgver}-cuda
-
-  WHEEL_PACKAGE=$(find ${srcdir}/tmpcuda -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
-
-  # tensorboard has been separated from upstream but they still install it with
-  # tensorflow. I don't know what kind of sense that makes but we have to clean
-  # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
-
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-package_python-tensorflow-opt-cuda() {
-  depends=(python-termcolor python-astor python-gast python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing)
-  conflicts=(python-tensorflow)
-  provides=(python-tensorflow python-tensorflow-cuda)
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
-
-  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
-
-  WHEEL_PACKAGE=$(find ${srcdir}/tmpcudaopt -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
-
-  # tensorboard has been separated from upstream but they still install it with
-  # tensorflow. I don't know what kind of sense that makes but we have to clean
-  # it out from this pacakge.
-  rm -rf ${pkgdir}/usr/bin/tensorboard
-
-  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
-}
-
-# vim:set ts=2 sw=2 et:

Copied: tensorflow/repos/community-x86_64/PKGBUILD (from rev 405615, tensorflow/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,248 @@
+# Maintainer: Sven-Hendrik Haase <sh at lutzhaase.com>
+# Contributor: Adria Arrufat (archdria) <adria.arrufat+AUR at protonmail.ch>
+# Contributor: Thibault Lorrain (fredszaq) <fredszaq at gmail.com>
+
+pkgbase=tensorflow
+pkgname=(tensorflow tensorflow-opt tensorflow-cuda tensorflow-opt-cuda python-tensorflow python-tensorflow-opt python-tensorflow-cuda python-tensorflow-opt-cuda)
+pkgver=1.12.0
+_pkgver=1.12.0
+pkgrel=1
+pkgdesc="Library for computation using data flow graphs for scalable machine learning"
+url="https://www.tensorflow.org/"
+license=('APACHE')
+arch=('x86_64')
+depends=('c-ares')
+makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl'
+             'cudnn' 'python-pip' 'python-wheel' 'python-setuptools' 'python-h5py'
+             'python-keras-applications' 'python-keras-preprocessing')
+optdepends=('tensorboard: Tensorflow visualization toolkit')
+source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz"
+        # python37.patch
+        protobuf-version-bump.patch
+        protobuf-python37.patch
+        protobuf-python37-apply.patch
+        # try_import.patch
+        explicitly_import_bazelrc.patch)
+sha512sums=('b145a9118856aa00a829ab6af89bff4e1e131371c96d77b07532544112803c4574d97ef224b28a64437a2af8db4286786dc0b4123efe110b2aa734b443a7e238'
+            'b9821d8eed1bb0125ddb8ebc46e8a4b8630789aac9b35aa4ecf24459476370f8b57fcf016952d7b7b61bee4177124abba343b7c9e956645b8895d2680f84e29a'
+            'c5e24f584153752e7e22f472c8b0378dce8d0e07fa44598f571d27707d1ac5d0917ca1b6556c59259ef27c1405da6f83b9080ed803550ae6a6121ea3054d3111'
+            'e13399375a8d61f695f67be20d86570b0e7e9b8682ea00eb689b3638e2b12ce50cb45fbe46f2ce1b1f065d043a29b8fac1b96eeec01317415ef2d8b51ac8332a'
+            'b4567bef73007c388ae782cda0b9f2e06c7d87de03e97dfd99e258275cd60be8a1fa07359eae24316f9d059e00b6abc632d7c72f84318de1a6f4902f59d6fd8e')
+
+prepare() {
+  # https://github.com/tensorflow/tensorflow/issues/20517
+  # patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/python37.patch
+  # https://github.com/tensorflow/tensorflow/issues/20950
+  patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/protobuf-version-bump.patch
+  patch -d tensorflow-${_pkgver} -Np1 -i ${srcdir}/protobuf-python37-apply.patch
+  # https://github.com/protocolbuffers/protobuf/issues/4086
+  cp ${srcdir}/protobuf-python37.patch tensorflow-${_pkgver}/third_party/
+  # https://github.com/tensorflow/tensorflow/issues/23402
+  patch -d "tensorflow-${_pkgver}" -Np1 -i "${srcdir}/explicitly_import_bazelrc.patch"
+
+  cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt
+  cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-cuda
+  cp -r tensorflow-${_pkgver} tensorflow-${_pkgver}-opt-cuda
+  # These environment variables influence the behavior of the configure call below.
+  export PYTHON_BIN_PATH=/usr/bin/python
+  export USE_DEFAULT_PYTHON_LIB_PATH=1
+  export TF_NEED_JEMALLOC=1
+  export TF_NEED_KAFKA=0
+  export TF_NEED_OPENCL_SYCL=0
+  export TF_NEED_AWS=0
+  export TF_NEED_GCP=0
+  export TF_NEED_HDFS=0
+  export TF_NEED_S3=0
+  export TF_ENABLE_XLA=1
+  export TF_NEED_GDR=0
+  export TF_NEED_VERBS=0
+  export TF_NEED_OPENCL=0
+  export TF_NEED_MPI=0
+  export TF_NEED_TENSORRT=0
+  export TF_NEED_NGRAPH=0
+  export TF_NEED_IGNITE=0
+  export TF_NEED_ROCM=0
+  export TF_SET_ANDROID_WORKSPACE=0
+  export TF_DOWNLOAD_CLANG=0
+  export TF_NCCL_VERSION=2.3
+  export NCCL_INSTALL_PATH=/usr
+}
+
+build() {
+  cd ${srcdir}/tensorflow-${_pkgver}
+  export CC_OPT_FLAGS="-march=x86-64"
+  export TF_NEED_CUDA=0
+  ./configure
+  bazel build --config=opt //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmp
+
+  cd ${srcdir}/tensorflow-${_pkgver}-cuda
+  export CC_OPT_FLAGS="-march=x86-64"
+  export TF_NEED_CUDA=1
+  export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7
+  export TF_CUDA_CLANG=0
+  # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
+  export CUDA_TOOLKIT_PATH=/opt/cuda
+  export TF_CUDA_VERSION=$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
+  export CUDNN_INSTALL_PATH=/opt/cuda
+  export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h)
+  export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2,6.1,6.2,7.0,7.2,7.5
+  ./configure
+  bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcuda
+
+  cd ${srcdir}/tensorflow-${_pkgver}-opt
+  export CC_OPT_FLAGS="-march=haswell"
+  export TF_NEED_CUDA=0
+  ./configure
+  bazel build --config=opt //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpopt
+
+  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
+  export CC_OPT_FLAGS="-march=haswell"
+  export TF_NEED_CUDA=1
+  export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-7
+  export TF_CUDA_CLANG=0
+  # export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
+  export CUDA_TOOLKIT_PATH=/opt/cuda
+  export TF_CUDA_VERSION=$($CUDA_TOOLKIT_PATH/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
+  export CUDNN_INSTALL_PATH=/opt/cuda
+  export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' $CUDNN_INSTALL_PATH/include/cudnn.h)
+  export TF_CUDA_COMPUTE_CAPABILITIES=3.0,3.5,5.2,6.1,6.2,7.0,7.2,7.5
+  ./configure
+  bazel build --config=opt --config=cuda //tensorflow:libtensorflow.so //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package ${srcdir}/tmpcudaopt
+}
+
+package_tensorflow() {
+  cd ${srcdir}/tensorflow-${_pkgver}
+
+  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
+  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_tensorflow-opt() {
+  conflicts=(tensorflow)
+  provides=(tensorflow)
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
+
+  cd ${srcdir}/tensorflow-${_pkgver}-opt
+
+  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
+  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_tensorflow-cuda() {
+  depends+=(cuda cudnn nccl)
+  conflicts=(tensorflow)
+  provides=(tensorflow)
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
+
+  cd ${srcdir}/tensorflow-${_pkgver}-cuda
+
+  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
+  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_tensorflow-opt-cuda() {
+  depends+=(cuda cudnn nccl)
+  conflicts=(tensorflow)
+  provides=(tensorflow tensorflow-cuda)
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
+
+  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
+
+  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
+  install -Dm644 tensorflow.pc ${pkgdir}/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so ${pkgdir}/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so ${pkgdir}/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h ${pkgdir}/usr/include/tensorflow/c/c_api.h
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_python-tensorflow() {
+  depends+=(python-termcolor python-astor python-gast python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing)
+
+  cd ${srcdir}/tensorflow-${_pkgver}
+
+  WHEEL_PACKAGE=$(find ${srcdir}/tmp -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+
+  # tensorboard has been separated from upstream but they still install it with
+  # tensorflow. I don't know what kind of sense that makes but we have to clean
+  # it out from this pacakge.
+  rm -rf ${pkgdir}/usr/bin/tensorboard
+
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_python-tensorflow-opt() {
+  depends+=(python-termcolor python-astor python-gast python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing)
+  conflicts=(python-tensorflow)
+  provides=(python-tensorflow)
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
+
+  cd ${srcdir}/tensorflow-${_pkgver}-opt
+
+  WHEEL_PACKAGE=$(find ${srcdir}/tmpopt -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+
+  # tensorboard has been separated from upstream but they still install it with
+  # tensorflow. I don't know what kind of sense that makes but we have to clean
+  # it out from this pacakge.
+  rm -rf ${pkgdir}/usr/bin/tensorboard
+
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_python-tensorflow-cuda() {
+  depends+=(python-termcolor python-astor python-gast python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing)
+  conflicts=(python-tensorflow)
+  provides=(python-tensorflow)
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
+
+  cd ${srcdir}/tensorflow-${_pkgver}-cuda
+
+  WHEEL_PACKAGE=$(find ${srcdir}/tmpcuda -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+
+  # tensorboard has been separated from upstream but they still install it with
+  # tensorflow. I don't know what kind of sense that makes but we have to clean
+  # it out from this pacakge.
+  rm -rf ${pkgdir}/usr/bin/tensorboard
+
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+package_python-tensorflow-opt-cuda() {
+  depends+=(python-termcolor python-astor python-gast python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing)
+  conflicts=(python-tensorflow)
+  provides=(python-tensorflow python-tensorflow-cuda)
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
+
+  cd ${srcdir}/tensorflow-${_pkgver}-opt-cuda
+
+  WHEEL_PACKAGE=$(find ${srcdir}/tmpcudaopt -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root $pkgdir/ $WHEEL_PACKAGE --no-dependencies
+
+  # tensorboard has been separated from upstream but they still install it with
+  # tensorflow. I don't know what kind of sense that makes but we have to clean
+  # it out from this pacakge.
+  rm -rf ${pkgdir}/usr/bin/tensorboard
+
+  install -Dm644 LICENSE ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+}
+
+# vim:set ts=2 sw=2 et:

Copied: tensorflow/repos/community-x86_64/explicitly_import_bazelrc.patch (from rev 405615, tensorflow/trunk/explicitly_import_bazelrc.patch)
===================================================================
--- explicitly_import_bazelrc.patch	                        (rev 0)
+++ explicitly_import_bazelrc.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,24 @@
+From 03e63a291bc95dacaa821585f39a360b43465cb5 Mon Sep 17 00:00:00 2001
+From: Yun Peng <pcloudy at google.com>
+Date: Wed, 7 Nov 2018 11:18:53 +0100
+Subject: [PATCH] Explicitly import tools/bazel.rc
+
+To fix build with Bazel 0.19.0 or later and it won't break build with old version or Bazel
+Fixes https://github.com/tensorflow/tensorflow/issues/23398
+---
+ configure.py | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure.py b/configure.py
+index 2eeeceb3399c..2d2bcd8d5838 100644
+--- a/configure.py
++++ b/configure.py
+@@ -1555,6 +1555,9 @@ def main():
+   check_bazel_version('0.15.0')
+ 
+   reset_tf_configure_bazelrc()
++  # Explicitly import tools/bazel.rc, this is needed for Bazel 0.19.0 or later
++  write_to_bazelrc('import %workspace%/tools/bazel.rc')
++
+   cleanup_makefile()
+   setup_python(environ_cp)

Deleted: protobuf-python37-apply.patch
===================================================================
--- protobuf-python37-apply.patch	2018-11-10 03:17:00 UTC (rev 405615)
+++ protobuf-python37-apply.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,28 +0,0 @@
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index 758c94c542..42312d7eeb 100755
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -377,6 +377,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
-         urls = PROTOBUF_URLS,
-         sha256 = PROTOBUF_SHA256,
-         strip_prefix = PROTOBUF_STRIP_PREFIX,
-+        patch_file = clean_dep("//third_party:protobuf-python37.patch"),
-     )
- 
-     # We need to import the protobuf library under the names com_google_protobuf
-@@ -387,6 +388,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
-         urls = PROTOBUF_URLS,
-         sha256 = PROTOBUF_SHA256,
-         strip_prefix = PROTOBUF_STRIP_PREFIX,
-+        patch_file = clean_dep("//third_party:protobuf-python37.patch"),
-     )
- 
-     tf_http_archive(
-@@ -394,6 +396,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
-         urls = PROTOBUF_URLS,
-         sha256 = PROTOBUF_SHA256,
-         strip_prefix = PROTOBUF_STRIP_PREFIX,
-+        patch_file = clean_dep("//third_party:protobuf-python37.patch"),
-     )
- 
-     tf_http_archive(

Copied: tensorflow/repos/community-x86_64/protobuf-python37-apply.patch (from rev 405615, tensorflow/trunk/protobuf-python37-apply.patch)
===================================================================
--- protobuf-python37-apply.patch	                        (rev 0)
+++ protobuf-python37-apply.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,28 @@
+diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
+index 758c94c542..42312d7eeb 100755
+--- a/tensorflow/workspace.bzl
++++ b/tensorflow/workspace.bzl
+@@ -377,6 +377,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
+         sha256 = PROTOBUF_SHA256,
+         strip_prefix = PROTOBUF_STRIP_PREFIX,
+         urls = PROTOBUF_URLS,
++        patch_file = clean_dep("//third_party:protobuf-python37.patch"),
+     )
+ 
+     # We need to import the protobuf library under the names com_google_protobuf
+@@ -387,6 +388,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
+         sha256 = PROTOBUF_SHA256,
+         strip_prefix = PROTOBUF_STRIP_PREFIX,
+         urls = PROTOBUF_URLS,
++        patch_file = clean_dep("//third_party:protobuf-python37.patch"),
+     )
+ 
+     tf_http_archive(
+@@ -394,6 +396,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
+         sha256 = PROTOBUF_SHA256,
+         strip_prefix = PROTOBUF_STRIP_PREFIX,
+         urls = PROTOBUF_URLS,
++        patch_file = clean_dep("//third_party:protobuf-python37.patch"),
+     )
+ 
+     tf_http_archive(

Deleted: protobuf-python37.patch
===================================================================
--- protobuf-python37.patch	2018-11-10 03:17:00 UTC (rev 405615)
+++ protobuf-python37.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,91 +0,0 @@
-From 0a59054c30e4f0ba10f10acfc1d7f3814c63e1a7 Mon Sep 17 00:00:00 2001
-From: Ben Webb <ben at salilab.org>
-Date: Thu, 12 Jul 2018 10:58:10 -0700
-Subject: [PATCH] Add Python 3.7 compatibility (#4862)
-
-Compilation of Python wrappers fails with Python 3.7 because
-the Python folks changed their C API such that
-PyUnicode_AsUTF8AndSize() now returns a const char* rather
-than a char*. Add a patch to work around. Relates #4086.
----
- python/google/protobuf/pyext/descriptor.cc            | 2 +-
- python/google/protobuf/pyext/descriptor_containers.cc | 2 +-
- python/google/protobuf/pyext/descriptor_pool.cc       | 2 +-
- python/google/protobuf/pyext/extension_dict.cc        | 2 +-
- python/google/protobuf/pyext/message.cc               | 4 ++--
- 5 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc
-index 8af0cb1289..19a1c38a62 100644
---- a/python/google/protobuf/pyext/descriptor.cc
-+++ b/python/google/protobuf/pyext/descriptor.cc
-@@ -56,7 +56,7 @@
-   #endif
-   #define PyString_AsStringAndSize(ob, charpp, sizep) \
-     (PyUnicode_Check(ob)? \
--       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
-+       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
-        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
- #endif
- 
-diff --git a/python/google/protobuf/pyext/descriptor_containers.cc b/python/google/protobuf/pyext/descriptor_containers.cc
-index bc007f7efa..0153664f50 100644
---- a/python/google/protobuf/pyext/descriptor_containers.cc
-+++ b/python/google/protobuf/pyext/descriptor_containers.cc
-@@ -66,7 +66,7 @@
-   #endif
-   #define PyString_AsStringAndSize(ob, charpp, sizep) \
-     (PyUnicode_Check(ob)? \
--       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
-+       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
-        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
- #endif
- 
-diff --git a/python/google/protobuf/pyext/descriptor_pool.cc b/python/google/protobuf/pyext/descriptor_pool.cc
-index 95882aeb35..962accc6e9 100644
---- a/python/google/protobuf/pyext/descriptor_pool.cc
-+++ b/python/google/protobuf/pyext/descriptor_pool.cc
-@@ -48,7 +48,7 @@
-   #endif
-   #define PyString_AsStringAndSize(ob, charpp, sizep) \
-     (PyUnicode_Check(ob)? \
--       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
-+       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
-        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
- #endif
- 
-diff --git a/python/google/protobuf/pyext/extension_dict.cc b/python/google/protobuf/pyext/extension_dict.cc
-index 018b5c2c49..174c5470c2 100644
---- a/python/google/protobuf/pyext/extension_dict.cc
-+++ b/python/google/protobuf/pyext/extension_dict.cc
-@@ -53,7 +53,7 @@
-   #endif
-   #define PyString_AsStringAndSize(ob, charpp, sizep) \
-     (PyUnicode_Check(ob)? \
--       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
-+       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
-        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
- #endif
- 
-diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
-index 53736b9c9f..b2984509dd 100644
---- a/python/google/protobuf/pyext/message.cc
-+++ b/python/google/protobuf/pyext/message.cc
-@@ -79,7 +79,7 @@
-     (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob))
-   #define PyString_AsStringAndSize(ob, charpp, sizep) \
-     (PyUnicode_Check(ob)? \
--       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
-+       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
-        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
-   #endif
- #endif
-@@ -1529,7 +1529,7 @@ PyObject* HasField(CMessage* self, PyObject* arg) {
-     return NULL;
-   }
- #else
--  field_name = PyUnicode_AsUTF8AndSize(arg, &size);
-+  field_name = const_cast<char*>(PyUnicode_AsUTF8AndSize(arg, &size));
-   if (!field_name) {
-     return NULL;
-   }

Copied: tensorflow/repos/community-x86_64/protobuf-python37.patch (from rev 405615, tensorflow/trunk/protobuf-python37.patch)
===================================================================
--- protobuf-python37.patch	                        (rev 0)
+++ protobuf-python37.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,91 @@
+From 5c42943e75231b79f4ffcc37a22f0077a2fb0e7d Mon Sep 17 00:00:00 2001
+From: Ben Webb <ben at salilab.org>
+Date: Tue, 3 Jul 2018 09:51:09 -0700
+Subject: [PATCH] Add Python 3.7 compatibility
+
+Compilation of Python wrappers fails with Python 3.7 because
+the Python folks changed their C API such that
+PyUnicode_AsUTF8AndSize() now returns a const char* rather
+than a char*. Add a patch to work around. Relates #4086.
+---
+ python/google/protobuf/pyext/descriptor.cc            | 2 +-
+ python/google/protobuf/pyext/descriptor_containers.cc | 2 +-
+ python/google/protobuf/pyext/descriptor_pool.cc       | 2 +-
+ python/google/protobuf/pyext/extension_dict.cc        | 2 +-
+ python/google/protobuf/pyext/message.cc               | 4 ++--
+ 5 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc
+index 8af0cb1289..19a1c38a62 100644
+--- a/python/google/protobuf/pyext/descriptor.cc
++++ b/python/google/protobuf/pyext/descriptor.cc
+@@ -56,7 +56,7 @@
+   #endif
+   #define PyString_AsStringAndSize(ob, charpp, sizep) \
+     (PyUnicode_Check(ob)? \
+-       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
++       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
+        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
+ #endif
+ 
+diff --git a/python/google/protobuf/pyext/descriptor_containers.cc b/python/google/protobuf/pyext/descriptor_containers.cc
+index bc007f7efa..0153664f50 100644
+--- a/python/google/protobuf/pyext/descriptor_containers.cc
++++ b/python/google/protobuf/pyext/descriptor_containers.cc
+@@ -66,7 +66,7 @@
+   #endif
+   #define PyString_AsStringAndSize(ob, charpp, sizep) \
+     (PyUnicode_Check(ob)? \
+-       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
++       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
+        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
+ #endif
+ 
+diff --git a/python/google/protobuf/pyext/descriptor_pool.cc b/python/google/protobuf/pyext/descriptor_pool.cc
+index 95882aeb35..962accc6e9 100644
+--- a/python/google/protobuf/pyext/descriptor_pool.cc
++++ b/python/google/protobuf/pyext/descriptor_pool.cc
+@@ -48,7 +48,7 @@
+   #endif
+   #define PyString_AsStringAndSize(ob, charpp, sizep) \
+     (PyUnicode_Check(ob)? \
+-       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
++       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
+        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
+ #endif
+ 
+diff --git a/python/google/protobuf/pyext/extension_dict.cc b/python/google/protobuf/pyext/extension_dict.cc
+index 018b5c2c49..174c5470c2 100644
+--- a/python/google/protobuf/pyext/extension_dict.cc
++++ b/python/google/protobuf/pyext/extension_dict.cc
+@@ -53,7 +53,7 @@
+   #endif
+   #define PyString_AsStringAndSize(ob, charpp, sizep) \
+     (PyUnicode_Check(ob)? \
+-       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
++       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
+        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
+ #endif
+ 
+diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
+index 53736b9c9f..b2984509dd 100644
+--- a/python/google/protobuf/pyext/message.cc
++++ b/python/google/protobuf/pyext/message.cc
+@@ -79,7 +79,7 @@
+     (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob))
+   #define PyString_AsStringAndSize(ob, charpp, sizep) \
+     (PyUnicode_Check(ob)? \
+-       ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
++       ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \
+        PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
+   #endif
+ #endif
+@@ -1529,7 +1529,7 @@ PyObject* HasField(CMessage* self, PyObject* arg) {
+     return NULL;
+   }
+ #else
+-  field_name = PyUnicode_AsUTF8AndSize(arg, &size);
++  field_name = const_cast<char*>(PyUnicode_AsUTF8AndSize(arg, &size));
+   if (!field_name) {
+     return NULL;
+   }

Copied: tensorflow/repos/community-x86_64/protobuf-version-bump.patch (from rev 405615, tensorflow/trunk/protobuf-version-bump.patch)
===================================================================
--- protobuf-version-bump.patch	                        (rev 0)
+++ protobuf-version-bump.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,30 @@
+From 3e8295b03eac9c0e84ca6707000bade78c360221 Mon Sep 17 00:00:00 2001
+From: Michael <michael-k at users.noreply.github.com>
+Date: Fri, 2 Nov 2018 12:52:38 +0000
+Subject: [PATCH] Update protobuf for Python 3.7 compat
+
+Regards tensorflow/tensorflow#20517
+---
+ tensorflow/workspace.bzl | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
+index 08739f15548f..60a54bec1900 100755
+--- a/tensorflow/workspace.bzl
++++ b/tensorflow/workspace.bzl
+@@ -345,11 +345,11 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
+     )
+ 
+     PROTOBUF_URLS = [
+-        "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
+-        "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
++        "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.1.tar.gz",
++        "https://github.com/google/protobuf/archive/v3.6.1.tar.gz",
+     ]
+-    PROTOBUF_SHA256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4"
+-    PROTOBUF_STRIP_PREFIX = "protobuf-3.6.0"
++    PROTOBUF_SHA256 = "3d4e589d81b2006ca603c1ab712c9715a76227293032d05b26fca603f90b3f5b"
++    PROTOBUF_STRIP_PREFIX = "protobuf-3.6.1"
+ 
+     tf_http_archive(
+         name = "protobuf_archive",

Deleted: python37.patch
===================================================================
--- python37.patch	2018-11-10 03:17:00 UTC (rev 405615)
+++ python37.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,70 +0,0 @@
-diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h
-index fdbd5374b2..4dfcaf8100 100644
---- a/tensorflow/c/eager/c_api.h
-+++ b/tensorflow/c/eager/c_api.h
-@@ -76,7 +76,7 @@ typedef enum TFE_ContextDevicePlacementPolicy {
- // Sets the default execution mode (sync/async). Note that this can be
- // overridden per thread using TFE_ContextSetAsyncForThread.
- TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*,
--                                                      unsigned char async);
-+                                                      unsigned char is_async);
- 
- TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy(
-     TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy);
-@@ -125,7 +125,7 @@ TFE_ContextGetDevicePlacementPolicy(TFE_Context*);
- 
- // Overrides the execution mode (sync/async) for the current thread.
- TF_CAPI_EXPORT extern void TFE_ContextSetAsyncForThread(TFE_Context*,
--                                                        unsigned char async,
-+                                                        unsigned char is_async,
-                                                         TF_Status* status);
- 
- // Causes the calling thread to block till all ops dispatched in async mode
-diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc
-index ec7e2371e9..fe1a3bed84 100644
---- a/tensorflow/python/eager/pywrap_tfe_src.cc
-+++ b/tensorflow/python/eager/pywrap_tfe_src.cc
-@@ -216,7 +216,7 @@ bool ParseStringValue(const string& key, PyObject* py_value, TF_Status* status,
- #if PY_MAJOR_VERSION >= 3
-   if (PyUnicode_Check(py_value)) {
-     Py_ssize_t size = 0;
--    char* buf = PyUnicode_AsUTF8AndSize(py_value, &size);
-+    const char* buf = PyUnicode_AsUTF8AndSize(py_value, &size);
-     if (buf == nullptr) return false;
-     *value = tensorflow::StringPiece(buf, size);
-     return true;
-@@ -831,7 +831,7 @@ char* TFE_GetPythonString(PyObject* o) {
-   }
- #if PY_MAJOR_VERSION >= 3
-   if (PyUnicode_Check(o)) {
--    return PyUnicode_AsUTF8(o);
-+    return (char *)PyUnicode_AsUTF8(o);
-   }
- #endif
-   return nullptr;
-diff --git a/tensorflow/python/lib/core/ndarray_tensor.cc b/tensorflow/python/lib/core/ndarray_tensor.cc
-index ec1ba7b8f7..2e09757ed6 100644
---- a/tensorflow/python/lib/core/ndarray_tensor.cc
-+++ b/tensorflow/python/lib/core/ndarray_tensor.cc
-@@ -154,7 +154,7 @@ Status PyBytesArrayMap(PyArrayObject* array, F f) {
-     if (PyUnicode_Check(item.get())) {
- #if PY_VERSION_HEX >= 0x03030000
-       // Accept unicode by converting to UTF-8 bytes.
--      ptr = PyUnicode_AsUTF8AndSize(item.get(), &len);
-+      ptr = (char *)PyUnicode_AsUTF8AndSize(item.get(), &len);
-       if (!ptr) {
-         return errors::Internal("Unable to get element as UTF-8.");
-       }
-diff --git a/tensorflow/python/lib/core/py_func.cc b/tensorflow/python/lib/core/py_func.cc
-index 57139986af..9b198e22da 100644
---- a/tensorflow/python/lib/core/py_func.cc
-+++ b/tensorflow/python/lib/core/py_func.cc
-@@ -352,7 +352,7 @@ Status ConvertNdarrayToTensor(PyObject* obj, Tensor* ret) {
-         Py_ssize_t el_size;
-         if (PyBytes_AsStringAndSize(input_data[i], &el, &el_size) == -1) {
- #if PY_MAJOR_VERSION >= 3
--          el = PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
-+          el = (char *)PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
- #else
-           el = nullptr;
-           if (PyUnicode_Check(input_data[i])) {

Copied: tensorflow/repos/community-x86_64/python37.patch (from rev 405615, tensorflow/trunk/python37.patch)
===================================================================
--- python37.patch	                        (rev 0)
+++ python37.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,70 @@
+diff --git a/tensorflow/c/eager/c_api.h b/tensorflow/c/eager/c_api.h
+index fdbd5374b2..4dfcaf8100 100644
+--- a/tensorflow/c/eager/c_api.h
++++ b/tensorflow/c/eager/c_api.h
+@@ -76,7 +76,7 @@ typedef enum TFE_ContextDevicePlacementPolicy {
+ // Sets the default execution mode (sync/async). Note that this can be
+ // overridden per thread using TFE_ContextSetAsyncForThread.
+ TF_CAPI_EXPORT extern void TFE_ContextOptionsSetAsync(TFE_ContextOptions*,
+-                                                      unsigned char async);
++                                                      unsigned char is_async);
+ 
+ TF_CAPI_EXPORT extern void TFE_ContextOptionsSetDevicePlacementPolicy(
+     TFE_ContextOptions*, TFE_ContextDevicePlacementPolicy);
+@@ -125,7 +125,7 @@ TFE_ContextGetDevicePlacementPolicy(TFE_Context*);
+ 
+ // Overrides the execution mode (sync/async) for the current thread.
+ TF_CAPI_EXPORT extern void TFE_ContextSetAsyncForThread(TFE_Context*,
+-                                                        unsigned char async,
++                                                        unsigned char is_async,
+                                                         TF_Status* status);
+ 
+ // Causes the calling thread to block till all ops dispatched in async mode
+diff --git a/tensorflow/python/eager/pywrap_tfe_src.cc b/tensorflow/python/eager/pywrap_tfe_src.cc
+index ec7e2371e9..fe1a3bed84 100644
+--- a/tensorflow/python/eager/pywrap_tfe_src.cc
++++ b/tensorflow/python/eager/pywrap_tfe_src.cc
+@@ -216,7 +216,7 @@ bool ParseStringValue(const string& key, PyObject* py_value, TF_Status* status,
+ #if PY_MAJOR_VERSION >= 3
+   if (PyUnicode_Check(py_value)) {
+     Py_ssize_t size = 0;
+-    char* buf = PyUnicode_AsUTF8AndSize(py_value, &size);
++    const char* buf = PyUnicode_AsUTF8AndSize(py_value, &size);
+     if (buf == nullptr) return false;
+     *value = tensorflow::StringPiece(buf, size);
+     return true;
+@@ -831,7 +831,7 @@ char* TFE_GetPythonString(PyObject* o) {
+   }
+ #if PY_MAJOR_VERSION >= 3
+   if (PyUnicode_Check(o)) {
+-    return PyUnicode_AsUTF8(o);
++    return (char *)PyUnicode_AsUTF8(o);
+   }
+ #endif
+   return nullptr;
+diff --git a/tensorflow/python/lib/core/ndarray_tensor.cc b/tensorflow/python/lib/core/ndarray_tensor.cc
+index ec1ba7b8f7..2e09757ed6 100644
+--- a/tensorflow/python/lib/core/ndarray_tensor.cc
++++ b/tensorflow/python/lib/core/ndarray_tensor.cc
+@@ -154,7 +154,7 @@ Status PyBytesArrayMap(PyArrayObject* array, F f) {
+     if (PyUnicode_Check(item.get())) {
+ #if PY_VERSION_HEX >= 0x03030000
+       // Accept unicode by converting to UTF-8 bytes.
+-      ptr = PyUnicode_AsUTF8AndSize(item.get(), &len);
++      ptr = (char *)PyUnicode_AsUTF8AndSize(item.get(), &len);
+       if (!ptr) {
+         return errors::Internal("Unable to get element as UTF-8.");
+       }
+diff --git a/tensorflow/python/lib/core/py_func.cc b/tensorflow/python/lib/core/py_func.cc
+index 57139986af..9b198e22da 100644
+--- a/tensorflow/python/lib/core/py_func.cc
++++ b/tensorflow/python/lib/core/py_func.cc
+@@ -352,7 +352,7 @@ Status ConvertNdarrayToTensor(PyObject* obj, Tensor* ret) {
+         Py_ssize_t el_size;
+         if (PyBytes_AsStringAndSize(input_data[i], &el, &el_size) == -1) {
+ #if PY_MAJOR_VERSION >= 3
+-          el = PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
++          el = (char *)PyUnicode_AsUTF8AndSize(input_data[i], &el_size);
+ #else
+           el = nullptr;
+           if (PyUnicode_Check(input_data[i])) {

Deleted: update-cython.patch
===================================================================
--- update-cython.patch	2018-11-10 03:17:00 UTC (rev 405615)
+++ update-cython.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,34 +0,0 @@
-From f7b39b0e72c1c8e9d0e72e3007000de39ee7a5ff Mon Sep 17 00:00:00 2001
-From: Yong Tang <yong.tang.github at outlook.com>
-Date: Mon, 25 Jun 2018 21:39:44 -0700
-Subject: [PATCH] Update cython to 0.28.3 (#20228)
-
-This fix updates the cython from 3732784 (09/2017)
-to the latest versioned release of 0.28.3 (05/2018).
-
-Signed-off-by: Yong Tang <yong.tang.github at outlook.com>
----
- tensorflow/workspace.bzl | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index b963bdab306..404eeb8aa36 100644
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -662,12 +662,12 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
- 
-   tf_http_archive(
-       name = "cython",
--      sha256 = "6dcd30b5ceb887b2b965ee7ceb82ea3acb5f0642fe2206c7636b45acea4798e5",
-+      sha256 = "05e3eb7f06043f5ff2028338370329e71c29f57315e95f4dc6ad7c4971dd4c6f",
-       urls = [
--          "https://mirror.bazel.build/github.com/cython/cython/archive/3732784c45cfb040a5b0936951d196f83a12ea17.tar.gz",
--          "https://github.com/cython/cython/archive/3732784c45cfb040a5b0936951d196f83a12ea17.tar.gz",
-+          "https://mirror.bazel.build/github.com/cython/cython/archive/0.28.3.tar.gz",
-+          "https://github.com/cython/cython/archive/0.28.3.tar.gz",
-       ],
--      strip_prefix = "cython-3732784c45cfb040a5b0936951d196f83a12ea17",
-+      strip_prefix = "cython-0.28.3",
-       build_file = clean_dep("//third_party:cython.BUILD"),
-       delete = ["BUILD.bazel"],
-   )

Copied: tensorflow/repos/community-x86_64/update-cython.patch (from rev 405615, tensorflow/trunk/update-cython.patch)
===================================================================
--- update-cython.patch	                        (rev 0)
+++ update-cython.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,34 @@
+From f7b39b0e72c1c8e9d0e72e3007000de39ee7a5ff Mon Sep 17 00:00:00 2001
+From: Yong Tang <yong.tang.github at outlook.com>
+Date: Mon, 25 Jun 2018 21:39:44 -0700
+Subject: [PATCH] Update cython to 0.28.3 (#20228)
+
+This fix updates the cython from 3732784 (09/2017)
+to the latest versioned release of 0.28.3 (05/2018).
+
+Signed-off-by: Yong Tang <yong.tang.github at outlook.com>
+---
+ tensorflow/workspace.bzl | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
+index b963bdab306..404eeb8aa36 100644
+--- a/tensorflow/workspace.bzl
++++ b/tensorflow/workspace.bzl
+@@ -662,12 +662,12 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
+ 
+   tf_http_archive(
+       name = "cython",
+-      sha256 = "6dcd30b5ceb887b2b965ee7ceb82ea3acb5f0642fe2206c7636b45acea4798e5",
++      sha256 = "05e3eb7f06043f5ff2028338370329e71c29f57315e95f4dc6ad7c4971dd4c6f",
+       urls = [
+-          "https://mirror.bazel.build/github.com/cython/cython/archive/3732784c45cfb040a5b0936951d196f83a12ea17.tar.gz",
+-          "https://github.com/cython/cython/archive/3732784c45cfb040a5b0936951d196f83a12ea17.tar.gz",
++          "https://mirror.bazel.build/github.com/cython/cython/archive/0.28.3.tar.gz",
++          "https://github.com/cython/cython/archive/0.28.3.tar.gz",
+       ],
+-      strip_prefix = "cython-3732784c45cfb040a5b0936951d196f83a12ea17",
++      strip_prefix = "cython-0.28.3",
+       build_file = clean_dep("//third_party:cython.BUILD"),
+       delete = ["BUILD.bazel"],
+   )

Deleted: update-protobuf.patch
===================================================================
--- update-protobuf.patch	2018-11-10 03:17:00 UTC (rev 405615)
+++ update-protobuf.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -1,146 +0,0 @@
-From 3bfd3aeb7856f414e511e20493dd1bdf952649cf Mon Sep 17 00:00:00 2001
-From: Gunhan Gulsoy <gunan at google.com>
-Date: Wed, 20 Jun 2018 11:29:27 -0700
-Subject: [PATCH] Update protobuf dependency of TF to 3.6.
-
-PiperOrigin-RevId: 201386306
----
- tensorflow/contrib/cmake/external/protobuf.cmake   |  2 +-
- .../tools/ci_build/install/install_pip_packages.sh |  4 ++--
- .../tools/ci_build/install/install_proto3.sh       |  2 +-
- .../install/install_python3.5_pip_packages.sh      |  2 +-
- .../install/install_python3.6_pip_packages.sh      |  2 +-
- tensorflow/tools/pip_package/setup.py              |  2 +-
- tensorflow/workspace.bzl                           | 24 +++++++++++-----------
- 7 files changed, 19 insertions(+), 19 deletions(-)
-
-diff --git a/tensorflow/contrib/cmake/external/protobuf.cmake b/tensorflow/contrib/cmake/external/protobuf.cmake
-index ab464bc99a4..f56fb35a0f7 100644
---- a/tensorflow/contrib/cmake/external/protobuf.cmake
-+++ b/tensorflow/contrib/cmake/external/protobuf.cmake
-@@ -16,7 +16,7 @@ include (ExternalProject)
- 
- set(PROTOBUF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src)
- set(PROTOBUF_URL https://github.com/google/protobuf.git)
--set(PROTOBUF_TAG b04e5cba356212e4e8c66c61bbe0c3a20537c5b9)
-+set(PROTOBUF_TAG v3.6.0)
- 
- if(WIN32)
-   if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
-diff --git a/tensorflow/tools/ci_build/install/install_pip_packages.sh b/tensorflow/tools/ci_build/install/install_pip_packages.sh
-index 88f1d041932..fbed4574e02 100755
---- a/tensorflow/tools/ci_build/install/install_pip_packages.sh
-+++ b/tensorflow/tools/ci_build/install/install_pip_packages.sh
-@@ -51,8 +51,8 @@ pip2 install --upgrade markdown==2.6.8
- pip3 install --upgrade markdown==2.6.8
- 
- # Install protobuf.
--pip2 install --upgrade protobuf==3.3.0
--pip3 install --upgrade protobuf==3.3.0
-+pip2 install --upgrade protobuf==3.6.0
-+pip3 install --upgrade protobuf==3.6.0
- 
- # Remove obsolete version of six, which can sometimes confuse virtualenv.
- rm -rf /usr/lib/python3/dist-packages/six*
-diff --git a/tensorflow/tools/ci_build/install/install_proto3.sh b/tensorflow/tools/ci_build/install/install_proto3.sh
-index 7934002b2c9..821d50baff3 100755
---- a/tensorflow/tools/ci_build/install/install_proto3.sh
-+++ b/tensorflow/tools/ci_build/install/install_proto3.sh
-@@ -17,7 +17,7 @@
- # Install protobuf3.
- 
- # Select protobuf version.
--PROTOBUF_VERSION="3.3.0"
-+PROTOBUF_VERSION="3.6.0"
- protobuf_ver_flat=$(echo $PROTOBUF_VERSION | sed 's/\.//g' | sed 's/^0*//g')
- local_protobuf_ver=$(protoc --version)
- local_protobuf_ver_flat=$(echo $local_protobuf_ver | sed 's/\.//g' | sed 's/^0*//g')
-diff --git a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
-index acd69ef346f..037fc0e2e1e 100755
---- a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
-+++ b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
-@@ -48,7 +48,7 @@ pip3.5 install --upgrade absl-py
- pip3.5 install --upgrade six==1.10.0
- 
- # Install protobuf.
--pip3.5 install --upgrade protobuf==3.3.0
-+pip3.5 install --upgrade protobuf==3.6.0
- 
- # Remove obsolete version of six, which can sometimes confuse virtualenv.
- rm -rf /usr/lib/python3/dist-packages/six*
-diff --git a/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
-index 323b30f48e3..8fd65a3ee26 100755
---- a/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
-+++ b/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
-@@ -60,7 +60,7 @@ pip3 install --upgrade absl-py
- pip3 install --upgrade six==1.10.0
- 
- # Install protobuf.
--pip3 install --upgrade protobuf==3.3.0
-+pip3 install --upgrade protobuf==3.6.0
- 
- # Remove obsolete version of six, which can sometimes confuse virtualenv.
- rm -rf /usr/lib/python3/dist-packages/six*
-diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
-index 97f625e7e9c..253802b9598 100644
---- a/tensorflow/tools/pip_package/setup.py
-+++ b/tensorflow/tools/pip_package/setup.py
-@@ -53,7 +53,7 @@
-     'gast >= 0.2.0',
-     'numpy >= 1.13.3',
-     'six >= 1.10.0',
--    'protobuf >= 3.4.0',
-+    'protobuf >= 3.6.0',
-     'setuptools <= 39.1.0',
-     'tensorboard >= 1.8.0, < 1.9.0',
-     'termcolor >= 1.1.0',
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index b32d4732199..1f1d106bfb9 100644
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -330,11 +330,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
-   tf_http_archive(
-       name = "protobuf_archive",
-       urls = [
--          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
--          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
-+          "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
-+          "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
-       ],
--      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
--      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
-+      sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4",
-+      strip_prefix = "protobuf-3.6.0",
-   )
- 
-   # We need to import the protobuf library under the names com_google_protobuf
-@@ -343,21 +343,21 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
-   tf_http_archive(
-       name = "com_google_protobuf",
-       urls = [
--          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
--          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
-+          "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
-+          "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
-       ],
--      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
--      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
-+      sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4",
-+      strip_prefix = "protobuf-3.6.0",
-   )
- 
-   tf_http_archive(
-       name = "com_google_protobuf_cc",
-       urls = [
--          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
--          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
-+          "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
-+          "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
-       ],
--      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
--      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
-+      sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4",
-+      strip_prefix = "protobuf-3.6.0",
-   )
- 
-   tf_http_archive(

Copied: tensorflow/repos/community-x86_64/update-protobuf.patch (from rev 405615, tensorflow/trunk/update-protobuf.patch)
===================================================================
--- update-protobuf.patch	                        (rev 0)
+++ update-protobuf.patch	2018-11-10 03:17:26 UTC (rev 405616)
@@ -0,0 +1,146 @@
+From 3bfd3aeb7856f414e511e20493dd1bdf952649cf Mon Sep 17 00:00:00 2001
+From: Gunhan Gulsoy <gunan at google.com>
+Date: Wed, 20 Jun 2018 11:29:27 -0700
+Subject: [PATCH] Update protobuf dependency of TF to 3.6.
+
+PiperOrigin-RevId: 201386306
+---
+ tensorflow/contrib/cmake/external/protobuf.cmake   |  2 +-
+ .../tools/ci_build/install/install_pip_packages.sh |  4 ++--
+ .../tools/ci_build/install/install_proto3.sh       |  2 +-
+ .../install/install_python3.5_pip_packages.sh      |  2 +-
+ .../install/install_python3.6_pip_packages.sh      |  2 +-
+ tensorflow/tools/pip_package/setup.py              |  2 +-
+ tensorflow/workspace.bzl                           | 24 +++++++++++-----------
+ 7 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/tensorflow/contrib/cmake/external/protobuf.cmake b/tensorflow/contrib/cmake/external/protobuf.cmake
+index ab464bc99a4..f56fb35a0f7 100644
+--- a/tensorflow/contrib/cmake/external/protobuf.cmake
++++ b/tensorflow/contrib/cmake/external/protobuf.cmake
+@@ -16,7 +16,7 @@ include (ExternalProject)
+ 
+ set(PROTOBUF_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/protobuf/src/protobuf/src)
+ set(PROTOBUF_URL https://github.com/google/protobuf.git)
+-set(PROTOBUF_TAG b04e5cba356212e4e8c66c61bbe0c3a20537c5b9)
++set(PROTOBUF_TAG v3.6.0)
+ 
+ if(WIN32)
+   if(${CMAKE_GENERATOR} MATCHES "Visual Studio.*")
+diff --git a/tensorflow/tools/ci_build/install/install_pip_packages.sh b/tensorflow/tools/ci_build/install/install_pip_packages.sh
+index 88f1d041932..fbed4574e02 100755
+--- a/tensorflow/tools/ci_build/install/install_pip_packages.sh
++++ b/tensorflow/tools/ci_build/install/install_pip_packages.sh
+@@ -51,8 +51,8 @@ pip2 install --upgrade markdown==2.6.8
+ pip3 install --upgrade markdown==2.6.8
+ 
+ # Install protobuf.
+-pip2 install --upgrade protobuf==3.3.0
+-pip3 install --upgrade protobuf==3.3.0
++pip2 install --upgrade protobuf==3.6.0
++pip3 install --upgrade protobuf==3.6.0
+ 
+ # Remove obsolete version of six, which can sometimes confuse virtualenv.
+ rm -rf /usr/lib/python3/dist-packages/six*
+diff --git a/tensorflow/tools/ci_build/install/install_proto3.sh b/tensorflow/tools/ci_build/install/install_proto3.sh
+index 7934002b2c9..821d50baff3 100755
+--- a/tensorflow/tools/ci_build/install/install_proto3.sh
++++ b/tensorflow/tools/ci_build/install/install_proto3.sh
+@@ -17,7 +17,7 @@
+ # Install protobuf3.
+ 
+ # Select protobuf version.
+-PROTOBUF_VERSION="3.3.0"
++PROTOBUF_VERSION="3.6.0"
+ protobuf_ver_flat=$(echo $PROTOBUF_VERSION | sed 's/\.//g' | sed 's/^0*//g')
+ local_protobuf_ver=$(protoc --version)
+ local_protobuf_ver_flat=$(echo $local_protobuf_ver | sed 's/\.//g' | sed 's/^0*//g')
+diff --git a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
+index acd69ef346f..037fc0e2e1e 100755
+--- a/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
++++ b/tensorflow/tools/ci_build/install/install_python3.5_pip_packages.sh
+@@ -48,7 +48,7 @@ pip3.5 install --upgrade absl-py
+ pip3.5 install --upgrade six==1.10.0
+ 
+ # Install protobuf.
+-pip3.5 install --upgrade protobuf==3.3.0
++pip3.5 install --upgrade protobuf==3.6.0
+ 
+ # Remove obsolete version of six, which can sometimes confuse virtualenv.
+ rm -rf /usr/lib/python3/dist-packages/six*
+diff --git a/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh b/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
+index 323b30f48e3..8fd65a3ee26 100755
+--- a/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
++++ b/tensorflow/tools/ci_build/install/install_python3.6_pip_packages.sh
+@@ -60,7 +60,7 @@ pip3 install --upgrade absl-py
+ pip3 install --upgrade six==1.10.0
+ 
+ # Install protobuf.
+-pip3 install --upgrade protobuf==3.3.0
++pip3 install --upgrade protobuf==3.6.0
+ 
+ # Remove obsolete version of six, which can sometimes confuse virtualenv.
+ rm -rf /usr/lib/python3/dist-packages/six*
+diff --git a/tensorflow/tools/pip_package/setup.py b/tensorflow/tools/pip_package/setup.py
+index 97f625e7e9c..253802b9598 100644
+--- a/tensorflow/tools/pip_package/setup.py
++++ b/tensorflow/tools/pip_package/setup.py
+@@ -53,7 +53,7 @@
+     'gast >= 0.2.0',
+     'numpy >= 1.13.3',
+     'six >= 1.10.0',
+-    'protobuf >= 3.4.0',
++    'protobuf >= 3.6.0',
+     'setuptools <= 39.1.0',
+     'tensorboard >= 1.8.0, < 1.9.0',
+     'termcolor >= 1.1.0',
+diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
+index b32d4732199..1f1d106bfb9 100644
+--- a/tensorflow/workspace.bzl
++++ b/tensorflow/workspace.bzl
+@@ -330,11 +330,11 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
+   tf_http_archive(
+       name = "protobuf_archive",
+       urls = [
+-          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
+-          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
++          "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
++          "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
+       ],
+-      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
+-      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
++      sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4",
++      strip_prefix = "protobuf-3.6.0",
+   )
+ 
+   # We need to import the protobuf library under the names com_google_protobuf
+@@ -343,21 +343,21 @@ def tf_workspace(path_prefix="", tf_repo_name=""):
+   tf_http_archive(
+       name = "com_google_protobuf",
+       urls = [
+-          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
+-          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
++          "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
++          "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
+       ],
+-      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
+-      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
++      sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4",
++      strip_prefix = "protobuf-3.6.0",
+   )
+ 
+   tf_http_archive(
+       name = "com_google_protobuf_cc",
+       urls = [
+-          "https://mirror.bazel.build/github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
+-          "https://github.com/google/protobuf/archive/396336eb961b75f03b25824fe86cf6490fb75e3a.tar.gz",
++          "https://mirror.bazel.build/github.com/google/protobuf/archive/v3.6.0.tar.gz",
++          "https://github.com/google/protobuf/archive/v3.6.0.tar.gz",
+       ],
+-      sha256 = "846d907acf472ae233ec0882ef3a2d24edbbe834b80c305e867ac65a1f2c59e3",
+-      strip_prefix = "protobuf-396336eb961b75f03b25824fe86cf6490fb75e3a",
++      sha256 = "50a5753995b3142627ac55cfd496cebc418a2e575ca0236e29033c67bd5665f4",
++      strip_prefix = "protobuf-3.6.0",
+   )
+ 
+   tf_http_archive(


More information about the arch-commits mailing list