Depend on protobuf's header only library when building custom ops

Change: 149501122
This commit is contained in:
Manjunath Kudlur 2017-03-07 20:39:31 -08:00 committed by TensorFlower Gardener
parent 6f00d6a8ff
commit e83a041dd5
10 changed files with 13 additions and 42 deletions

28
BUILD
View File

@ -1,28 +0,0 @@
# Description:
# TensorFlow is an open source software library for numerical computation using
# data flow graphs.
package(
default_visibility = [
"//tensorflow:internal",
"//tensorflow_models:__subpackages__",
],
)
licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"])
load(
"//tensorflow:tensorflow.bzl",
"cc_header_only_library",
)
cc_header_only_library(
name = "protobuf_headers",
includes = ["external/protobuf/src"],
visibility = ["//visibility:public"],
deps = [
"@protobuf//:protobuf",
],
)

View File

@ -14,7 +14,7 @@ cc_library(
":clustering_ops", ":clustering_ops",
":masked_matmul_ops", ":masked_matmul_ops",
":wals_solver_ops", ":wals_solver_ops",
"//:protobuf_headers", "@protobuf//:protobuf_headers",
], ],
) )
@ -22,9 +22,9 @@ cc_library(
name = "wals_solver_ops", name = "wals_solver_ops",
srcs = ["wals_solver_ops.cc"], srcs = ["wals_solver_ops.cc"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )
@ -33,9 +33,9 @@ cc_library(
name = "clustering_ops", name = "clustering_ops",
srcs = ["clustering_ops.cc"], srcs = ["clustering_ops.cc"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )
@ -44,9 +44,9 @@ cc_library(
name = "masked_matmul_ops", name = "masked_matmul_ops",
srcs = ["masked_matmul_ops.cc"], srcs = ["masked_matmul_ops.cc"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )

View File

@ -16,8 +16,8 @@ cc_library(
"//tensorflow/contrib/ffmpeg:ffmpeg_lib.h", "//tensorflow/contrib/ffmpeg:ffmpeg_lib.h",
], ],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"@protobuf//:protobuf_headers",
], ],
) )

View File

@ -11,9 +11,9 @@ cc_library(
name = "input_pipeline_kernels", name = "input_pipeline_kernels",
srcs = ["input_pipeline_kernels.cc"], srcs = ["input_pipeline_kernels.cc"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )

View File

@ -11,9 +11,9 @@ cc_library(
name = "bucketization_kernel", name = "bucketization_kernel",
srcs = ["bucketization_kernel.cc"], srcs = ["bucketization_kernel.cc"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )
@ -22,10 +22,10 @@ cc_library(
name = "sparse_feature_cross_kernel", name = "sparse_feature_cross_kernel",
srcs = ["sparse_feature_cross_kernel.cc"], srcs = ["sparse_feature_cross_kernel.cc"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@farmhash_archive//:farmhash", "@farmhash_archive//:farmhash",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )

View File

@ -51,9 +51,9 @@ cc_library(
srcs = [":custom_op_sources"], srcs = [":custom_op_sources"],
hdrs = [":custom_op_headers"], hdrs = [":custom_op_headers"],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
alwayslink = 1, alwayslink = 1,
) )
@ -191,9 +191,9 @@ cc_library(
"kernels/tree_utils.h", "kernels/tree_utils.h",
], ],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
) )

View File

@ -67,9 +67,9 @@ cc_library(
"core/ops/utils.h", "core/ops/utils.h",
], ],
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"//third_party/eigen3", "//third_party/eigen3",
"@protobuf//:protobuf_headers",
], ],
) )

View File

@ -254,8 +254,8 @@ cc_binary(
}), }),
linkshared = 1, linkshared = 1,
deps = [ deps = [
"//:protobuf_headers",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
"@protobuf//:protobuf_headers",
], ],
) )

View File

@ -679,7 +679,7 @@ def cc_header_only_library(name, deps=[], **kwargs):
def tf_custom_op_library_additional_deps(): def tf_custom_op_library_additional_deps():
return [ return [
"//:protobuf_headers", "@protobuf//:protobuf_headers",
"//third_party/eigen3", "//third_party/eigen3",
"//tensorflow/core:framework_headers_lib", "//tensorflow/core:framework_headers_lib",
] ]

View File

@ -77,7 +77,6 @@ py_binary(
filegroup( filegroup(
name = "licenses", name = "licenses",
data = [ data = [
"//:LICENSE",
"//third_party/eigen3:LICENSE", "//third_party/eigen3:LICENSE",
"//third_party/hadoop:LICENSE.txt", "//third_party/hadoop:LICENSE.txt",
"@boringssl//:LICENSE", "@boringssl//:LICENSE",