@@ -51,6 +51,10 @@ build --define=MEDIAPIPE_DISABLE_GPU=1
51
51
52
52
build --define=MEDIAPIPE_DISABLE=0
53
53
54
+ build --define=CLOUD_DISABLE=0
55
+ coverage --define=CLOUD_DISABLE=0
56
+ test --define=CLOUD_DISABLE=0
57
+
54
58
build --define=PYTHON_DISABLE=0
55
59
56
60
# sometimes failed logs exceed this threshold
@@ -66,26 +70,38 @@ build --copt=-DGRPC_BAZEL_BUILD
66
70
build --copt=-O2
67
71
68
72
# LLVM, MLIR and TF require C++14, we use C++17 in project
69
- build --cxxopt=-std=c++17
70
- build --host_cxxopt=-std=c++17
73
+ build:linux --cxxopt=-std=c++17
74
+ build:linux --host_cxxopt=-std=c++17
75
+
76
+ build:windows --host_cxxopt=/std:c++17
77
+ build:windows --cxxopt=/std:c++17
78
+ build:windows --action_env BAZEL_CXXOPTS="/std:c++17"
79
+
80
+ # Fixing compiler errors:
81
+ #build:windows --cxxopt=/translateInclude=no
82
+ build:windows --enable_platform_specific_config
71
83
72
84
# Security options
73
- build --cxxopt=-fno-strict-overflow
74
- build --cxxopt=-fno-delete-null-pointer-checks
75
- build --cxxopt=-fwrapv
76
- build --cxxopt=-fstack-protector
77
- build --cxxopt=-fstack-clash-protection
78
- build --cxxopt=-Wformat
79
- build --cxxopt=-Wformat-security
80
- build --cxxopt=-Werror=format-security
85
+ # TODO: Add equivalent windows flag
86
+ build:linux --cxxopt=-fno-strict-overflow
87
+ build:linux --cxxopt=-fno-delete-null-pointer-checks
88
+ build:linux --cxxopt=-fwrapv
89
+ build:linux --cxxopt=-fstack-protector
90
+ build:linux --cxxopt=-fstack-clash-protection
91
+ build:linux --cxxopt=-Wformat
92
+ build:linux --cxxopt=-Wformat-security
93
+ build:linux --cxxopt=-Werror=format-security
81
94
82
95
# Adding "--cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0" creates parity with TF
83
96
# compilation options. It also addresses memory use due to
84
97
# copy-on-write semantics of std::strings of the older ABI.
85
98
build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=1
86
99
100
+ # TODO Windows: may impact python nodes execution
101
+ build:windows --noenable_bzlmod
87
102
build --experimental_repo_remote_exec
88
- build --force_pic
103
+ # TODO: Add equivalent windows flag
104
+ build:linux --force_pic
89
105
build --experimental_cc_shared_library
90
106
91
107
build --check_visibility=true
@@ -96,4 +112,147 @@ build --cxxopt=-DOVMS_DUMP_TO_FILE=0
96
112
# envs below are required to succesfully run binaries in bazel as bazel is
97
113
# very strict in sandboxing
98
114
test --test_env PYTHONPATH=/opt/intel/openvino/python:/ovms/bazel-bin/src/python/binding
115
+
116
+ # TF bazelrc settings
117
+ # TensorFlow Bazel configuration file.
118
+
119
+ build:windows --define framework_shared_object=true
120
+ build:windows --define tsl_protobuf_header_only=true
121
+
122
+ build:windows --define=use_fast_cpp_protos=true
123
+ build:windows --define=allow_oversize_protos=true
124
+
125
+ build:windows --spawn_strategy=standalone
126
+ build:windows -c opt
127
+
128
+ # Make Bazel print out all options from rc files.
129
+ build:windows --announce_rc
130
+
131
+ # TODO(mihaimaruseac): Document this option or remove if no longer needed
132
+ build:windows --define=grpc_no_ares=true
133
+
134
+
135
+ build:windows --noincompatible_remove_legacy_whole_archive
136
+ build:windows --features=-force_no_whole_archive
137
+
138
+ # TODO(mihaimaruseac): Document this option or remove if no longer needed
139
+ build:windows --enable_platform_specific_config
140
+
141
+ # Enable XLA support by default.
142
+ build:windows --define=with_xla_support=true
143
+
144
+ # TODO(mihaimaruseac): Document this option or remove if no longer needed
145
+ build:windows --config=short_logs
146
+
147
+ # TODO(mihaimaruseac): Document this option or remove if no longer needed
148
+ build:windows --config=v2
149
+
150
+ # Disable AWS/HDFS support by default
151
+ build:windows --define=no_aws_support=true
152
+ build:windows --define=no_hdfs_support=true
153
+
154
+ # cc_shared_library ensures no library is linked statically more than once.
155
+ build:windows --experimental_link_static_libraries_once=false
156
+
157
+ # Prevent regressions on those two incompatible changes
158
+ # TODO: remove those flags when they are flipped in the default Bazel version TF uses.
159
+ build:windows --incompatible_enforce_config_setting_visibility
160
+
161
+ # Config to use a mostly-static build and disable modular op registration
162
+ # support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python).
163
+ # By default, TensorFlow will build with a dependence on
164
+ # //tensorflow:libtensorflow_framework.so.
165
+ build:monolithic --define framework_shared_object=false
166
+ build:monolithic --define tsl_protobuf_header_only=false
167
+ build:monolithic --experimental_link_static_libraries_once=false # b/229868128
168
+
169
+ build:windows --copt=/W0
170
+ build:windows --host_copt=/W0
171
+
172
+ # On Windows, `__cplusplus` is wrongly defined without this switch
173
+ # See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
174
+ build:windows --copt=/Zc:__cplusplus
175
+ build:windows --host_copt=/Zc:__cplusplus
176
+
177
+ # Tensorflow uses M_* math constants that only get defined by MSVC headers if
178
+ # _USE_MATH_DEFINES is defined.
179
+ build:windows --copt=/D_USE_MATH_DEFINES
180
+ build:windows --host_copt=/D_USE_MATH_DEFINES
181
+
182
+ # Windows has a relatively short command line limit, which TF has begun to hit.
183
+ # See https://docs.bazel.build/versions/main/windows.html
184
+ build:windows --features=compiler_param_file
185
+ build:windows --features=archive_param_file
186
+
187
+ # Speed Windows compile times. Available in VS 16.4 (we are on 16.11). See
188
+ # https://groups.google.com/a/tensorflow.org/d/topic/build/SsW98Eo7l3o/discussion
189
+ build:windows --copt=/d2ReducedOptimizeHugeFunctions
190
+ build:windows --host_copt=/d2ReducedOptimizeHugeFunctions
191
+
192
+ build:windows --cxxopt=/std:c++17
193
+ build:windows --host_cxxopt=/std:c++17
194
+
195
+ # On windows, we still link everything into a single DLL.
196
+ build:windows --config=monolithic
197
+
198
+ # Make sure to include as little of windows.h as possible
199
+ build:windows --copt=-DWIN32_LEAN_AND_MEAN
200
+ build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
201
+ build:windows --copt=-DNOGDI
202
+ build:windows --host_copt=-DNOGDI
203
+
204
+ # MSVC (Windows): Standards-conformant preprocessor mode
205
+ # See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
206
+ build:windows --copt=/Zc:preprocessor
207
+ build:windows --host_copt=/Zc:preprocessor
208
+
209
+ # Misc build options we need for windows.
210
+ build:windows --linkopt=/DEBUG
211
+ build:windows --host_linkopt=/DEBUG
212
+ build:windows --linkopt=/OPT:REF
213
+ build:windows --host_linkopt=/OPT:REF
214
+ build:windows --linkopt=/OPT:ICF
215
+ build:windows --host_linkopt=/OPT:ICF
216
+
217
+ # Verbose failure logs when something goes wrong
218
+ build:windows --verbose_failures
219
+
220
+ # Work around potential issues with large command lines on windows.
221
+ # See: https://github.com/bazelbuild/bazel/issues/5163
222
+ build:windows --features=compiler_param_file
223
+
224
+ # Configure short or long logs
225
+ build:short_logs --output_filter=DONT_MATCH_ANYTHING
226
+ build:verbose_logs --output_filter=
227
+
228
+ build:avx_win --copt=/arch=AVX
229
+ build:avx2_win --copt=/arch=AVX2
230
+
231
+ # Options to build TensorFlow 1.x or 2.x.
232
+ build:v1 --define=tf_api_version=1 --action_env=TF2_BEHAVIOR=0
233
+ build:v2 --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
234
+
235
+ # Flag to enable remote config
236
+ build:windows --experimental_repo_remote_exec
237
+
238
+ # Config-specific options should come above this line.
239
+
240
+ # Load rc file written by ./configure.
241
+ # try-import %workspace%/.tf_configure.bazelrc
242
+ build:windows --action_env PYTHON_BIN_PATH="C:/opt/Python39/python.exe"
243
+ build:windows --action_env PYTHON_LIB_PATH="C:/opt/Python39/lib/site-packages"
244
+ build:windows --python_path="C:/opt/Python39/python.exe"
245
+ build:windows:opt --copt=/arch:AVX
246
+ build:windows:opt --host_copt=/arch:AVX
247
+ build:windows --define=override_eigen_strong_inline=true
248
+
249
+ # Load rc file with user-specific options.
250
+ try-import %workspace%/.bazelrc.user
251
+
252
+ # Disable TFRT integration for now unless --config=tfrt is specified.
253
+ build:windows --deleted_packages=tensorflow/core/tfrt/stubs,tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/ir,tensorflow/compiler/mlir/tfrt/ir/mlrt,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/mlrt,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/compiler/mlir/tfrt/transforms/mlrt,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/mlrt,tensorflow/core/tfrt/mlrt/attribute,tensorflow/core/tfrt/mlrt/kernel,tensorflow/core/tfrt/mlrt/bytecode,tensorflow/core/tfrt/mlrt/interpreter,tensorflow/compiler/mlir/tfrt/translate/mlrt,tensorflow/compiler/mlir/tfrt/translate/mlrt/testdata,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils,tensorflow/core/tfrt/utils/debug,tensorflow/core/tfrt/saved_model/python,tensorflow/core/tfrt/graph_executor/python
254
+
255
+ # Windows build ssl headers for GRPC workaround
256
+ build:windows --override_repository="boringssl=C:\\opt\\boringSSL-SwiftPM"
257
+
99
258
test --test_env LD_LIBRARY_PATH=/opt/opencv/lib/:/opt/intel/openvino/runtime/lib/intel64/:/opt/intel/openvino/runtime/3rdparty/tbb/lib/
0 commit comments