[TF] alwayslink=1 to a bunch of targets used when creating pywrap_tensorflow_internal.

Without this, tensorflow_serving doesn't build due to dynamic linking errors.

Does not change the size of the CPU TF wheel when created with rbe/linux/py3 config.

PiperOrigin-RevId: 300629656
Change-Id: Ib9064f59e1bb6750d1efedd6ab16a8ea0e0e89a9
This commit is contained in:
Eugene Brevdo 2020-03-12 14:52:08 -07:00 committed by Gunhan Gulsoy
parent 6d741529a0
commit 6b7b115d8a
8 changed files with 19 additions and 5 deletions

View File

@ -698,4 +698,5 @@ tf_cuda_library(
# TODO(b/74620627): remove when _USE_C_SHAPES is removed
"//tensorflow/python:cpp_shape_inference_proto_cc",
],
alwayslink = 1,
)

View File

@ -354,6 +354,7 @@ cc_library(
"//tensorflow/core:lib",
"@dlpack",
],
alwayslink = 1,
)
# TODO(karllessard): only used by //tensorflow/core:mobile_srcs_only_runtime

View File

@ -1,6 +1,5 @@
load("@local_config_cuda//cuda:build_defs.bzl", "if_cuda")
load("//tensorflow:tensorflow.bzl", "tf_cc_test")
load("//tensorflow:tensorflow.bzl", "tf_cuda_library")
load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_cuda_library")
load(
"//tensorflow/core/platform:build_config_root.bzl",
"tf_cuda_tests_tags",
@ -138,6 +137,7 @@ cc_library(
"//tensorflow/core/grappler:utils",
"//tensorflow/core/kernels:ops_util",
],
alwayslink = 1,
)
tf_cc_test(

View File

@ -1,4 +1,8 @@
load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_cuda_library")
load(
"//tensorflow:tensorflow.bzl",
"tf_cc_test",
"tf_cuda_library",
)
load(
"//tensorflow/core/platform:build_config.bzl",
"tf_additional_all_protos",
@ -303,6 +307,7 @@ cc_library(
"//tensorflow/core/grappler/costs:cost_estimator",
"//tensorflow/core/kernels:ops_util",
],
alwayslink = 1,
)
cc_library(
@ -353,6 +358,7 @@ cc_library(
"//tensorflow/core/grappler:op_types",
"//tensorflow/core/grappler:utils",
] + tf_protos_grappler(),
alwayslink = 1,
)
tf_cc_test(

View File

@ -595,6 +595,7 @@ cc_library(
name = "stacktrace_handler",
textual_hdrs = ["stacktrace_handler.h"],
deps = tf_windows_aware_platform_deps("stacktrace_handler"),
alwayslink = 1,
)
cc_library(

View File

@ -365,6 +365,7 @@ cc_library(
"//tensorflow/core/platform",
"//tensorflow/core/platform:stacktrace",
],
alwayslink = 1,
)
cc_library(

View File

@ -444,6 +444,7 @@ cc_library(
srcs = ["version_info.cc"],
hdrs = ["//tensorflow/core/public:version.h"],
copts = tf_copts(),
alwayslink = 1,
)
cc_library(

View File

@ -349,14 +349,15 @@ cc_library(
hdrs = ["grappler/cost_analyzer.h"],
deps = [
"//tensorflow/core:lib",
"//tensorflow/core/grappler/costs:analytical_cost_estimator",
"//tensorflow/core/grappler/costs:measuring_cost_estimator",
"//tensorflow/core:protos_all_cc",
"//tensorflow/core/grappler:grappler_item",
"//tensorflow/core/grappler/clusters:cluster",
"//tensorflow/core/grappler/costs:analytical_cost_estimator",
"//tensorflow/core/grappler/costs:cost_estimator",
"//tensorflow/core/grappler/costs:measuring_cost_estimator",
"//tensorflow/core/grappler/costs:utils",
] + tf_protos_grappler(),
alwayslink = 1,
)
# Necessary for the pywrap inclusion below. Combining targets does not work
@ -509,6 +510,7 @@ cc_library(
"//tensorflow/core:protos_all_cc",
"//third_party/python_runtime:headers",
],
alwayslink = 1,
)
cc_library(
@ -5740,6 +5742,7 @@ tf_cuda_library(
"//third_party/py/numpy:headers",
"//third_party/python_runtime:headers",
],
alwayslink = 1,
)
py_library(