From dc786329b140f2074e00ea8226a8e2aa7fe97ddd Mon Sep 17 00:00:00 2001 From: Amit Patankar Date: Thu, 27 Feb 2020 14:47:24 -0800 Subject: [PATCH] Fix ODR violations in Windows. Framework and lib are linked into each shared object on Windows. This implementation only provides necessary headers. PiperOrigin-RevId: 297692826 Change-Id: Id3973086854e729191166fdad584655fa242ad6e --- tensorflow/python/BUILD | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD index 1e830528ed4..12eab387887 100644 --- a/tensorflow/python/BUILD +++ b/tensorflow/python/BUILD @@ -384,9 +384,9 @@ tf_python_pybind_extension( ":cost_analyzer_headers", ":pybind11_status", "//tensorflow/core:core_cpu_headers_lib", - "//tensorflow/core:framework", + "//tensorflow/core:framework_headers_lib", "//tensorflow/core:gpu_id", - "//tensorflow/core:lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "@pybind11", ], @@ -415,8 +415,8 @@ tf_python_pybind_extension( module_name = "_pywrap_model_analyzer", deps = [ ":pybind11_status", - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "@pybind11", ], @@ -646,8 +646,8 @@ tf_python_pybind_extension( srcs = ["util/tfprof_wrapper.cc"], module_name = "_pywrap_tfprof", deps = [ - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core/profiler/internal:print_model_analysis_hdr", "//third_party/eigen3", "//third_party/python_runtime:headers", @@ -675,8 +675,8 @@ tf_python_pybind_extension( module_name = "_pywrap_kernel_registry", deps = [ ":pybind11_lib", - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//third_party/python_runtime:headers", "@pybind11", @@ -695,8 +695,8 @@ tf_python_pybind_extension( ":pybind11_proto", ":pybind11_status", "//tensorflow/core:core_cpu_headers_lib", - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//third_party/python_runtime:headers", "@com_google_absl//absl/strings", @@ -709,8 +709,9 @@ tf_python_pybind_extension( srcs = ["util/stat_summarizer_wrapper.cc"], module_name = "_pywrap_stat_summarizer", deps = [ - "//tensorflow/core:framework", + "//tensorflow/core:framework_headers_lib", "//tensorflow/core:protos_all_cc", + "//third_party/eigen3", "//third_party/python_runtime:headers", "@com_google_absl//absl/memory", "@pybind11", @@ -737,8 +738,8 @@ tf_python_pybind_extension( ":pybind11_absl", ":pybind11_proto", ":pybind11_status", - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//third_party/python_runtime:headers", "@com_google_absl//absl/strings", @@ -754,8 +755,8 @@ tf_python_pybind_extension( ":pybind11_absl", ":pybind11_proto", ":pybind11_status", - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//third_party/python_runtime:headers", "@com_google_absl//absl/strings", @@ -781,8 +782,8 @@ tf_python_pybind_extension( module_name = "_pywrap_transform_graph", deps = [ ":pybind11_status", - "//tensorflow/core:framework", - "//tensorflow/core:lib", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//third_party/python_runtime:headers", "@pybind11", @@ -804,7 +805,7 @@ tf_python_pybind_extension( deps = [ ":pybind11_lib", ":pybind11_status", - "//tensorflow/core:lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:op_gen_lib", "//tensorflow/core:protos_all_cc", "//tensorflow/core/util/tensor_bundle:tensor_bundle_headers_lib", @@ -833,7 +834,7 @@ tf_python_pybind_extension( ], module_name = "_pywrap_py_exception_registry", deps = [ - "//tensorflow/core:lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//third_party/python_runtime:headers", "@pybind11", @@ -6019,7 +6020,7 @@ tf_python_pybind_extension( ":pybind11_absl", ":pybind11_status", "//tensorflow/core:framework_headers_lib", - "//tensorflow/core:lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core/platform:types", "@com_google_absl//absl/memory", "@pybind11", @@ -8065,9 +8066,8 @@ tf_python_pybind_extension( "//third_party/python_runtime:headers", "//tensorflow/compiler/jit:flags_headers_only", "//tensorflow/core:core_cpu_headers_lib", - "//tensorflow/core:framework", - "//tensorflow/core:lib", - "//tensorflow/core:lib_internal", + "//tensorflow/core:framework_headers_lib", + "//tensorflow/core:lib_headers_for_pybind", "//tensorflow/core:protos_all_cc", "//tensorflow/core/platform:platform", ] + if_static(