-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bazelrc
120 lines (95 loc) · 3.88 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# TensorFlow Federated Bazel configuration.
#
# See https://docs.bazel.build/versions/master/user-manual.html#config for
# details on the various configuration options.
# Enable verbose failures for testing only.
build --verbose_failures
# Enable logging rc options.
common --announce_rc
# Enable platform-specific configs from bazelrc files.
common --enable_platform_specific_config
# Enable logging error output.
test --test_output=errors
test --test_summary=detailed
# Execute commands as local subprocesses
build --spawn_strategy=local
# Enable build optimizations.
build --compilation_mode=opt
# Enable fast C++ protocol buffers, 10x speedup over pure Python.
build --define=use_fast_cpp_protos=true
build --define=allow_oversize_protos=true
# Processor native optimizations (depends on build host capabilities).
build --copt=-march=native
build --host_copt=-march=native
# Only use level three optimizations for target, not necessarily for host
# since host artifacts don't need to be fast.
build --copt=-O3
# C++ compiler options.
build --cxxopt=-std=c++14
build --host_cxxopt=-std=c++14
# Suppress C++ compiler warnings.
build:linux --copt=-w
build:linux --host_copt=-w
build:macos --copt=-w
# gRPC on MacOS requires this define, see
# https://github.com/bazelbuild/bazel/issues/4341#issuecomment-572050759 for
# more information.
build:macos --copt=-DGRPC_BAZEL_BUILD
# Sets the default Apple platform to macOS.
build:macos --apple_platform_type=macos
#
# Remote execution capabilities.
#
# Enable authentication.
build:remote --google_default_credentials=true
# Enable remote cache.
build:remote --remote_cache=grpcs://remotebuildexecution.googleapis.com
# Project configuration.
build:remote --remote_instance_name=projects/tensorflow-federated/instances/default_instance
build:remote --project_id=tensorflow-federated
#
# Required to build TensorFlow.
#
build --define framework_shared_object=true
# Modular TF build options
build:dynamic_kernels --define=dynamic_loaded_kernels=true
build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS
# GCC >= 5 requires specify this to be ABI compatible with how the TensorFlow
# pip package is built. More details at
# https://www.tensorflow.org/guide/create_op#build_the_op_library.
build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0
# On linux, don't cross compile by default
build:linux --config=dynamic_kernels
build:linux --distinct_host_configuration=false
build:linux --experimental_guard_against_concurrent_changes
build:linux --define=PREFIX=/usr
build:linux --define=LIBDIR=$(PREFIX)/lib
build:linux --define=INCLUDEDIR=$(PREFIX)/include
build:linux --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include
build:avx_linux --copt=-mavx
build:avx_linux --host_copt=-mavx
build:native_arch_linux --copt=-march=native
build:v1 --define=tf_api_version=1 --action_env=TF2_BEHAVIOR=0
build:v2 --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
# See https://github.com/bazelbuild/bazel/issues/7362 for information on what
# --incompatible_remove_legacy_whole_archive flag does.
# This flag is set to true in Bazel 1.0 and newer versions. We tried to migrate
# Tensorflow to the default, however test coverage wasn't enough to catch the
# errors.
# There is ongoing work on Bazel team's side to provide support for transitive
# shared libraries. As part of migrating to transitive shared libraries, we
# hope to provide a better mechanism for control over symbol exporting, and
# then tackle this issue again.
#
# Remove this line once TF doesn't depend on Bazel wrapping all library
# archives in -whole_archive -no_whole_archive.
build --noincompatible_remove_legacy_whole_archive
build --enable_platform_specific_config
build --define=grpc_no_ares=true
build --define=no_aws_support=true
build --define=no_hdfs_support=true
build --define=with_xla_support=true
build --config=v2
# Enable remote execution capabilities.
common --experimental_repo_remote_exec
common --experimental_cc_shared_library