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

Sven-Hendrik Haase svenstaro at archlinux.org
Thu Mar 19 20:57:21 UTC 2020


    Date: Thursday, March 19, 2020 @ 20:57:20
  Author: svenstaro
Revision: 601198

archrelease: copy trunk to community-x86_64

Added:
  tensorflow/repos/community-x86_64/Add-grpc-fix-for-gettid.patch
    (from rev 601197, tensorflow/trunk/Add-grpc-fix-for-gettid.patch)
  tensorflow/repos/community-x86_64/PKGBUILD
    (from rev 601197, tensorflow/trunk/PKGBUILD)
  tensorflow/repos/community-x86_64/build-against-actual-mkl.patch
    (from rev 601197, tensorflow/trunk/build-against-actual-mkl.patch)
  tensorflow/repos/community-x86_64/f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch
    (from rev 601197, tensorflow/trunk/f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch)
Deleted:
  tensorflow/repos/community-x86_64/Add-grpc-fix-for-gettid.patch
  tensorflow/repos/community-x86_64/PKGBUILD

------------------------------------------------+
 Add-grpc-fix-for-gettid.patch                  |  226 ++++-----
 PKGBUILD                                       |  548 +++++++++++------------
 build-against-actual-mkl.patch                 |   37 +
 f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch |  128 +++++
 4 files changed, 559 insertions(+), 380 deletions(-)

Deleted: Add-grpc-fix-for-gettid.patch
===================================================================
--- Add-grpc-fix-for-gettid.patch	2020-03-19 20:57:05 UTC (rev 601197)
+++ Add-grpc-fix-for-gettid.patch	2020-03-19 20:57:20 UTC (rev 601198)
@@ -1,113 +0,0 @@
-From e50d1fa554154b7e398ef7a0357f646e22cd51cf Mon Sep 17 00:00:00 2001
-From: Jianjun Liu <jianjun.liu at intel.com>
-Date: Thu, 29 Aug 2019 14:56:13 +0800
-Subject: [PATCH] Add grpc fix for gettid
-
-Add gettid fix on gettid conflict because of glibc
-
-Signed-off-by: Jianjun Liu <jianjun.liu at intel.com>
----
- tensorflow/workspace.bzl                  |  1 +
- third_party/Rename-gettid-functions.patch | 78 +++++++++++++++++++++++
- 2 files changed, 79 insertions(+)
- create mode 100644 third_party/Rename-gettid-functions.patch
-
-diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
-index 55d7eb93..33e86087 100755
---- a/tensorflow/workspace.bzl
-+++ b/tensorflow/workspace.bzl
-@@ -486,6 +486,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
-     # WARNING: make sure ncteisen@ and vpai@ are cc-ed on any CL to change the below rule
-     tf_http_archive(
-         name = "grpc",
-+	patch_file = clean_dep("//third_party:Rename-gettid-functions.patch"),
-         sha256 = "67a6c26db56f345f7cee846e681db2c23f919eba46dd639b09462d1b6203d28c",
-         strip_prefix = "grpc-4566c2a29ebec0835643b972eb99f4306c4234a3",
-         system_build_file = clean_dep("//third_party/systemlibs:grpc.BUILD"),
-diff --git a/third_party/Rename-gettid-functions.patch b/third_party/Rename-gettid-functions.patch
-new file mode 100644
-index 00000000..90bd9115
---- /dev/null
-+++ b/third_party/Rename-gettid-functions.patch
-@@ -0,0 +1,78 @@
-+From d1d017390b799c59d6fdf7b8afa6136d218bdd61 Mon Sep 17 00:00:00 2001
-+From: Benjamin Peterson <benjamin at dropbox.com>
-+Date: Fri, 3 May 2019 08:11:00 -0700
-+Subject: [PATCH] Rename gettid() functions.
-+
-+glibc 2.30 will declare its own gettid; see https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92. Rename the grpc versions to avoid naming conflicts.
-+---
-+ src/core/lib/gpr/log_linux.cc          | 4 ++--
-+ src/core/lib/gpr/log_posix.cc          | 4 ++--
-+ src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
-+ 3 files changed, 6 insertions(+), 6 deletions(-)
-+
-+diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
-+index 561276f0c20..8b597b4cf2f 100644
-+--- a/src/core/lib/gpr/log_linux.cc
-++++ b/src/core/lib/gpr/log_linux.cc
-+@@ -40,7 +40,7 @@
-+ #include <time.h>
-+ #include <unistd.h>
-+ 
-+-static long gettid(void) { return syscall(__NR_gettid); }
-++static long sys_gettid(void) { return syscall(__NR_gettid); }
-+ 
-+ void gpr_log(const char* file, int line, gpr_log_severity severity,
-+              const char* format, ...) {
-+@@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
-+   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
-+   struct tm tm;
-+   static __thread long tid = 0;
-+-  if (tid == 0) tid = gettid();
-++  if (tid == 0) tid = sys_gettid();
-+ 
-+   timer = static_cast<time_t>(now.tv_sec);
-+   final_slash = strrchr(args->file, '/');
-+diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
-+index b6edc14ab6b..2f7c6ce3760 100644
-+--- a/src/core/lib/gpr/log_posix.cc
-++++ b/src/core/lib/gpr/log_posix.cc
-+@@ -31,7 +31,7 @@
-+ #include <string.h>
-+ #include <time.h>
-+ 
-+-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
-++static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
-+ 
-+ void gpr_log(const char* file, int line, gpr_log_severity severity,
-+              const char* format, ...) {
-+@@ -86,7 +86,7 @@ void gpr_default_log(gpr_log_func_args* args) {
-+   char* prefix;
-+   gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]",
-+                gpr_log_severity_string(args->severity), time_buffer,
-+-               (int)(now.tv_nsec), gettid(), display_file, args->line);
-++               (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
-+ 
-+   fprintf(stderr, "%-70s %s\n", prefix, args->message);
-+   gpr_free(prefix);
-+diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
-+index 08116b3ab53..76f59844312 100644
-+--- a/src/core/lib/iomgr/ev_epollex_linux.cc
-++++ b/src/core/lib/iomgr/ev_epollex_linux.cc
-+@@ -1102,7 +1102,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
-+ }
-+ 
-+ #ifndef NDEBUG
-+-static long gettid(void) { return syscall(__NR_gettid); }
-++static long sys_gettid(void) { return syscall(__NR_gettid); }
-+ #endif
-+ 
-+ /* pollset->mu lock must be held by the caller before calling this.
-+@@ -1122,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
-+ #define WORKER_PTR (&worker)
-+ #endif
-+ #ifndef NDEBUG
-+-  WORKER_PTR->originator = gettid();
-++  WORKER_PTR->originator = sys_gettid();
-+ #endif
-+   if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
-+     gpr_log(GPR_INFO,
--- 
-2.22.0
-

Copied: tensorflow/repos/community-x86_64/Add-grpc-fix-for-gettid.patch (from rev 601197, tensorflow/trunk/Add-grpc-fix-for-gettid.patch)
===================================================================
--- Add-grpc-fix-for-gettid.patch	                        (rev 0)
+++ Add-grpc-fix-for-gettid.patch	2020-03-19 20:57:20 UTC (rev 601198)
@@ -0,0 +1,113 @@
+From e50d1fa554154b7e398ef7a0357f646e22cd51cf Mon Sep 17 00:00:00 2001
+From: Jianjun Liu <jianjun.liu at intel.com>
+Date: Thu, 29 Aug 2019 14:56:13 +0800
+Subject: [PATCH] Add grpc fix for gettid
+
+Add gettid fix on gettid conflict because of glibc
+
+Signed-off-by: Jianjun Liu <jianjun.liu at intel.com>
+---
+ tensorflow/workspace.bzl                  |  1 +
+ third_party/Rename-gettid-functions.patch | 78 +++++++++++++++++++++++
+ 2 files changed, 79 insertions(+)
+ create mode 100644 third_party/Rename-gettid-functions.patch
+
+diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
+index 55d7eb93..33e86087 100755
+--- a/tensorflow/workspace.bzl
++++ b/tensorflow/workspace.bzl
+@@ -486,6 +486,7 @@ def tf_workspace(path_prefix = "", tf_repo_name = ""):
+     # WARNING: make sure ncteisen@ and vpai@ are cc-ed on any CL to change the below rule
+     tf_http_archive(
+         name = "grpc",
++	patch_file = clean_dep("//third_party:Rename-gettid-functions.patch"),
+         sha256 = "67a6c26db56f345f7cee846e681db2c23f919eba46dd639b09462d1b6203d28c",
+         strip_prefix = "grpc-4566c2a29ebec0835643b972eb99f4306c4234a3",
+         system_build_file = clean_dep("//third_party/systemlibs:grpc.BUILD"),
+diff --git a/third_party/Rename-gettid-functions.patch b/third_party/Rename-gettid-functions.patch
+new file mode 100644
+index 00000000..90bd9115
+--- /dev/null
++++ b/third_party/Rename-gettid-functions.patch
+@@ -0,0 +1,78 @@
++From d1d017390b799c59d6fdf7b8afa6136d218bdd61 Mon Sep 17 00:00:00 2001
++From: Benjamin Peterson <benjamin at dropbox.com>
++Date: Fri, 3 May 2019 08:11:00 -0700
++Subject: [PATCH] Rename gettid() functions.
++
++glibc 2.30 will declare its own gettid; see https://sourceware.org/git/?p=glibc.git;a=commit;h=1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92. Rename the grpc versions to avoid naming conflicts.
++---
++ src/core/lib/gpr/log_linux.cc          | 4 ++--
++ src/core/lib/gpr/log_posix.cc          | 4 ++--
++ src/core/lib/iomgr/ev_epollex_linux.cc | 4 ++--
++ 3 files changed, 6 insertions(+), 6 deletions(-)
++
++diff --git a/src/core/lib/gpr/log_linux.cc b/src/core/lib/gpr/log_linux.cc
++index 561276f0c20..8b597b4cf2f 100644
++--- a/src/core/lib/gpr/log_linux.cc
+++++ b/src/core/lib/gpr/log_linux.cc
++@@ -40,7 +40,7 @@
++ #include <time.h>
++ #include <unistd.h>
++ 
++-static long gettid(void) { return syscall(__NR_gettid); }
+++static long sys_gettid(void) { return syscall(__NR_gettid); }
++ 
++ void gpr_log(const char* file, int line, gpr_log_severity severity,
++              const char* format, ...) {
++@@ -70,7 +70,7 @@ void gpr_default_log(gpr_log_func_args* args) {
++   gpr_timespec now = gpr_now(GPR_CLOCK_REALTIME);
++   struct tm tm;
++   static __thread long tid = 0;
++-  if (tid == 0) tid = gettid();
+++  if (tid == 0) tid = sys_gettid();
++ 
++   timer = static_cast<time_t>(now.tv_sec);
++   final_slash = strrchr(args->file, '/');
++diff --git a/src/core/lib/gpr/log_posix.cc b/src/core/lib/gpr/log_posix.cc
++index b6edc14ab6b..2f7c6ce3760 100644
++--- a/src/core/lib/gpr/log_posix.cc
+++++ b/src/core/lib/gpr/log_posix.cc
++@@ -31,7 +31,7 @@
++ #include <string.h>
++ #include <time.h>
++ 
++-static intptr_t gettid(void) { return (intptr_t)pthread_self(); }
+++static intptr_t sys_gettid(void) { return (intptr_t)pthread_self(); }
++ 
++ void gpr_log(const char* file, int line, gpr_log_severity severity,
++              const char* format, ...) {
++@@ -86,7 +86,7 @@ void gpr_default_log(gpr_log_func_args* args) {
++   char* prefix;
++   gpr_asprintf(&prefix, "%s%s.%09d %7" PRIdPTR " %s:%d]",
++                gpr_log_severity_string(args->severity), time_buffer,
++-               (int)(now.tv_nsec), gettid(), display_file, args->line);
+++               (int)(now.tv_nsec), sys_gettid(), display_file, args->line);
++ 
++   fprintf(stderr, "%-70s %s\n", prefix, args->message);
++   gpr_free(prefix);
++diff --git a/src/core/lib/iomgr/ev_epollex_linux.cc b/src/core/lib/iomgr/ev_epollex_linux.cc
++index 08116b3ab53..76f59844312 100644
++--- a/src/core/lib/iomgr/ev_epollex_linux.cc
+++++ b/src/core/lib/iomgr/ev_epollex_linux.cc
++@@ -1102,7 +1102,7 @@ static void end_worker(grpc_pollset* pollset, grpc_pollset_worker* worker,
++ }
++ 
++ #ifndef NDEBUG
++-static long gettid(void) { return syscall(__NR_gettid); }
+++static long sys_gettid(void) { return syscall(__NR_gettid); }
++ #endif
++ 
++ /* pollset->mu lock must be held by the caller before calling this.
++@@ -1122,7 +1122,7 @@ static grpc_error* pollset_work(grpc_pollset* pollset,
++ #define WORKER_PTR (&worker)
++ #endif
++ #ifndef NDEBUG
++-  WORKER_PTR->originator = gettid();
+++  WORKER_PTR->originator = sys_gettid();
++ #endif
++   if (GRPC_TRACE_FLAG_ENABLED(grpc_polling_trace)) {
++     gpr_log(GPR_INFO,
+-- 
+2.22.0
+

Deleted: PKGBUILD
===================================================================
--- PKGBUILD	2020-03-19 20:57:05 UTC (rev 601197)
+++ PKGBUILD	2020-03-19 20:57:20 UTC (rev 601198)
@@ -1,267 +0,0 @@
-# Maintainer: Sven-Hendrik Haase <svenstaro at gmail.com>
-# Maintainer: Konstantin Gizdov (kgizdov) <arch at kge.pw>
-# 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=2.1.0
-_pkgver=2.1.0
-pkgrel=3
-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' 'git' 'gcc'
-             'cudnn' 'python-pip' 'python-wheel' 'python-setuptools' 'python-h5py'
-             'python-keras-applications' 'python-keras-preprocessing')
-optdepends=('tensorboard: Tensorflow visualization toolkit'
-            'python-pasta: tf_upgrade_v2 tool')
-source=("https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz"
-        Add-grpc-fix-for-gettid.patch)
-sha512sums=('6d09ba3c097e4b3d712e7164d649841572c418d56c207eea6d31e3b1851b84ce57e82801d9887d84cfd8fcf990a3ea4c4b4b05265f8d625509986412c230c3c6'
-            '64442ef4cf0527cc321b7425273fd998c8e961af0ffbf1bb0a401cdd9237e95cdcebd8c18416e02a5225fabfd53cf0b694a3486791fffbc3e472a8ffaa4b28ff')
-
-get_pyver () {
-  python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
-}
-
-check_dir() {
-  if [ -d "${1}" ]; then
-    return 0
-  else
-    >&2 echo Directory "${1}" does not exist or is a file! Exiting...
-    exit 1
-  fi
-}
-
-prepare() {
-  patch -Np1 -d tensorflow-${_pkgver} -i "$srcdir"/Add-grpc-fix-for-gettid.patch
-  echo "2.0.0-" > tensorflow-${_pkgver}/.bazelversion
-
-  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.5
-  export TF_IGNORE_MAX_BAZEL_VERSION=1
-  export NCCL_INSTALL_PATH=/usr
-  export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-8
-  export HOST_CXX_COMPILER_PATH=/usr/bin/gcc-8
-  export TF_CUDA_CLANG=0  # Clang currently disabled because it's not compatible at the moment.
-  export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
-  export TF_CUDA_PATHS=/opt/cuda,/usr/lib,/usr
-  export TF_CUDA_VERSION=$(/opt/cuda/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
-  export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' /usr/include/cudnn.h)
-  export TF_CUDA_COMPUTE_CAPABILITIES=3.5,3.7,5.0,5.2,5.3,6.0,6.1,6.2,7.0,7.2,7.5
-}
-
-build() {
-  echo "Building without cuda and without non-x86-64 optimizations"
-  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:libtensorflow_cc.so \
-      //tensorflow:install_headers \
-      //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmp
-
-
-  echo "Building without cuda and with non-x86-64 optimizations"
-  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:libtensorflow_cc.so \
-      //tensorflow:install_headers \
-      //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmpopt
-
-
-  echo "Building with cuda and without non-x86-64 optimizations"
-  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
-  export CC_OPT_FLAGS="-march=x86-64"
-  export TF_NEED_CUDA=1
-  ./configure
-  bazel \
-    build --config=opt \
-      //tensorflow:libtensorflow.so \
-      //tensorflow:libtensorflow_cc.so \
-      //tensorflow:install_headers \
-      //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package --gpu "${srcdir}"/tmpcuda
-
-
-  echo "Building with cuda and without non-x86-64 optimizations"
-  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
-  export CC_OPT_FLAGS="-march=haswell"
-  export TF_NEED_CUDA=1
-  export TF_CUDA_CLANG=0
-  ./configure
-  bazel \
-    build --config=opt \
-      //tensorflow:libtensorflow.so \
-      //tensorflow:libtensorflow_cc.so \
-      //tensorflow:install_headers \
-      //tensorflow/tools/pip_package:build_pip_package
-  bazel-bin/tensorflow/tools/pip_package/build_pip_package --gpu "${srcdir}"/tmpoptcuda
-}
-
-_package() {
-  # install headers first
-  install -d "${pkgdir}"/usr/include/tensorflow
-  cp -r bazel-bin/tensorflow/include/* "${pkgdir}"/usr/include/tensorflow/
-  # install python-version to get all extra headers
-  WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
-  # move extra headers to correct location
-  local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow_core/include
-  check_dir "${_srch_path}"  # we need to quit on broken search paths
-  find "${_srch_path}" -maxdepth 1 -mindepth 1 -type d -print0 | while read -rd $'\0' _folder; do
-    cp -nr "${_folder}" "${pkgdir}"/usr/include/tensorflow/
-  done
-  # clean up unneeded files
-  rm -rf "${pkgdir}"/usr/bin
-  rm -rf "${pkgdir}"/usr/lib
-  rm -rf "${pkgdir}"/usr/share
-
-  # install the rest of tensorflow
-  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
-  sed -e 's@/include$@/include/tensorflow@' -i tensorflow.pc -i tensorflow_cc.pc
-  install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
-  install -Dm644 tensorflow_cc.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow_cc.pc
-  install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so.${pkgver}
-  ln -s libtensorflow.so.${pkgver} "${pkgdir}"/usr/lib/libtensorflow.so.${pkgver:0:1}
-  ln -s libtensorflow.so.${pkgver:0:1} "${pkgdir}"/usr/lib/libtensorflow.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so "${pkgdir}"/usr/lib/libtensorflow_cc.so.${pkgver}
-  ln -s libtensorflow_cc.so.${pkgver} "${pkgdir}"/usr/lib/libtensorflow_cc.so.${pkgver:0:1}
-  ln -s libtensorflow_cc.so.${pkgver:0:1} "${pkgdir}"/usr/lib/libtensorflow_cc.so
-  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so.${pkgver}
-  ln -s libtensorflow_framework.so.${pkgver} "${pkgdir}"/usr/lib/libtensorflow_framework.so.${pkgver:0:1}
-  ln -s libtensorflow_framework.so.${pkgver:0:1} "${pkgdir}"/usr/lib/libtensorflow_framework.so
-  install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/tensorflow/c/c_api.h
-  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
-}
-
-_python_package() {
-  WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl")
-  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
-
-  # create symlinks to headers
-  local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow_core/include/
-  check_dir "${_srch_path}"  # we need to quit on broken search paths
-  find "${_srch_path}" -maxdepth 1 -mindepth 1 -type d -print0 | while read -rd $'\0' _folder; do
-    rm -rf "${_folder}"
-    _smlink="$(basename "${_folder}")"
-    ln -s /usr/include/tensorflow/"${_smlink}" "${_srch_path}"
-  done
-
-  # 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_tensorflow() {
-  cd "${srcdir}"/tensorflow-${_pkgver}
-  _package tmp
-}
-
-package_tensorflow-opt() {
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
-  conflicts=(tensorflow)
-  provides=(tensorflow)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}-opt
-  _package tmpopt
-}
-
-package_tensorflow-cuda() {
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
-  depends+=(cuda cudnn nccl)
-  conflicts=(tensorflow)
-  provides=(tensorflow)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
-  _package tmpcuda
-}
-
-package_tensorflow-opt-cuda() {
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
-  depends+=(cuda cudnn nccl)
-  conflicts=(tensorflow)
-  provides=(tensorflow tensorflow-cuda)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
-  _package tmpoptcuda
-}
-
-package_python-tensorflow() {
-  depends+=(tensorflow python-termcolor python-astor python-gast02 python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}
-  _python_package tmp
-}
-
-package_python-tensorflow-opt() {
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
-  depends+=(tensorflow-opt python-termcolor python-astor python-gast02 python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
-  conflicts=(python-tensorflow)
-  provides=(python-tensorflow)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}-opt
-  _python_package tmpopt
-}
-
-package_python-tensorflow-cuda() {
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
-  depends+=(tensorflow-cuda python-termcolor python-astor python-gast02 python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
-  conflicts=(python-tensorflow)
-  provides=(python-tensorflow)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
-  _python_package tmpcuda
-}
-
-package_python-tensorflow-opt-cuda() {
-  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
-  depends+=(tensorflow-opt-cuda python-termcolor python-astor python-gast02 python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
-  conflicts=(python-tensorflow)
-  provides=(python-tensorflow python-tensorflow-cuda)
-
-  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
-  _python_package tmpoptcuda
-}
-
-# vim:set ts=2 sw=2 et:

Copied: tensorflow/repos/community-x86_64/PKGBUILD (from rev 601197, tensorflow/trunk/PKGBUILD)
===================================================================
--- PKGBUILD	                        (rev 0)
+++ PKGBUILD	2020-03-19 20:57:20 UTC (rev 601198)
@@ -0,0 +1,281 @@
+# Maintainer: Sven-Hendrik Haase <svenstaro at gmail.com>
+# Maintainer: Konstantin Gizdov (kgizdov) <arch at kge.pw>
+# 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=2.1.0
+_pkgver=2.1.0
+pkgrel=4
+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' 'intel-mkl' 'intel-dnnl')
+makedepends=('bazel' 'python-numpy' 'cuda' 'nvidia-utils' 'nccl' 'git' 'gcc'
+             'cudnn' 'python-pip' 'python-wheel' 'python-setuptools' 'python-h5py'
+             'python-keras-applications' 'python-keras-preprocessing')
+optdepends=('tensorboard: Tensorflow visualization toolkit'
+            'python-pasta: tf_upgrade_v2 tool')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/tensorflow/tensorflow/archive/v${_pkgver}.tar.gz"
+        Add-grpc-fix-for-gettid.patch
+        build-against-actual-mkl.patch
+        f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch)
+sha512sums=('6d09ba3c097e4b3d712e7164d649841572c418d56c207eea6d31e3b1851b84ce57e82801d9887d84cfd8fcf990a3ea4c4b4b05265f8d625509986412c230c3c6'
+            '64442ef4cf0527cc321b7425273fd998c8e961af0ffbf1bb0a401cdd9237e95cdcebd8c18416e02a5225fabfd53cf0b694a3486791fffbc3e472a8ffaa4b28ff'
+            'e51e3f3dced121db3a09fbdaefd33555536095584b72a5eb6f302fa6fa68ab56ea45e8a847ec90ff4ba076db312c06f91ff672e08e95263c658526582494ce08'
+            '7738f839ef6d9c875da631312e0e528918539a4111d308b3b04f556d7c074918b78fb863953ec43961074f5fdb896ab1f6954cde68b6260dc15c1972ef640618')
+
+get_pyver () {
+  python -c 'import sys; print(str(sys.version_info[0]) + "." + str(sys.version_info[1]))'
+}
+
+check_dir() {
+  if [ -d "${1}" ]; then
+    return 0
+  else
+    >&2 echo Directory "${1}" does not exist or is a file! Exiting...
+    exit 1
+  fi
+}
+
+prepare() {
+  # Allow any bazel version
+  echo "*" > tensorflow-${_pkgver}/.bazelversion
+
+  patch -Np1 -d tensorflow-${_pkgver} -i "$srcdir"/Add-grpc-fix-for-gettid.patch
+
+  patch -Np1 -d tensorflow-${_pkgver} -i "$srcdir"/f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch
+
+  # Tensorflow actually wants to build against a slimmed down version of Intel MKL called MKLML
+  # See https://github.com/intel/mkl-dnn/issues/102
+  # MKLML version that Tensorflow wants to use is https://github.com/intel/mkl-dnn/releases/tag/v0.21
+  patch -Np1 -d tensorflow-${_pkgver} -i "$srcdir"/build-against-actual-mkl.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.5
+  export TF_IGNORE_MAX_BAZEL_VERSION=1
+  export TF_MKL_ROOT=/opt/intel/mkl
+  export NCCL_INSTALL_PATH=/usr
+  export GCC_HOST_COMPILER_PATH=/usr/bin/gcc-8
+  export HOST_CXX_COMPILER_PATH=/usr/bin/gcc-8
+  export TF_CUDA_CLANG=0  # Clang currently disabled because it's not compatible at the moment.
+  export CLANG_CUDA_COMPILER_PATH=/usr/bin/clang
+  export TF_CUDA_PATHS=/opt/cuda,/usr/lib,/usr
+  export TF_CUDA_VERSION=$(/opt/cuda/bin/nvcc --version | sed -n 's/^.*release \(.*\),.*/\1/p')
+  export TF_CUDNN_VERSION=$(sed -n 's/^#define CUDNN_MAJOR\s*\(.*\).*/\1/p' /usr/include/cudnn.h)
+  export TF_CUDA_COMPUTE_CAPABILITIES=3.5,3.7,5.0,5.2,5.3,6.0,6.1,6.2,7.0,7.2,7.5
+}
+
+build() {
+  echo "Building without cuda and without non-x86-64 optimizations"
+  cd "${srcdir}"/tensorflow-${_pkgver}
+  export CC_OPT_FLAGS="-march=x86-64"
+  export TF_NEED_CUDA=0
+  ./configure
+  bazel \
+    build --config=mkl -c opt \
+      //tensorflow:libtensorflow.so \
+      //tensorflow:libtensorflow_cc.so \
+      //tensorflow:install_headers \
+      //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmp
+
+
+  echo "Building without cuda and with non-x86-64 optimizations"
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt
+  export CC_OPT_FLAGS="-march=haswell -O3"
+  export TF_NEED_CUDA=0
+  ./configure
+  bazel \
+    build --config=mkl -c opt \
+      //tensorflow:libtensorflow.so \
+      //tensorflow:libtensorflow_cc.so \
+      //tensorflow:install_headers \
+      //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package "${srcdir}"/tmpopt
+
+
+  echo "Building with cuda and without non-x86-64 optimizations"
+  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
+  export CC_OPT_FLAGS="-march=x86-64"
+  export TF_NEED_CUDA=1
+  ./configure
+  bazel \
+    build --config=mkl -c opt \
+      //tensorflow:libtensorflow.so \
+      //tensorflow:libtensorflow_cc.so \
+      //tensorflow:install_headers \
+      //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package --gpu "${srcdir}"/tmpcuda
+
+
+  echo "Building with cuda and without non-x86-64 optimizations"
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
+  export CC_OPT_FLAGS="-march=haswell -O3"
+  export TF_NEED_CUDA=1
+  export TF_CUDA_CLANG=0
+  ./configure
+  bazel \
+    build --config=mkl -c opt \
+      //tensorflow:libtensorflow.so \
+      //tensorflow:libtensorflow_cc.so \
+      //tensorflow:install_headers \
+      //tensorflow/tools/pip_package:build_pip_package
+  bazel-bin/tensorflow/tools/pip_package/build_pip_package --gpu "${srcdir}"/tmpoptcuda
+}
+
+_package() {
+  # install headers first
+  install -d "${pkgdir}"/usr/include/tensorflow
+  cp -r bazel-bin/tensorflow/include/* "${pkgdir}"/usr/include/tensorflow/
+  # install python-version to get all extra headers
+  WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
+  # move extra headers to correct location
+  local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow_core/include
+  check_dir "${_srch_path}"  # we need to quit on broken search paths
+  find "${_srch_path}" -maxdepth 1 -mindepth 1 -type d -print0 | while read -rd $'\0' _folder; do
+    cp -nr "${_folder}" "${pkgdir}"/usr/include/tensorflow/
+  done
+  # clean up unneeded files
+  rm -rf "${pkgdir}"/usr/bin
+  rm -rf "${pkgdir}"/usr/lib
+  rm -rf "${pkgdir}"/usr/share
+
+  # install the rest of tensorflow
+  tensorflow/c/generate-pc.sh --prefix=/usr --version=${pkgver}
+  sed -e 's@/include$@/include/tensorflow@' -i tensorflow.pc -i tensorflow_cc.pc
+  install -Dm644 tensorflow.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow.pc
+  install -Dm644 tensorflow_cc.pc "${pkgdir}"/usr/lib/pkgconfig/tensorflow_cc.pc
+  install -Dm755 bazel-bin/tensorflow/libtensorflow.so "${pkgdir}"/usr/lib/libtensorflow.so.${pkgver}
+  ln -s libtensorflow.so.${pkgver} "${pkgdir}"/usr/lib/libtensorflow.so.${pkgver:0:1}
+  ln -s libtensorflow.so.${pkgver:0:1} "${pkgdir}"/usr/lib/libtensorflow.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_cc.so "${pkgdir}"/usr/lib/libtensorflow_cc.so.${pkgver}
+  ln -s libtensorflow_cc.so.${pkgver} "${pkgdir}"/usr/lib/libtensorflow_cc.so.${pkgver:0:1}
+  ln -s libtensorflow_cc.so.${pkgver:0:1} "${pkgdir}"/usr/lib/libtensorflow_cc.so
+  install -Dm755 bazel-bin/tensorflow/libtensorflow_framework.so "${pkgdir}"/usr/lib/libtensorflow_framework.so.${pkgver}
+  ln -s libtensorflow_framework.so.${pkgver} "${pkgdir}"/usr/lib/libtensorflow_framework.so.${pkgver:0:1}
+  ln -s libtensorflow_framework.so.${pkgver:0:1} "${pkgdir}"/usr/lib/libtensorflow_framework.so
+  install -Dm644 tensorflow/c/c_api.h "${pkgdir}"/usr/include/tensorflow/tensorflow/c/c_api.h
+  install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
+}
+
+_python_package() {
+  WHEEL_PACKAGE=$(find "${srcdir}"/$1 -name "tensor*.whl")
+  pip install --ignore-installed --upgrade --root "${pkgdir}"/ $WHEEL_PACKAGE --no-dependencies
+
+  # create symlinks to headers
+  local _srch_path="${pkgdir}/usr/lib/python$(get_pyver)"/site-packages/tensorflow_core/include/
+  check_dir "${_srch_path}"  # we need to quit on broken search paths
+  find "${_srch_path}" -maxdepth 1 -mindepth 1 -type d -print0 | while read -rd $'\0' _folder; do
+    rm -rf "${_folder}"
+    _smlink="$(basename "${_folder}")"
+    ln -s /usr/include/tensorflow/"${_smlink}" "${_srch_path}"
+  done
+
+  # 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_tensorflow() {
+  cd "${srcdir}"/tensorflow-${_pkgver}
+  _package tmp
+}
+
+package_tensorflow-opt() {
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
+  conflicts=(tensorflow)
+  provides=(tensorflow)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt
+  _package tmpopt
+}
+
+package_tensorflow-cuda() {
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
+  depends+=(cuda cudnn nccl)
+  conflicts=(tensorflow)
+  provides=(tensorflow)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
+  _package tmpcuda
+}
+
+package_tensorflow-opt-cuda() {
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
+  depends+=(cuda cudnn nccl)
+  conflicts=(tensorflow)
+  provides=(tensorflow tensorflow-cuda)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
+  _package tmpoptcuda
+}
+
+package_python-tensorflow() {
+  depends+=(tensorflow python-termcolor python-astor python-gast02 python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}
+  _python_package tmp
+}
+
+package_python-tensorflow-opt() {
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CPU optimizations)"
+  depends+=(tensorflow-opt python-termcolor python-astor python-gast02 python-numpy python-protobuf absl-py python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
+  conflicts=(python-tensorflow)
+  provides=(python-tensorflow)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt
+  _python_package tmpopt
+}
+
+package_python-tensorflow-cuda() {
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA)"
+  depends+=(tensorflow-cuda python-termcolor python-astor python-gast02 python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
+  conflicts=(python-tensorflow)
+  provides=(python-tensorflow)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}-cuda
+  _python_package tmpcuda
+}
+
+package_python-tensorflow-opt-cuda() {
+  pkgdesc="Library for computation using data flow graphs for scalable machine learning (with CUDA and CPU optimizations)"
+  depends+=(tensorflow-opt-cuda python-termcolor python-astor python-gast02 python-numpy cuda cudnn python-pycuda python-protobuf absl-py nccl python-h5py python-keras-applications python-keras-preprocessing python-tensorflow-estimator python-opt_einsum)
+  conflicts=(python-tensorflow)
+  provides=(python-tensorflow python-tensorflow-cuda)
+
+  cd "${srcdir}"/tensorflow-${_pkgver}-opt-cuda
+  _python_package tmpoptcuda
+}
+
+# vim:set ts=2 sw=2 et:

Copied: tensorflow/repos/community-x86_64/build-against-actual-mkl.patch (from rev 601197, tensorflow/trunk/build-against-actual-mkl.patch)
===================================================================
--- build-against-actual-mkl.patch	                        (rev 0)
+++ build-against-actual-mkl.patch	2020-03-19 20:57:20 UTC (rev 601198)
@@ -0,0 +1,37 @@
+diff --git a/third_party/mkl/build_defs.bzl b/third_party/mkl/build_defs.bzl
+index 4b8fb83eb0..f4e1adfb22 100644
+--- a/third_party/mkl/build_defs.bzl
++++ b/third_party/mkl/build_defs.bzl
+@@ -124,7 +124,7 @@ def _mkl_autoconf_impl(repository_ctx):
+     if _enable_local_mkl(repository_ctx):
+         # Symlink lib and include local folders.
+         mkl_root = repository_ctx.os.environ[_TF_MKL_ROOT]
+-        mkl_lib_path = "%s/lib" % mkl_root
++        mkl_lib_path = "%s/lib/intel64" % mkl_root
+         repository_ctx.symlink(mkl_lib_path, "lib")
+         mkl_include_path = "%s/include" % mkl_root
+         repository_ctx.symlink(mkl_include_path, "include")
+diff --git a/third_party/mkl/mkl.BUILD b/third_party/mkl/mkl.BUILD
+index 72370182c4..4972bb005e 100644
+--- a/third_party/mkl/mkl.BUILD
++++ b/third_party/mkl/mkl.BUILD
+@@ -5,7 +5,6 @@ exports_files(["license.txt"])
+ filegroup(
+     name = "LICENSE",
+     srcs = [
+-        "license.txt",
+     ],
+     visibility = ["//visibility:public"],
+ )
+@@ -21,7 +20,10 @@ cc_library(
+     name = "mkl_libs_linux",
+     srcs = [
+         "lib/libiomp5.so",
+-        "lib/libmklml_intel.so",
++        "lib/libmkl_core.so",
++        "lib/libmkl_rt.so",
++        "lib/libmkl_intel_thread.so",
++        "lib/libmkl_intel_lp64.so",
+     ],
+     visibility = ["//visibility:public"],
+ )

Copied: tensorflow/repos/community-x86_64/f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch (from rev 601197, tensorflow/trunk/f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch)
===================================================================
--- f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch	                        (rev 0)
+++ f99aebca5d0b916106d9e17b0c1ee7898d14abc9.patch	2020-03-19 20:57:20 UTC (rev 601198)
@@ -0,0 +1,128 @@
+From f99aebca5d0b916106d9e17b0c1ee7898d14abc9 Mon Sep 17 00:00:00 2001
+From: "A. Unique TensorFlower" <gardener at tensorflow.org>
+Date: Wed, 12 Feb 2020 14:07:48 -0800
+Subject: [PATCH] Migrate --incompatible_remap_main_repo for bazel 2.0
+
+Bazel 2.0 flipped --incompatible_remap_main_repo. The gist of it is that when referring to a target in the main repository from inside an external repository the target needs to be prefixed by the main repository name. In this case "@org_tensorflow". Else, it's assumed that one is referring to a target inside the external repo.
+
+PiperOrigin-RevId: 294752795
+Change-Id: Ic23d08f457b966e9a039152c5f8a550ba5a1978e
+---
+ .bazelrc                           |  2 --
+ tensorflow/opensource_only.files   |  1 +
+ third_party/llvm/BUILD             |  2 --
+ third_party/mkl/build_defs.bzl     | 22 +++++++++++-----------
+ third_party/mkl_dnn/build_defs.bzl |  4 ++--
+ 5 files changed, 14 insertions(+), 17 deletions(-)
+
+diff --git a/tensorflow/opensource_only.files b/tensorflow/opensource_only.files
+index 988b3c9bb0413..5df80351a551c 100644
+--- a/tensorflow/opensource_only.files
++++ b/tensorflow/opensource_only.files
+@@ -116,6 +116,7 @@ tensorflow/third_party/mkl/MKL_LICENSE
+ tensorflow/third_party/mkl/build_defs.bzl
+ tensorflow/third_party/mkl/mkl.BUILD
+ tensorflow/third_party/mkl_dnn/LICENSE
++tensorflow/third_party/mkl_dnn/build_defs.bzl
+ tensorflow/third_party/mkl_dnn/mkldnn.BUILD
+ tensorflow/third_party/mpi/.gitignore
+ tensorflow/third_party/nanopb.BUILD
+diff --git a/third_party/llvm/BUILD b/third_party/llvm/BUILD
+index 563f394b2769e..1a5634a62851c 100644
+--- a/third_party/llvm/BUILD
++++ b/third_party/llvm/BUILD
+@@ -1,5 +1,3 @@
+-licenses(["notice"])
+-
+ py_binary(
+     name = "expand_cmake_vars",
+     srcs = ["expand_cmake_vars.py"],
+diff --git a/third_party/mkl/build_defs.bzl b/third_party/mkl/build_defs.bzl
+index 6f3e7c0b52d48..4b8fb83eb092c 100644
+--- a/third_party/mkl/build_defs.bzl
++++ b/third_party/mkl/build_defs.bzl
+@@ -25,7 +25,7 @@ def if_mkl(if_true, if_false = []):
+       a select evaluating to either if_true or if_false as appropriate.
+     """
+     return select({
+-        str(Label("//third_party/mkl:build_with_mkl")): if_true,
++        "@org_tensorflow//third_party/mkl:build_with_mkl": if_true,
+         "//conditions:default": if_false,
+     })
+ 
+@@ -41,8 +41,8 @@ def if_mkl_ml(if_true, if_false = []):
+       a select evaluating to either if_true or if_false as appropriate.
+     """
+     return select({
+-        str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): if_false,
+-        str(Label("//third_party/mkl:build_with_mkl")): if_true,
++        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_only": if_false,
++        "@org_tensorflow//third_party/mkl:build_with_mkl": if_true,
+         "//conditions:default": if_false,
+     })
+ 
+@@ -57,7 +57,7 @@ def if_mkl_ml_only(if_true, if_false = []):
+       a select evaluating to either if_true or if_false as appropriate.
+     """
+     return select({
+-        str(Label("//third_party/mkl:build_with_mkl_ml_only")): if_true,
++        "@org_tensorflow//third_party/mkl:build_with_mkl_ml_only": if_true,
+         "//conditions:default": if_false,
+     })
+ 
+@@ -74,7 +74,7 @@ def if_mkl_lnx_x64(if_true, if_false = []):
+       a select evaluating to either if_true or if_false as appropriate.
+     """
+     return select({
+-        str(Label("//third_party/mkl:build_with_mkl_lnx_x64")): if_true,
++        "@org_tensorflow//third_party/mkl:build_with_mkl_lnx_x64": if_true,
+         "//conditions:default": if_false,
+     })
+ 
+@@ -91,7 +91,7 @@ def if_enable_mkl(if_true, if_false = []):
+       A select evaluating to either if_true or if_false as appropriate.
+     """
+     return select({
+-        str(Label("//third_party/mkl:enable_mkl")): if_true,
++        "@org_tensorflow//third_party/mkl:enable_mkl": if_true,
+         "//conditions:default": if_false,
+     })
+ 
+@@ -105,11 +105,11 @@ def mkl_deps():
+       inclusion in the deps attribute of rules.
+     """
+     return select({
+-        str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): ["@mkl_dnn"],
+-        str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_v1_only")): ["@mkl_dnn_v1//:mkl_dnn"],
+-        str(Label("//third_party/mkl:build_with_mkl_ml_only")): ["//third_party/mkl:intel_binary_blob"],
+-        str(Label("//third_party/mkl:build_with_mkl")): [
+-            "//third_party/mkl:intel_binary_blob",
++        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_only": ["@mkl_dnn"],
++        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_v1_only": ["@mkl_dnn_v1//:mkl_dnn"],
++        "@org_tensorflow//third_party/mkl:build_with_mkl_ml_only": ["@org_tensorflow//third_party/mkl:intel_binary_blob"],
++        "@org_tensorflow//third_party/mkl:build_with_mkl": [
++            "@org_tensorflow//third_party/mkl:intel_binary_blob",
+             "@mkl_dnn",
+         ],
+         "//conditions:default": [],
+diff --git a/third_party/mkl_dnn/build_defs.bzl b/third_party/mkl_dnn/build_defs.bzl
+index 384b528c2733a..af05333c94700 100644
+--- a/third_party/mkl_dnn/build_defs.bzl
++++ b/third_party/mkl_dnn/build_defs.bzl
+@@ -10,7 +10,7 @@ def if_mkl_open_source_only(if_true, if_false = []):
+ 
+     """
+     return select({
+-        str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_only")): if_true,
++        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_only": if_true,
+         "//conditions:default": if_false,
+     })
+ 
+@@ -26,6 +26,6 @@ def if_mkl_v1_open_source_only(if_true, if_false = []):
+ 
+     """
+     return select({
+-        str(Label("//third_party/mkl_dnn:build_with_mkl_dnn_v1_only")): if_true,
++        "@org_tensorflow//third_party/mkl_dnn:build_with_mkl_dnn_v1_only": if_true,
+         "//conditions:default": if_false,
+     })



More information about the arch-commits mailing list