diff --git a/tensorflow/BUILD b/tensorflow/BUILD index 37abdcc25d1..f5c8d28bc01 100644 --- a/tensorflow/BUILD +++ b/tensorflow/BUILD @@ -31,6 +31,7 @@ load( "//third_party/mkl:build_defs.bzl", "if_mkl_ml", ) +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_visibility = [":internal"], @@ -457,6 +458,22 @@ filegroup( ), ) +bzl_library( + name = "tensorflow_bzl", + srcs = ["tensorflow.bzl"], + visibility = ["//visibility:public"], + deps = [ + "//tensorflow/core/platform:build_config_root_bzl", + "//tensorflow/core/platform:cuda_build_defs_bzl", + "//third_party/mkl:build_defs_bzl", + "//third_party/mkl_dnn:build_defs_bzl", + "//third_party/ngraph:build_defs_bzl", + "@local_config_cuda//cuda:build_defs_bzl", + "@local_config_rocm//rocm:build_defs_bzl", + "@local_config_tensorrt//:build_defs_bzl", + ], +) + cc_library( name = "grpc", visibility = ["//visibility:public"], diff --git a/tensorflow/core/platform/BUILD b/tensorflow/core/platform/BUILD index cd502581e71..be879b57d0d 100644 --- a/tensorflow/core/platform/BUILD +++ b/tensorflow/core/platform/BUILD @@ -39,6 +39,7 @@ load( "@local_config_rocm//rocm:build_defs.bzl", "if_rocm_is_configured", ) +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package( default_visibility = [ @@ -815,3 +816,13 @@ exports_files( ], ), ) + +bzl_library( + name = "build_config_root_bzl", + srcs = ["default/build_config_root.bzl"], +) + +bzl_library( + name = "cuda_build_defs_bzl", + srcs = ["default/cuda_build_defs.bzl"], +) diff --git a/third_party/gpus/cuda/BUILD b/third_party/gpus/cuda/BUILD index e69de29bb2d..413d28a2723 100644 --- a/third_party/gpus/cuda/BUILD +++ b/third_party/gpus/cuda/BUILD @@ -0,0 +1,9 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) diff --git a/third_party/gpus/cuda/BUILD.tpl b/third_party/gpus/cuda/BUILD.tpl index 066a1eca843..9d17e1b8f35 100644 --- a/third_party/gpus/cuda/BUILD.tpl +++ b/third_party/gpus/cuda/BUILD.tpl @@ -1,4 +1,5 @@ load(":build_defs.bzl", "cuda_header_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like @@ -165,4 +166,12 @@ cc_library( data = [":cuda-nvvm"], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + %{copy_rules} diff --git a/third_party/gpus/cuda/BUILD.windows.tpl b/third_party/gpus/cuda/BUILD.windows.tpl index f4bc777568e..f91c71f74a1 100644 --- a/third_party/gpus/cuda/BUILD.windows.tpl +++ b/third_party/gpus/cuda/BUILD.windows.tpl @@ -1,4 +1,5 @@ load(":build_defs.bzl", "cuda_header_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like @@ -159,4 +160,12 @@ cc_library( data = [":cuda-nvvm"], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + %{copy_rules} diff --git a/third_party/gpus/rocm/BUILD b/third_party/gpus/rocm/BUILD index e69de29bb2d..bc2dd419259 100644 --- a/third_party/gpus/rocm/BUILD +++ b/third_party/gpus/rocm/BUILD @@ -0,0 +1,6 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], +) diff --git a/third_party/gpus/rocm/BUILD.tpl b/third_party/gpus/rocm/BUILD.tpl index 21d1433a32f..74a64a4b381 100644 --- a/third_party/gpus/rocm/BUILD.tpl +++ b/third_party/gpus/rocm/BUILD.tpl @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like package(default_visibility = ["//visibility:public"]) @@ -109,4 +111,9 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], +) + %{copy_rules} diff --git a/third_party/mkl/BUILD b/third_party/mkl/BUILD index aaca1e9b6f5..bbbec855ab7 100644 --- a/third_party/mkl/BUILD +++ b/third_party/mkl/BUILD @@ -1,5 +1,7 @@ licenses(["notice"]) # 3-Clause BSD +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + config_setting( name = "build_with_mkl", define_values = { @@ -78,3 +80,9 @@ cc_library( "//conditions:default": [], }), ) + +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + visibility = ["//visibility:public"], +) diff --git a/third_party/mkl_dnn/BUILD b/third_party/mkl_dnn/BUILD index 5229dd5aa74..774e5b0e2c0 100644 --- a/third_party/mkl_dnn/BUILD +++ b/third_party/mkl_dnn/BUILD @@ -1,4 +1,11 @@ -package(licenses = ["notice"]) +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +package( + default_visibility = [ + "//tensorflow:__subpackages__", + ], + licenses = ["notice"], +) exports_files(["LICENSE"]) @@ -19,3 +26,8 @@ config_setting( }, visibility = ["//visibility:public"], ) + +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], +) diff --git a/third_party/ngraph/BUILD b/third_party/ngraph/BUILD index 067771b43f7..922559f68ec 100644 --- a/third_party/ngraph/BUILD +++ b/third_party/ngraph/BUILD @@ -1 +1,9 @@ licenses(["notice"]) # 3-Clause BSD + +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + visibility = ["//visibility:public"], +) diff --git a/third_party/tensorrt/BUILD.tpl b/third_party/tensorrt/BUILD.tpl index 5e3b223e695..dfa06ced2ed 100644 --- a/third_party/tensorrt/BUILD.tpl +++ b/third_party/tensorrt/BUILD.tpl @@ -4,6 +4,7 @@ licenses(["notice"]) load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package(default_visibility = ["//visibility:public"]) @@ -31,4 +32,12 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + %{copy_rules} diff --git a/third_party/toolchains/preconfig/centos6/cuda10.0-cudnn7/cuda/BUILD b/third_party/toolchains/preconfig/centos6/cuda10.0-cudnn7/cuda/BUILD index 4e851484357..3a3421001bb 100755 --- a/third_party/toolchains/preconfig/centos6/cuda10.0-cudnn7/cuda/BUILD +++ b/third_party/toolchains/preconfig/centos6/cuda10.0-cudnn7/cuda/BUILD @@ -1,4 +1,5 @@ load(":build_defs.bzl", "cuda_header_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like @@ -165,6 +166,14 @@ cc_library( data = [":cuda-nvvm"], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "cuda-include", outs = [ diff --git a/third_party/toolchains/preconfig/centos6/cuda10.1-cudnn7/cuda/BUILD b/third_party/toolchains/preconfig/centos6/cuda10.1-cudnn7/cuda/BUILD index c7299130bd9..f64204c4920 100755 --- a/third_party/toolchains/preconfig/centos6/cuda10.1-cudnn7/cuda/BUILD +++ b/third_party/toolchains/preconfig/centos6/cuda10.1-cudnn7/cuda/BUILD @@ -1,4 +1,5 @@ load(":build_defs.bzl", "cuda_header_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like @@ -165,6 +166,14 @@ cc_library( data = [":cuda-nvvm"], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "cuda-include", outs = [ diff --git a/third_party/toolchains/preconfig/centos6/tensorrt5/BUILD b/third_party/toolchains/preconfig/centos6/tensorrt5/BUILD index e179b9361e7..3e96ceb3324 100755 --- a/third_party/toolchains/preconfig/centos6/tensorrt5/BUILD +++ b/third_party/toolchains/preconfig/centos6/tensorrt5/BUILD @@ -31,6 +31,14 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "tensorrt_lib", outs = [ diff --git a/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD b/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD index d2692a1fde9..95ec02dd868 100755 --- a/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD +++ b/third_party/toolchains/preconfig/ubuntu14.04/cuda10.0-cudnn7/cuda/BUILD @@ -1,4 +1,5 @@ load(":build_defs.bzl", "cuda_header_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like @@ -165,6 +166,14 @@ cc_library( data = [":cuda-nvvm"], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "cuda-include", outs = [ diff --git a/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD b/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD index 121990a9aff..88980d1014a 100755 --- a/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD +++ b/third_party/toolchains/preconfig/ubuntu14.04/tensorrt5/BUILD @@ -4,6 +4,7 @@ licenses(["notice"]) load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package(default_visibility = ["//visibility:public"]) @@ -31,6 +32,14 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "tensorrt_lib", outs = [ diff --git a/third_party/toolchains/preconfig/ubuntu16.04/cuda10.0-cudnn7/cuda/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/cuda10.0-cudnn7/cuda/BUILD index d2692a1fde9..95ec02dd868 100755 --- a/third_party/toolchains/preconfig/ubuntu16.04/cuda10.0-cudnn7/cuda/BUILD +++ b/third_party/toolchains/preconfig/ubuntu16.04/cuda10.0-cudnn7/cuda/BUILD @@ -1,4 +1,5 @@ load(":build_defs.bzl", "cuda_header_library") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like @@ -165,6 +166,14 @@ cc_library( data = [":cuda-nvvm"], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "cuda-include", outs = [ diff --git a/third_party/toolchains/preconfig/ubuntu16.04/rocm/rocm/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/rocm/rocm/BUILD index ea3f7efc6b3..6a23f9b14fb 100755 --- a/third_party/toolchains/preconfig/ubuntu16.04/rocm/rocm/BUILD +++ b/third_party/toolchains/preconfig/ubuntu16.04/rocm/rocm/BUILD @@ -1,3 +1,5 @@ +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") + licenses(["restricted"]) # MPL2, portions GPL v3, LGPL v3, BSD-like package(default_visibility = ["//visibility:public"]) @@ -113,6 +115,11 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], +) + genrule( name = "rocm-include", outs = [ diff --git a/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5.1/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5.1/BUILD index 574764d8dc1..f9276f16b98 100755 --- a/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5.1/BUILD +++ b/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5.1/BUILD @@ -4,6 +4,7 @@ licenses(["notice"]) load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package(default_visibility = ["//visibility:public"]) @@ -28,6 +29,14 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "tensorrt_lib", outs = [ diff --git a/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5/BUILD b/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5/BUILD index 121990a9aff..88980d1014a 100755 --- a/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5/BUILD +++ b/third_party/toolchains/preconfig/ubuntu16.04/tensorrt5/BUILD @@ -4,6 +4,7 @@ licenses(["notice"]) load("@local_config_cuda//cuda:build_defs.bzl", "cuda_default_copts") +load("@bazel_skylib//:bzl_library.bzl", "bzl_library") package(default_visibility = ["//visibility:public"]) @@ -31,6 +32,14 @@ cc_library( ], ) +bzl_library( + name = "build_defs_bzl", + srcs = ["build_defs.bzl"], + deps = [ + "@bazel_skylib//lib:selects", + ], +) + genrule( name = "tensorrt_lib", outs = [