Skip to content

Commit fbcf834

Browse files
committed
[BUILD] Add dependencies for tensorflow_cc to solve undefined symbols issue.
Signed-off-by: Tongxuan Liu <[email protected]>
1 parent 70e3586 commit fbcf834

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

tensorflow/BUILD

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ tf_cc_shared_object(
696696
per_os_targets = True,
697697
soversion = VERSION,
698698
visibility = ["//visibility:public"],
699+
linkstatic = 1,
699700
# add win_def_file for tensorflow_cc
700701
win_def_file = select({
701702
# We need this DEF file to properly export symbols on Windows
@@ -718,6 +719,21 @@ tf_cc_shared_object(
718719
"//tensorflow/contrib/tensor_forest:model_ops_lib",
719720
"//tensorflow/contrib/tensor_forest:forest_proto_impl",
720721
"//tensorflow/contrib/tensor_forest/kernels/v4:decision-tree-resource_impl",
722+
"//tensorflow/core:lib",
723+
"//tensorflow/core:lib_internal",
724+
"//tensorflow/core:lib_internal_impl",
725+
"//tensorflow/core:core_cpu_impl",
726+
"//tensorflow/core:framework_internal",
727+
"//tensorflow/core:framework_internal_impl",
728+
"//tensorflow/core:gpu_runtime_impl",
729+
"//tensorflow/cc/saved_model:loader",
730+
"//tensorflow/cc/saved_model:loader_lite",
731+
"//tensorflow/cc/saved_model:loader_lite_impl",
732+
"//tensorflow/stream_executor:dnn_proto_cc",
733+
"//tensorflow/stream_executor:dnn_proto_cc_impl",
734+
"//tensorflow/core/platform:tensor_float_32_utils",
735+
"//tensorflow/core/grappler/optimizers:custom_graph_optimizer_registry_impl",
736+
"@nsync//:nsync_cpp",
721737
] + if_ngraph(["@ngraph_tf//:ngraph_tf"]),
722738
)
723739

tensorflow/c/BUILD

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ tf_cuda_library(
8686
":tf_status_internal",
8787
":tf_tensor_internal",
8888
],
89+
alwayslink = 1,
8990
)
9091

9192
cc_library(
@@ -110,13 +111,16 @@ tf_cuda_library(
110111
":c_api_internal",
111112
":tf_attrtype",
112113
":tf_status_internal",
114+
":tf_status",
115+
"@com_google_protobuf//:protobuf",
113116
] + select({
114117
"//tensorflow:with_xla_support": [
115118
"//tensorflow/compiler/tf2xla:xla_compiler",
116119
"//tensorflow/compiler/jit",
117120
],
118121
"//conditions:default": [],
119122
}),
123+
alwayslink = 1,
120124
)
121125

122126
tf_cuda_library(
@@ -176,6 +180,7 @@ tf_cuda_library(
176180
"//tensorflow/core:lib",
177181
],
178182
}),
183+
alwayslink = 1,
179184
)
180185

181186
cc_library(
@@ -192,6 +197,7 @@ cc_library(
192197
"//tensorflow/core:lib",
193198
],
194199
}),
200+
alwayslink = 1,
195201
)
196202

197203
cc_library(

tensorflow/core/platform/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ cc_library(
8686
":platform",
8787
":types",
8888
],
89+
alwayslink = 1,
8990
)
9091

9192
cc_library(
@@ -176,6 +177,7 @@ cc_library(
176177
"platform_strings_computed.h",
177178
],
178179
hdrs = ["platform_strings.h"],
180+
alwayslink = 1,
179181
)
180182

181183
cc_library(

0 commit comments

Comments
 (0)