From 063fe445ab655f8d9263329d4619fc13f01a60b7 Mon Sep 17 00:00:00 2001 From: Christian Sigg Date: Wed, 20 Jan 2021 02:37:26 -0800 Subject: [PATCH] [NFC] Expose a number of BUILD differences between Google and OSS through copybara:comment directives. PiperOrigin-RevId: 352753137 Change-Id: I5cac0f75b6f3dc36fdfda98943a37fe1b3a849cf --- tensorflow/lite/delegates/hexagon/java/BUILD | 5 +++++ tensorflow/tensorflow.bzl | 11 ++++++++++- tensorflow/tools/pip_package/BUILD | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/tensorflow/lite/delegates/hexagon/java/BUILD b/tensorflow/lite/delegates/hexagon/java/BUILD index b86d73135d3..305f479b5a0 100644 --- a/tensorflow/lite/delegates/hexagon/java/BUILD +++ b/tensorflow/lite/delegates/hexagon/java/BUILD @@ -27,8 +27,13 @@ cc_library( srcs = [ "libtensorflowlite_hexagon_jni.so", ] + select({ + # copybara:uncomment_begin(separate repo in OSS) + # "//tensorflow:android_arm64": ["//tensorflow/lite/delegates/hexagon/hexagon_nn:libhexagon_interface.so"], + # "//tensorflow:android_arm": ["//tensorflow/lite/delegates/hexagon/hexagon_nn:libhexagon_interface.so"], + # copybara:uncomment_end_and_comment_begin "//tensorflow:android_arm64": ["@hexagon_nn//:hexagon/arm64-v8a/libhexagon_interface.so"], "//tensorflow:android_arm": ["@hexagon_nn//:hexagon/armeabi-v7a/libhexagon_interface.so"], + # copybara:comment_end "//conditions:default": [], }), tags = [ diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl index f702e100179..674608e0d4c 100644 --- a/tensorflow/tensorflow.bzl +++ b/tensorflow/tensorflow.bzl @@ -271,7 +271,11 @@ def if_nccl(if_true, if_false = []): def if_libtpu(if_true, if_false = []): """Shorthand for select()ing whether to build backend support for TPUs when building libtpu.so""" return select({ - str(Label("//tensorflow:with_tpu_support")): if_true, + # copybara:uncomment_begin(different config setting in OSS) + # "//tools/cc_target_os:gce": if_true, + # copybara:uncomment_end_and_comment_begin + clean_dep("//tensorflow:with_tpu_support"): if_true, + # copybara:comment_end "//conditions:default": if_false, }) @@ -376,8 +380,13 @@ def tf_copts( def tf_openmp_copts(): # We assume when compiling on Linux gcc/clang will be used and MSVC on Windows return select({ + # copybara:uncomment_begin + # "//third_party/mkl:build_with_mkl_lnx_openmp": ["-fopenmp"], + # "//third_party/mkl:build_with_mkl_windows_openmp": ["/openmp"], + # copybara:uncomment_end_and_comment_begin "@org_tensorflow//third_party/mkl:build_with_mkl_lnx_openmp": ["-fopenmp"], "@org_tensorflow//third_party/mkl:build_with_mkl_windows_openmp": ["/openmp"], + # copybara:comment_end "//conditions:default": [], }) diff --git a/tensorflow/tools/pip_package/BUILD b/tensorflow/tools/pip_package/BUILD index 1252c011021..b47a19f47f0 100644 --- a/tensorflow/tools/pip_package/BUILD +++ b/tensorflow/tools/pip_package/BUILD @@ -95,7 +95,6 @@ COMMON_PIP_DEPS = [ ":included_headers", ":xla_compiled_cpu_runtime_srcs.txt_file", ":xla_cmake", - "//tensorflow:tensorflow_py", "//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_hdrs", "//tensorflow/compiler/tf2xla:xla_compiled_cpu_runtime_srcs", "//tensorflow/compiler/mlir/tensorflow:gen_mlir_passthrough_op_py", @@ -157,6 +156,7 @@ COMMON_PIP_DEPS = [ "//tensorflow/python/distribute/coordinator:cluster_coordinator", "//tensorflow/python/distribute/coordinator:remote_eager_lib", "//tensorflow/python/distribute/coordinator:metric_utils", + "//tensorflow:tensorflow_py", ] # On Windows, python binary is a zip file of runfiles tree.