Revert "Make tutorial_example_trainer build on Windows with Bazel"

This commit is contained in:
Rohan Jain 2016-10-14 20:11:00 -07:00 committed by GitHub
parent c20da14873
commit be3bc472a5
10 changed files with 91 additions and 210 deletions
tensorflow
BUILD
core
BUILD
kernels
platform
util/tensor_bundle
tensorflow.bzl
tools/proto_text
third_party/gpus/cuda

View File

@ -44,12 +44,6 @@ config_setting(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
config_setting(
name = "windows",
values = {"cpu": "x64_windows_msvc"},
visibility = ["//visibility:public"],
)
config_setting( config_setting(
name = "ios", name = "ios",
values = { values = {

View File

@ -64,7 +64,6 @@ load(
"//tensorflow:tensorflow.bzl", "//tensorflow:tensorflow.bzl",
"if_android", "if_android",
"if_ios", "if_ios",
"if_not_windows",
"tf_copts", "tf_copts",
"tf_cc_test", "tf_cc_test",
"tf_cc_tests", "tf_cc_tests",
@ -141,7 +140,6 @@ cc_library(
"platform/protobuf.h", "platform/protobuf.h",
"platform/types.h", "platform/types.h",
] + glob(tf_additional_proto_hdrs()), ] + glob(tf_additional_proto_hdrs()),
copts = tf_copts(),
deps = [ deps = [
":protos_all_cc", ":protos_all_cc",
"//tensorflow/core/platform/default/build_config:proto_parsing", "//tensorflow/core/platform/default/build_config:proto_parsing",
@ -295,6 +293,8 @@ tf_cuda_library(
"util/example_proto_fast_parsing.h", "util/example_proto_fast_parsing.h",
"util/example_proto_helper.h", "util/example_proto_helper.h",
"util/guarded_philox_random.h", "util/guarded_philox_random.h",
"util/memmapped_file_system.h",
"util/memmapped_file_system_writer.h",
"util/mirror_pad_mode.h", "util/mirror_pad_mode.h",
"util/padding.h", "util/padding.h",
"util/port.h", "util/port.h",
@ -311,13 +311,7 @@ tf_cuda_library(
"util/use_cudnn.h", "util/use_cudnn.h",
"util/util.h", "util/util.h",
"util/work_sharder.h", "util/work_sharder.h",
] + select({
"//tensorflow:windows": [],
"//conditions:default": [
"util/memmapped_file_system.h",
"util/memmapped_file_system_writer.h",
], ],
}),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [":framework_internal"], deps = [":framework_internal"],
) )
@ -518,6 +512,7 @@ cc_library(
"//tensorflow/core/kernels:control_flow_ops", "//tensorflow/core/kernels:control_flow_ops",
"//tensorflow/core/kernels:ctc_ops", "//tensorflow/core/kernels:ctc_ops",
"//tensorflow/core/kernels:data_flow", "//tensorflow/core/kernels:data_flow",
"//tensorflow/core/kernels:fact_op",
"//tensorflow/core/kernels:function_ops", "//tensorflow/core/kernels:function_ops",
"//tensorflow/core/kernels:image", "//tensorflow/core/kernels:image",
"//tensorflow/core/kernels:io", "//tensorflow/core/kernels:io",
@ -536,11 +531,7 @@ cc_library(
"//tensorflow/core/kernels:string", "//tensorflow/core/kernels:string",
"//tensorflow/core/kernels:training_ops", "//tensorflow/core/kernels:training_ops",
"//tensorflow/models/embedding:word2vec_kernels", "//tensorflow/models/embedding:word2vec_kernels",
] + if_not_windows([ ],
"//tensorflow/core/kernels:fact_op",
"//tensorflow/core/kernels:array_not_windows",
"//tensorflow/core/kernels:math_not_windows",
]),
) )
tf_cuda_library( tf_cuda_library(
@ -880,12 +871,12 @@ cc_library(
# Libraries with GPU facilities that are useful for writing kernels. # Libraries with GPU facilities that are useful for writing kernels.
cc_library( cc_library(
name = "gpu_lib", name = "gpu_lib",
srcs = if_not_windows([ srcs = [
"common_runtime/gpu/gpu_event_mgr.cc", "common_runtime/gpu/gpu_event_mgr.cc",
]), ],
hdrs = if_not_windows([ hdrs = [
"common_runtime/gpu/gpu_event_mgr.h", "common_runtime/gpu/gpu_event_mgr.h",
]), ],
copts = tf_copts(), copts = tf_copts(),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
@ -895,7 +886,8 @@ cc_library(
":lib_internal", ":lib_internal",
":proto_text", ":proto_text",
":protos_all_cc", ":protos_all_cc",
] + if_not_windows([":stream_executor"]), ":stream_executor",
],
) )
cc_library( cc_library(
@ -955,22 +947,7 @@ tf_proto_library_cc(
cc_library( cc_library(
name = "lib_internal", name = "lib_internal",
srcs = select({ srcs = glob(
"//tensorflow:windows": glob(
[
"lib/**/*.h",
"lib/**/*.cc",
"platform/*.h",
"platform/*.cc",
],
exclude = [
"**/*test*",
"platform/**/cuda.h",
"platform/**/stream_executor.h",
"platform/load_library.cc",
],
),
"//conditions:default": glob(
[ [
"lib/**/*.h", "lib/**/*.h",
"lib/**/*.cc", "lib/**/*.cc",
@ -978,15 +955,9 @@ cc_library(
"platform/*.cc", "platform/*.cc",
"platform/profile_utils/**/*.h", "platform/profile_utils/**/*.h",
"platform/profile_utils/**/*.cc", "platform/profile_utils/**/*.cc",
], ] + tf_additional_lib_srcs(),
exclude = [ exclude =
"**/*test*", [
"platform/**/cuda.h",
"platform/**/stream_executor.h",
],
),
}) + tf_additional_lib_srcs(
exclude = [
"**/*test*", "**/*test*",
"platform/**/cuda.h", "platform/**/cuda.h",
"platform/**/stream_executor.h", "platform/**/stream_executor.h",
@ -995,7 +966,7 @@ cc_library(
# dependency. # dependency.
tf_additional_proto_srcs(), tf_additional_proto_srcs(),
), ),
hdrs = tf_additional_lib_hdrs() + [ hdrs = glob(tf_additional_lib_hdrs()) + [
"lib/core/blocking_counter.h", "lib/core/blocking_counter.h",
"lib/core/refcount.h", "lib/core/refcount.h",
"lib/gif/gif_io.h", "lib/gif/gif_io.h",
@ -1066,7 +1037,6 @@ tf_version_info_genrule()
cc_library( cc_library(
name = "version_lib", name = "version_lib",
srcs = ["util/version_info.cc"], srcs = ["util/version_info.cc"],
copts = tf_copts(),
) )
tf_cuda_library( tf_cuda_library(
@ -1088,18 +1058,8 @@ tf_cuda_library(
"util/reporter.h", "util/reporter.h",
"util/reporter.cc", "util/reporter.cc",
"framework/fake_input.*", "framework/fake_input.*",
"util/memmapped_file_system.*",
"util/memmapped_file_system_writer.*",
], ],
) + select({ ),
"//tensorflow:windows": [],
"//conditions:default": glob([
"util/memmapped_file_system.h",
"util/memmapped_file_system.cc",
"util/memmapped_file_system_writer.h",
"util/memmapped_file_system_writer.cc",
]),
}),
hdrs = [ hdrs = [
"framework/op_segment.h", "framework/op_segment.h",
"framework/rendezvous.h", # only needed for tests "framework/rendezvous.h", # only needed for tests
@ -1373,7 +1333,7 @@ tf_cuda_library(
tf_cuda_library( tf_cuda_library(
name = "gpu_runtime", name = "gpu_runtime",
srcs = if_not_windows([ srcs = [
"common_runtime/gpu/gpu_bfc_allocator.cc", "common_runtime/gpu/gpu_bfc_allocator.cc",
"common_runtime/gpu/gpu_debug_allocator.cc", "common_runtime/gpu/gpu_debug_allocator.cc",
"common_runtime/gpu/gpu_device.cc", "common_runtime/gpu/gpu_device.cc",
@ -1385,8 +1345,8 @@ tf_cuda_library(
"common_runtime/gpu/pool_allocator.cc", "common_runtime/gpu/pool_allocator.cc",
"common_runtime/gpu/process_state.cc", "common_runtime/gpu/process_state.cc",
"common_runtime/gpu_device_context.h", "common_runtime/gpu_device_context.h",
]), ],
hdrs = if_not_windows([ hdrs = [
"common_runtime/gpu/gpu_bfc_allocator.h", "common_runtime/gpu/gpu_bfc_allocator.h",
"common_runtime/gpu/gpu_debug_allocator.h", "common_runtime/gpu/gpu_debug_allocator.h",
"common_runtime/gpu/gpu_device.h", "common_runtime/gpu/gpu_device.h",
@ -1395,7 +1355,7 @@ tf_cuda_library(
"common_runtime/gpu/gpu_util.h", "common_runtime/gpu/gpu_util.h",
"common_runtime/gpu/pool_allocator.h", "common_runtime/gpu/pool_allocator.h",
"common_runtime/gpu/process_state.h", "common_runtime/gpu/process_state.h",
]), ],
copts = tf_copts(), copts = tf_copts(),
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
@ -1407,10 +1367,9 @@ tf_cuda_library(
":lib", ":lib",
":lib_internal", ":lib_internal",
":protos_all_cc", ":protos_all_cc",
"//third_party/eigen3",
] + if_not_windows([
":stream_executor", ":stream_executor",
]), "//third_party/eigen3",
],
alwayslink = 1, alwayslink = 1,
) )

View File

@ -25,7 +25,6 @@ package_group(
load( load(
"//tensorflow:tensorflow.bzl", "//tensorflow:tensorflow.bzl",
"if_not_windows",
"tf_cc_test", "tf_cc_test",
"tf_cc_tests", "tf_cc_tests",
"tf_copts", "tf_copts",
@ -385,7 +384,42 @@ cc_header_only_library(
# OpKernel libraries ---------------------------------------------------------- # OpKernel libraries ----------------------------------------------------------
ARRAY_DEPS = [ tf_kernel_libraries(
name = "array",
prefixes = [
"bcast_ops",
"bitcast_op",
"concat_op",
"constant_op",
"debug_ops",
"diag_op",
"matrix_band_part_op",
"matrix_diag_op",
"matrix_set_diag_op",
"edit_distance_op",
"gather_op",
"gather_nd_op",
"identity_op",
"immutable_constant_op",
"listdiff_op",
"mirror_pad_op",
"one_hot_op",
"pack_op",
"pad_op",
"quantize_and_dequantize_op",
"reshape_op",
"reverse_op",
"reverse_sequence_op",
"shape_ops",
"slice_op",
"split_op",
"tile_ops",
"transpose_op",
"unique_op",
"unpack_op",
"where_op",
],
deps = [
":batch_space_ops", ":batch_space_ops",
":bounds_check", ":bounds_check",
":concat_lib", ":concat_lib",
@ -409,51 +443,7 @@ ARRAY_DEPS = [
"//tensorflow/core:protos_all_cc", "//tensorflow/core:protos_all_cc",
"//tensorflow/core/debug:debug_io_utils", "//tensorflow/core/debug:debug_io_utils",
"//third_party/eigen3", "//third_party/eigen3",
]
tf_kernel_libraries(
name = "array_not_windows",
prefixes = [
"debug_ops",
"immutable_constant_op",
], ],
deps = ARRAY_DEPS,
)
tf_kernel_libraries(
name = "array",
prefixes = [
"bcast_ops",
"bitcast_op",
"concat_op",
"constant_op",
"diag_op",
"matrix_band_part_op",
"matrix_diag_op",
"matrix_set_diag_op",
"edit_distance_op",
"gather_op",
"gather_nd_op",
"identity_op",
"listdiff_op",
"mirror_pad_op",
"one_hot_op",
"pack_op",
"pad_op",
"quantize_and_dequantize_op",
"reshape_op",
"reverse_op",
"reverse_sequence_op",
"shape_ops",
"slice_op",
"split_op",
"tile_ops",
"transpose_op",
"unique_op",
"unpack_op",
"where_op",
],
deps = ARRAY_DEPS,
) )
tf_cc_test( tf_cc_test(
@ -1272,27 +1262,6 @@ tf_cc_tests(
], ],
) )
MATH_DEPS = [
":bounds_check",
":fill_functor",
":transpose_functor",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:math_grad",
"//tensorflow/core:math_ops_op_lib",
"//third_party/eigen3",
]
tf_kernel_libraries(
name = "math_not_windows",
prefixes = [
"sparse_matmul_op",
],
deps = MATH_DEPS,
)
tf_kernel_libraries( tf_kernel_libraries(
name = "math", name = "math",
prefixes = [ prefixes = [
@ -1310,8 +1279,20 @@ tf_kernel_libraries(
"segment_reduction_ops", "segment_reduction_ops",
"scan_ops", "scan_ops",
"sequence_ops", "sequence_ops",
"sparse_matmul_op",
],
deps = [
":bounds_check",
":fill_functor",
":transpose_functor",
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:lib_internal",
"//tensorflow/core:math_grad",
"//tensorflow/core:math_ops_op_lib",
"//third_party/eigen3",
], ],
deps = MATH_DEPS,
) )
tf_cuda_cc_test( tf_cuda_cc_test(
@ -1591,6 +1572,7 @@ tf_kernel_libraries(
":conv_2d", ":conv_2d",
":conv_ops", ":conv_ops",
":depthwise_conv_grad_op", ":depthwise_conv_grad_op",
":depthwise_conv_op",
":dilation_ops", ":dilation_ops",
":fused_batch_norm_util_gpu", ":fused_batch_norm_util_gpu",
":ops_util", ":ops_util",
@ -1601,9 +1583,7 @@ tf_kernel_libraries(
"//tensorflow/core:nn_grad", "//tensorflow/core:nn_grad",
"//tensorflow/core:nn_ops_op_lib", "//tensorflow/core:nn_ops_op_lib",
"//third_party/eigen3", "//third_party/eigen3",
] + if_not_windows([ ],
":depthwise_conv_op",
]),
) )
tf_cuda_cc_test( tf_cuda_cc_test(

View File

@ -90,31 +90,17 @@ def tf_proto_library(name, srcs = [], has_services = None,
visibility = visibility, visibility = visibility,
) )
def tf_additional_lib_hdrs(exclude = []): def tf_additional_lib_hdrs():
return select({ return [
"//tensorflow:windows" : native.glob([
"platform/default/*.h",
"platform/windows/*.h",
"platform/posix/error.h",
], exclude = exclude),
"//conditions:default" : native.glob([
"platform/default/*.h", "platform/default/*.h",
"platform/posix/*.h", "platform/posix/*.h",
], exclude = exclude), ]
})
def tf_additional_lib_srcs(exclude = []): def tf_additional_lib_srcs():
return select({ return [
"//tensorflow:windows" : native.glob([
"platform/default/*.cc",
"platform/windows/*.cc",
"platform/posix/error.cc",
], exclude = exclude),
"//conditions:default" : native.glob([
"platform/default/*.cc", "platform/default/*.cc",
"platform/posix/*.cc", "platform/posix/*.cc",
], exclude = exclude), ]
})
def tf_additional_minimal_lib_srcs(): def tf_additional_minimal_lib_srcs():
return [ return [

View File

@ -32,8 +32,6 @@ limitations under the License.
#include "tensorflow/core/platform/logging.h" #include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/windows/windows_file_system.h" #include "tensorflow/core/platform/windows/windows_file_system.h"
#pragma comment(lib, "Shlwapi.lib")
namespace tensorflow { namespace tensorflow {
namespace { namespace {

View File

@ -20,7 +20,6 @@ limitations under the License.
#include <snappy.h> #include <snappy.h>
#endif #endif
#include <WinSock2.h> #include <WinSock2.h>
#pragma comment(lib, "Ws2_32.lib")
#include "tensorflow/core/platform/cpu_info.h" #include "tensorflow/core/platform/cpu_info.h"
#include "tensorflow/core/platform/demangle.h" #include "tensorflow/core/platform/demangle.h"

View File

@ -9,8 +9,6 @@ licenses(["notice"]) # Apache 2.0
exports_files(["LICENSE"]) exports_files(["LICENSE"])
load("//tensorflow:tensorflow.bzl", "tf_copts")
# To be exported to tensorflow/core:android_srcs. # To be exported to tensorflow/core:android_srcs.
filegroup( filegroup(
name = "android_srcs", name = "android_srcs",
@ -26,7 +24,6 @@ cc_library(
name = "tensor_bundle", name = "tensor_bundle",
srcs = ["tensor_bundle.cc"], srcs = ["tensor_bundle.cc"],
hdrs = ["tensor_bundle.h"], hdrs = ["tensor_bundle.h"],
copts = tf_copts(),
deps = [ deps = [
":naming", ":naming",
"//tensorflow/core:core_cpu_internal", "//tensorflow/core:core_cpu_internal",

View File

@ -140,12 +140,6 @@ def if_not_mobile(a):
"//conditions:default": a, "//conditions:default": a,
}) })
def if_not_windows(a):
return select({
"//tensorflow:windows": [],
"//conditions:default": a,
})
def tf_copts(): def tf_copts():
return (["-fno-exceptions", "-DEIGEN_AVOID_STL_ARRAY"] + return (["-fno-exceptions", "-DEIGEN_AVOID_STL_ARRAY"] +
if_cuda(["-DGOOGLE_CUDA=1"]) + if_cuda(["-DGOOGLE_CUDA=1"]) +
@ -157,10 +151,6 @@ def tf_copts():
"-O2", "-O2",
], ],
"//tensorflow:darwin": [], "//tensorflow:darwin": [],
"//tensorflow:windows": [
"/DLANG_CXX11",
"/D__VERSION__=\\\"MSVC\\\"",
],
"//tensorflow:ios": ["-std=c++11",], "//tensorflow:ios": ["-std=c++11",],
"//conditions:default": ["-pthread"]})) "//conditions:default": ["-pthread"]}))

View File

@ -42,17 +42,12 @@ cc_library(
name = "gen_proto_text_functions_lib", name = "gen_proto_text_functions_lib",
srcs = ["gen_proto_text_functions_lib.cc"], srcs = ["gen_proto_text_functions_lib.cc"],
hdrs = ["gen_proto_text_functions_lib.h"], hdrs = ["gen_proto_text_functions_lib.h"],
linkopts = select({ linkopts = [
"//tensorflow:windows": [],
"//tensorflow:darwin": [
"-lm", "-lm",
"-lpthread", "-lpthread",
], ] + select({
"//conditions:default": [ "//tensorflow:darwin": [],
"-lm", "//conditions:default": ["-lrt"],
"-lpthread",
"-lrt",
],
}), }),
deps = [ deps = [
"//tensorflow/core:lib_proto_parsing", "//tensorflow/core:lib_proto_parsing",

View File

@ -14,11 +14,6 @@ def cuda_library_path(name, version = cuda_sdk_version()):
return "lib/lib{}.dylib".format(name) return "lib/lib{}.dylib".format(name)
else: else:
return "lib/lib{}.{}.dylib".format(name, version) return "lib/lib{}.{}.dylib".format(name, version)
elif PLATFORM == "Windows":
if not version:
return "lib/{}.dll".format(name)
else:
return "lib/{}{}.dll".format(name, version)
else: else:
if not version: if not version:
return "lib64/lib{}.so".format(name) return "lib64/lib{}.so".format(name)
@ -28,8 +23,6 @@ def cuda_library_path(name, version = cuda_sdk_version()):
def cuda_static_library_path(name): def cuda_static_library_path(name):
if PLATFORM == "Darwin": if PLATFORM == "Darwin":
return "lib/lib{}_static.a".format(name) return "lib/lib{}_static.a".format(name)
elif PLATFORM == "Windows":
return "lib/{}_static.lib".format(name)
else: else:
return "lib64/lib{}_static.a".format(name) return "lib64/lib{}_static.a".format(name)
@ -39,11 +32,6 @@ def cudnn_library_path(version = cudnn_sdk_version()):
return "lib/libcudnn.dylib" return "lib/libcudnn.dylib"
else: else:
return "lib/libcudnn.{}.dylib".format(version) return "lib/libcudnn.{}.dylib".format(version)
elif PLATFORM == "Windows":
if not version:
return "lib/cudnn.dll"
else:
return "lib/cudnn{}.dll".format(version)
else: else:
if not version: if not version:
return "lib64/libcudnn.so" return "lib64/libcudnn.so"
@ -56,11 +44,6 @@ def cupti_library_path(version = cuda_sdk_version()):
return "extras/CUPTI/lib/libcupti.dylib" return "extras/CUPTI/lib/libcupti.dylib"
else: else:
return "extras/CUPTI/lib/libcupti.{}.dylib".format(version) return "extras/CUPTI/lib/libcupti.{}.dylib".format(version)
elif PLATFORM == "Windows":
if not version:
return "extras/CUPTI/lib/cupti.dll"
else:
return "extras/CUPTI/lib/cupti{}.dll".format(version)
else: else:
if not version: if not version:
return "extras/CUPTI/lib64/libcupti.so" return "extras/CUPTI/lib64/libcupti.so"