xref: /aosp_15_r20/external/tensorflow/.bazelrc (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1*b6fb3261SAndroid Build Coastguard Worker# TensorFlow Bazel configuration file.
2*b6fb3261SAndroid Build Coastguard Worker# This file tries to group and simplify build options for TensorFlow
3*b6fb3261SAndroid Build Coastguard Worker#
4*b6fb3261SAndroid Build Coastguard Worker# ----CONFIG OPTIONS----
5*b6fb3261SAndroid Build Coastguard Worker# Android options:
6*b6fb3261SAndroid Build Coastguard Worker#    android:
7*b6fb3261SAndroid Build Coastguard Worker#    android_arm:
8*b6fb3261SAndroid Build Coastguard Worker#    android_arm64:
9*b6fb3261SAndroid Build Coastguard Worker#    android_x86:
10*b6fb3261SAndroid Build Coastguard Worker#    android_x86_64:
11*b6fb3261SAndroid Build Coastguard Worker#
12*b6fb3261SAndroid Build Coastguard Worker# iOS options:
13*b6fb3261SAndroid Build Coastguard Worker#     ios:
14*b6fb3261SAndroid Build Coastguard Worker#     ios_armv7:
15*b6fb3261SAndroid Build Coastguard Worker#     ios_arm64:
16*b6fb3261SAndroid Build Coastguard Worker#     ios_i386:
17*b6fb3261SAndroid Build Coastguard Worker#     ios_x86_64:
18*b6fb3261SAndroid Build Coastguard Worker#     ios_fat:
19*b6fb3261SAndroid Build Coastguard Worker#
20*b6fb3261SAndroid Build Coastguard Worker# Macosx options
21*b6fb3261SAndroid Build Coastguard Worker#     darwin_arm64:
22*b6fb3261SAndroid Build Coastguard Worker#
23*b6fb3261SAndroid Build Coastguard Worker# Compiler options:
24*b6fb3261SAndroid Build Coastguard Worker#     cuda_clang:             Use clang when building CUDA code.
25*b6fb3261SAndroid Build Coastguard Worker#     avx_linux:              Build with avx instruction set on linux.
26*b6fb3261SAndroid Build Coastguard Worker#     avx2_linux:             Build with avx2 instruction set on linux.
27*b6fb3261SAndroid Build Coastguard Worker#     native_arch_linux:      Build with instruction sets available to the host machine on linux
28*b6fb3261SAndroid Build Coastguard Worker#     avx_win:                Build with avx instruction set on windows
29*b6fb3261SAndroid Build Coastguard Worker#     avx2_win:               Build with avx2 instruction set on windows
30*b6fb3261SAndroid Build Coastguard Worker#
31*b6fb3261SAndroid Build Coastguard Worker# Other build options:
32*b6fb3261SAndroid Build Coastguard Worker#     short_logs:       Only log errors during build, skip warnings.
33*b6fb3261SAndroid Build Coastguard Worker#     verbose_logs:     Show all compiler warnings during build.
34*b6fb3261SAndroid Build Coastguard Worker#     monolithic:       Build all TF C++ code into a single shared object.
35*b6fb3261SAndroid Build Coastguard Worker#     dynamic_kernels:  Try to link all kernels dynamically (experimental).
36*b6fb3261SAndroid Build Coastguard Worker#     libc++:           Link against libc++ instead of stdlibc++
37*b6fb3261SAndroid Build Coastguard Worker#     asan:             Build with the clang address sanitizer
38*b6fb3261SAndroid Build Coastguard Worker#     msan:             Build with the clang memory sanitizer
39*b6fb3261SAndroid Build Coastguard Worker#     ubsan:            Build with the clang undefined behavior sanitizer
40*b6fb3261SAndroid Build Coastguard Worker#     dbg:              Build with debug info
41*b6fb3261SAndroid Build Coastguard Worker#
42*b6fb3261SAndroid Build Coastguard Worker#
43*b6fb3261SAndroid Build Coastguard Worker# TF version options;
44*b6fb3261SAndroid Build Coastguard Worker#     v1: Build TF V1 (without contrib)
45*b6fb3261SAndroid Build Coastguard Worker#     v2: Build TF v2
46*b6fb3261SAndroid Build Coastguard Worker#
47*b6fb3261SAndroid Build Coastguard Worker# Feature and Third party library support options:
48*b6fb3261SAndroid Build Coastguard Worker#     xla:          Build TF with XLA
49*b6fb3261SAndroid Build Coastguard Worker#     tpu:          Build TF with TPU support
50*b6fb3261SAndroid Build Coastguard Worker#     cuda:         Build with full cuda support.
51*b6fb3261SAndroid Build Coastguard Worker#     rocm:         Build with AMD GPU support (rocm).
52*b6fb3261SAndroid Build Coastguard Worker#     mkl:          Enable full mkl support.
53*b6fb3261SAndroid Build Coastguard Worker#     tensorrt:     Enable Tensorrt support.
54*b6fb3261SAndroid Build Coastguard Worker#     numa:         Enable numa using hwloc.
55*b6fb3261SAndroid Build Coastguard Worker#     noaws:        Disable AWS S3 storage support
56*b6fb3261SAndroid Build Coastguard Worker#     nogcp:        Disable GCS support.
57*b6fb3261SAndroid Build Coastguard Worker#     nohdfs:       Disable hadoop hdfs support.
58*b6fb3261SAndroid Build Coastguard Worker#     nonccl:       Disable nccl support.
59*b6fb3261SAndroid Build Coastguard Worker#
60*b6fb3261SAndroid Build Coastguard Worker#
61*b6fb3261SAndroid Build Coastguard Worker# Remote build execution options (only configured to work with TF team projects for now.)
62*b6fb3261SAndroid Build Coastguard Worker#     rbe:       General RBE options shared by all flavors.
63*b6fb3261SAndroid Build Coastguard Worker#     rbe_linux: General RBE options used on all linux builds.
64*b6fb3261SAndroid Build Coastguard Worker#     rbe_win:   General RBE options used on all windows builds.
65*b6fb3261SAndroid Build Coastguard Worker#
66*b6fb3261SAndroid Build Coastguard Worker#     rbe_cpu_linux:                  RBE options to build with only CPU support.
67*b6fb3261SAndroid Build Coastguard Worker#     rbe_linux_cuda_nvcc_py*:        RBE options to build with GPU support using nvcc.
68*b6fb3261SAndroid Build Coastguard Worker#
69*b6fb3261SAndroid Build Coastguard Worker#     rbe_linux_py3:        Linux Python 3 RBE config
70*b6fb3261SAndroid Build Coastguard Worker#
71*b6fb3261SAndroid Build Coastguard Worker#     rbe_win_py37: Windows Python 3.7 RBE config
72*b6fb3261SAndroid Build Coastguard Worker#     rbe_win_py38: Windows Python 3.8 RBE config
73*b6fb3261SAndroid Build Coastguard Worker#     rbe_win_py39: Windows Python 3.9 RBE config
74*b6fb3261SAndroid Build Coastguard Worker#     rbe_win_py310: Windows Python 3.10 RBE config
75*b6fb3261SAndroid Build Coastguard Worker#
76*b6fb3261SAndroid Build Coastguard Worker#     tensorflow_testing_rbe_linux: RBE options to use RBE with tensorflow-testing project on linux
77*b6fb3261SAndroid Build Coastguard Worker#     tensorflow_testing_rbe_win:   RBE options to use RBE with tensorflow-testing project on windows
78*b6fb3261SAndroid Build Coastguard Worker#
79*b6fb3261SAndroid Build Coastguard Worker#     rbe_lite_linux: RBE options to build TF Lite.
80*b6fb3261SAndroid Build Coastguard Worker#
81*b6fb3261SAndroid Build Coastguard Worker# Embedded Linux options (experimental and only tested with TFLite build yet)
82*b6fb3261SAndroid Build Coastguard Worker#     elinux:          General Embedded Linux options shared by all flavors.
83*b6fb3261SAndroid Build Coastguard Worker#     elinux_aarch64:  Embedded Linux options for aarch64 (ARM64) CPU support.
84*b6fb3261SAndroid Build Coastguard Worker#     elinux_armhf:    Embedded Linux options for armhf (ARMv7) CPU support.
85*b6fb3261SAndroid Build Coastguard Worker#
86*b6fb3261SAndroid Build Coastguard Worker# Release build options (for all operating systems)
87*b6fb3261SAndroid Build Coastguard Worker#     release_base:                    Common options for all builds on all operating systems.
88*b6fb3261SAndroid Build Coastguard Worker#     release_gpu_base:                Common options for GPU builds on Linux and Windows.
89*b6fb3261SAndroid Build Coastguard Worker#     release_cpu_linux:               Toolchain and CUDA options for Linux CPU builds.
90*b6fb3261SAndroid Build Coastguard Worker#     release_cpu_macos:               Toolchain and CUDA options for MacOS CPU builds.
91*b6fb3261SAndroid Build Coastguard Worker#     release_gpu_linux:               Toolchain and CUDA options for Linux GPU builds.
92*b6fb3261SAndroid Build Coastguard Worker#     release_cpu_windows:             Toolchain and CUDA options for Windows CPU builds.
93*b6fb3261SAndroid Build Coastguard Worker#     release_gpu_windows:             Toolchain and CUDA options for Windows GPU builds.
94*b6fb3261SAndroid Build Coastguard Worker
95*b6fb3261SAndroid Build Coastguard Worker# Default build options. These are applied first and unconditionally.
96*b6fb3261SAndroid Build Coastguard Worker
97*b6fb3261SAndroid Build Coastguard Worker# For projects which use TensorFlow as part of a Bazel build process, putting
98*b6fb3261SAndroid Build Coastguard Worker# nothing in a bazelrc will default to a monolithic build. The following line
99*b6fb3261SAndroid Build Coastguard Worker# opts in to modular op registration support by default.
100*b6fb3261SAndroid Build Coastguard Workerbuild --define framework_shared_object=true
101*b6fb3261SAndroid Build Coastguard Worker
102*b6fb3261SAndroid Build Coastguard Workerbuild --define=use_fast_cpp_protos=true
103*b6fb3261SAndroid Build Coastguard Workerbuild --define=allow_oversize_protos=true
104*b6fb3261SAndroid Build Coastguard Worker
105*b6fb3261SAndroid Build Coastguard Workerbuild --spawn_strategy=standalone
106*b6fb3261SAndroid Build Coastguard Workerbuild -c opt
107*b6fb3261SAndroid Build Coastguard Worker
108*b6fb3261SAndroid Build Coastguard Worker# Make Bazel print out all options from rc files.
109*b6fb3261SAndroid Build Coastguard Workerbuild --announce_rc
110*b6fb3261SAndroid Build Coastguard Worker
111*b6fb3261SAndroid Build Coastguard Worker# TODO(mihaimaruseac): Document this option or remove if no longer needed
112*b6fb3261SAndroid Build Coastguard Workerbuild --define=grpc_no_ares=true
113*b6fb3261SAndroid Build Coastguard Worker
114*b6fb3261SAndroid Build Coastguard Worker# See https://github.com/bazelbuild/bazel/issues/7362 for information on what
115*b6fb3261SAndroid Build Coastguard Worker# --incompatible_remove_legacy_whole_archive flag does.
116*b6fb3261SAndroid Build Coastguard Worker# This flag is set to true in Bazel 1.0 and newer versions. We tried to migrate
117*b6fb3261SAndroid Build Coastguard Worker# Tensorflow to the default, however test coverage wasn't enough to catch the
118*b6fb3261SAndroid Build Coastguard Worker# errors.
119*b6fb3261SAndroid Build Coastguard Worker# There is ongoing work on Bazel team's side to provide support for transitive
120*b6fb3261SAndroid Build Coastguard Worker# shared libraries. As part of migrating to transitive shared libraries, we
121*b6fb3261SAndroid Build Coastguard Worker# hope to provide a better mechanism for control over symbol exporting, and
122*b6fb3261SAndroid Build Coastguard Worker# then tackle this issue again.
123*b6fb3261SAndroid Build Coastguard Worker#
124*b6fb3261SAndroid Build Coastguard Worker# TODO: Remove this line once TF doesn't depend on Bazel wrapping all library
125*b6fb3261SAndroid Build Coastguard Worker# archives in -whole_archive -no_whole_archive.
126*b6fb3261SAndroid Build Coastguard Workerbuild --noincompatible_remove_legacy_whole_archive
127*b6fb3261SAndroid Build Coastguard Worker
128*b6fb3261SAndroid Build Coastguard Worker# TODO(mihaimaruseac): Document this option or remove if no longer needed
129*b6fb3261SAndroid Build Coastguard Workerbuild --enable_platform_specific_config
130*b6fb3261SAndroid Build Coastguard Worker
131*b6fb3261SAndroid Build Coastguard Worker# Enable XLA support by default.
132*b6fb3261SAndroid Build Coastguard Workerbuild --define=with_xla_support=true
133*b6fb3261SAndroid Build Coastguard Worker
134*b6fb3261SAndroid Build Coastguard Worker# TODO(mihaimaruseac): Document this option or remove if no longer needed
135*b6fb3261SAndroid Build Coastguard Workerbuild --config=short_logs
136*b6fb3261SAndroid Build Coastguard Worker
137*b6fb3261SAndroid Build Coastguard Worker# TODO(mihaimaruseac): Document this option or remove if no longer needed
138*b6fb3261SAndroid Build Coastguard Workerbuild --config=v2
139*b6fb3261SAndroid Build Coastguard Worker
140*b6fb3261SAndroid Build Coastguard Worker# Disable AWS/HDFS support by default
141*b6fb3261SAndroid Build Coastguard Workerbuild --define=no_aws_support=true
142*b6fb3261SAndroid Build Coastguard Workerbuild --define=no_hdfs_support=true
143*b6fb3261SAndroid Build Coastguard Worker
144*b6fb3261SAndroid Build Coastguard Worker# TF now has `cc_shared_library` targets, so it needs the experimental flag
145*b6fb3261SAndroid Build Coastguard Worker# TODO(rostam): Remove when `cc_shared_library` is enabled by default
146*b6fb3261SAndroid Build Coastguard Workerbuild --experimental_cc_shared_library
147*b6fb3261SAndroid Build Coastguard Worker
148*b6fb3261SAndroid Build Coastguard Worker# cc_shared_library ensures no library is linked statically more than once.
149*b6fb3261SAndroid Build Coastguard Workerbuild --experimental_link_static_libraries_once=false
150*b6fb3261SAndroid Build Coastguard Worker
151*b6fb3261SAndroid Build Coastguard Worker# Default options should come above this line.
152*b6fb3261SAndroid Build Coastguard Worker
153*b6fb3261SAndroid Build Coastguard Worker# Allow builds using libc++ as a linker library
154*b6fb3261SAndroid Build Coastguard Worker# This is mostly for OSSFuzz, so we also pass in the flags from environment to clean build file
155*b6fb3261SAndroid Build Coastguard Workerbuild:libc++ --action_env=CC
156*b6fb3261SAndroid Build Coastguard Workerbuild:libc++ --action_env=CXX
157*b6fb3261SAndroid Build Coastguard Workerbuild:libc++ --action_env=CXXFLAGS=-stdlib=libc++
158*b6fb3261SAndroid Build Coastguard Workerbuild:libc++ --action_env=PATH
159*b6fb3261SAndroid Build Coastguard Workerbuild:libc++ --define force_libcpp=enabled
160*b6fb3261SAndroid Build Coastguard Workerbuild:libc++ --linkopt -fuse-ld=lld
161*b6fb3261SAndroid Build Coastguard Worker
162*b6fb3261SAndroid Build Coastguard Worker# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the
163*b6fb3261SAndroid Build Coastguard Worker# target CPU to build transient dependencies correctly. See
164*b6fb3261SAndroid Build Coastguard Worker# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu
165*b6fb3261SAndroid Build Coastguard Workerbuild:android --crosstool_top=//external:android/crosstool
166*b6fb3261SAndroid Build Coastguard Workerbuild:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
167*b6fb3261SAndroid Build Coastguard Workerbuild:android_arm --config=android
168*b6fb3261SAndroid Build Coastguard Workerbuild:android_arm --cpu=armeabi-v7a
169*b6fb3261SAndroid Build Coastguard Workerbuild:android_arm --fat_apk_cpu=armeabi-v7a
170*b6fb3261SAndroid Build Coastguard Workerbuild:android_arm64 --config=android
171*b6fb3261SAndroid Build Coastguard Workerbuild:android_arm64 --cpu=arm64-v8a
172*b6fb3261SAndroid Build Coastguard Workerbuild:android_arm64 --fat_apk_cpu=arm64-v8a
173*b6fb3261SAndroid Build Coastguard Workerbuild:android_x86 --config=android
174*b6fb3261SAndroid Build Coastguard Workerbuild:android_x86 --cpu=x86
175*b6fb3261SAndroid Build Coastguard Workerbuild:android_x86 --fat_apk_cpu=x86
176*b6fb3261SAndroid Build Coastguard Workerbuild:android_x86_64 --config=android
177*b6fb3261SAndroid Build Coastguard Workerbuild:android_x86_64 --cpu=x86_64
178*b6fb3261SAndroid Build Coastguard Workerbuild:android_x86_64 --fat_apk_cpu=x86_64
179*b6fb3261SAndroid Build Coastguard Worker
180*b6fb3261SAndroid Build Coastguard Worker# Sets the default Apple platform to macOS.
181*b6fb3261SAndroid Build Coastguard Workerbuild:macos --apple_platform_type=macos
182*b6fb3261SAndroid Build Coastguard Worker
183*b6fb3261SAndroid Build Coastguard Worker# gRPC on MacOS requires this #define
184*b6fb3261SAndroid Build Coastguard Workerbuild:macos --copt=-DGRPC_BAZEL_BUILD
185*b6fb3261SAndroid Build Coastguard Worker
186*b6fb3261SAndroid Build Coastguard Worker# Settings for MacOS on ARM CPUs.
187*b6fb3261SAndroid Build Coastguard Workerbuild:macos_arm64 --cpu=darwin_arm64
188*b6fb3261SAndroid Build Coastguard Workerbuild:macos_arm64 --macos_minimum_os=11.0
189*b6fb3261SAndroid Build Coastguard Worker
190*b6fb3261SAndroid Build Coastguard Worker# iOS configs for each architecture and the fat binary builds.
191*b6fb3261SAndroid Build Coastguard Workerbuild:ios --apple_platform_type=ios
192*b6fb3261SAndroid Build Coastguard Workerbuild:ios --apple_bitcode=embedded --copt=-fembed-bitcode
193*b6fb3261SAndroid Build Coastguard Workerbuild:ios --copt=-Wno-c++11-narrowing
194*b6fb3261SAndroid Build Coastguard Workerbuild:ios_armv7 --config=ios
195*b6fb3261SAndroid Build Coastguard Workerbuild:ios_armv7 --cpu=ios_armv7
196*b6fb3261SAndroid Build Coastguard Workerbuild:ios_arm64 --config=ios
197*b6fb3261SAndroid Build Coastguard Workerbuild:ios_arm64 --cpu=ios_arm64
198*b6fb3261SAndroid Build Coastguard Workerbuild:ios_sim_arm64 --config=ios
199*b6fb3261SAndroid Build Coastguard Workerbuild:ios_sim_arm64 --cpu=ios_sim_arm64
200*b6fb3261SAndroid Build Coastguard Workerbuild:ios_i386 --config=ios
201*b6fb3261SAndroid Build Coastguard Workerbuild:ios_i386 --cpu=ios_i386
202*b6fb3261SAndroid Build Coastguard Workerbuild:ios_x86_64 --config=ios
203*b6fb3261SAndroid Build Coastguard Workerbuild:ios_x86_64 --cpu=ios_x86_64
204*b6fb3261SAndroid Build Coastguard Workerbuild:ios_fat --config=ios
205*b6fb3261SAndroid Build Coastguard Workerbuild:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64
206*b6fb3261SAndroid Build Coastguard Worker
207*b6fb3261SAndroid Build Coastguard Worker# Config to use a mostly-static build and disable modular op registration
208*b6fb3261SAndroid Build Coastguard Worker# support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python).
209*b6fb3261SAndroid Build Coastguard Worker# By default, TensorFlow will build with a dependence on
210*b6fb3261SAndroid Build Coastguard Worker# //tensorflow:libtensorflow_framework.so.
211*b6fb3261SAndroid Build Coastguard Workerbuild:monolithic --define framework_shared_object=false
212*b6fb3261SAndroid Build Coastguard Workerbuild:monolithic --experimental_link_static_libraries_once=false  # b/229868128
213*b6fb3261SAndroid Build Coastguard Worker
214*b6fb3261SAndroid Build Coastguard Worker# Please note that MKL on MacOS or windows is still not supported.
215*b6fb3261SAndroid Build Coastguard Worker# If you would like to use a local MKL instead of downloading, please set the
216*b6fb3261SAndroid Build Coastguard Worker# environment variable "TF_MKL_ROOT" every time before build.
217*b6fb3261SAndroid Build Coastguard Workerbuild:mkl --define=build_with_mkl=true --define=enable_mkl=true
218*b6fb3261SAndroid Build Coastguard Workerbuild:mkl --define=tensorflow_mkldnn_contraction_kernel=0
219*b6fb3261SAndroid Build Coastguard Workerbuild:mkl --define=build_with_openmp=true
220*b6fb3261SAndroid Build Coastguard Workerbuild:mkl -c opt
221*b6fb3261SAndroid Build Coastguard Worker
222*b6fb3261SAndroid Build Coastguard Worker# config to build OneDNN backend with a user specified threadpool.
223*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_threadpool --define=build_with_mkl=true --define=enable_mkl=true
224*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_threadpool --define=tensorflow_mkldnn_contraction_kernel=0
225*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_threadpool --define=build_with_mkl_opensource=true
226*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_threadpool -c opt
227*b6fb3261SAndroid Build Coastguard Worker
228*b6fb3261SAndroid Build Coastguard Worker# Config setting to build oneDNN with Compute Library for the Arm Architecture (ACL).
229*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_aarch64 --define=build_with_mkl_aarch64=true
230*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_aarch64 --define=build_with_openmp=true
231*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_aarch64 --define=build_with_acl=true
232*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_aarch64 -c opt
233*b6fb3261SAndroid Build Coastguard Worker
234*b6fb3261SAndroid Build Coastguard Worker# Config setting to build oneDNN with Compute Library for the Arm Architecture (ACL).
235*b6fb3261SAndroid Build Coastguard Worker# with Eigen threadpool support
236*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_aarch64_threadpool --define=build_with_mkl_aarch64=true
237*b6fb3261SAndroid Build Coastguard Workerbuild:mkl_aarch64_threadpool -c opt
238*b6fb3261SAndroid Build Coastguard Worker
239*b6fb3261SAndroid Build Coastguard Worker# This config refers to building CUDA op kernels with nvcc.
240*b6fb3261SAndroid Build Coastguard Workerbuild:cuda --repo_env TF_NEED_CUDA=1
241*b6fb3261SAndroid Build Coastguard Workerbuild:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
242*b6fb3261SAndroid Build Coastguard Workerbuild:cuda --@local_config_cuda//:enable_cuda
243*b6fb3261SAndroid Build Coastguard Worker
244*b6fb3261SAndroid Build Coastguard Worker# This config refers to building CUDA op kernels with clang.
245*b6fb3261SAndroid Build Coastguard Workerbuild:cuda_clang --config=cuda
246*b6fb3261SAndroid Build Coastguard Workerbuild:cuda_clang --repo_env TF_CUDA_CLANG=1
247*b6fb3261SAndroid Build Coastguard Workerbuild:cuda_clang --@local_config_cuda//:cuda_compiler=clang
248*b6fb3261SAndroid Build Coastguard Worker
249*b6fb3261SAndroid Build Coastguard Worker# Debug config
250*b6fb3261SAndroid Build Coastguard Workerbuild:dbg -c dbg
251*b6fb3261SAndroid Build Coastguard Worker# Only include debug info for files under tensorflow/, excluding kernels, to
252*b6fb3261SAndroid Build Coastguard Worker# reduce the size of the debug info in the binary. This is because if the debug
253*b6fb3261SAndroid Build Coastguard Worker# sections in the ELF binary are too large, errors can occur. See
254*b6fb3261SAndroid Build Coastguard Worker# https://github.com/tensorflow/tensorflow/issues/48919.
255*b6fb3261SAndroid Build Coastguard Worker# Users can still include debug info for a specific kernel, e.g. with:
256*b6fb3261SAndroid Build Coastguard Worker#     --config=dbg --per_file_copt=+tensorflow/core/kernels/identity_op.*@-g
257*b6fb3261SAndroid Build Coastguard Workerbuild:dbg --per_file_copt=+.*,-tensorflow.*@-g0
258*b6fb3261SAndroid Build Coastguard Workerbuild:dbg --per_file_copt=+tensorflow/core/kernels.*@-g0
259*b6fb3261SAndroid Build Coastguard Worker# for now, disable arm_neon. see: https://github.com/tensorflow/tensorflow/issues/33360
260*b6fb3261SAndroid Build Coastguard Workerbuild:dbg --cxxopt -DTF_LITE_DISABLE_X86_NEON
261*b6fb3261SAndroid Build Coastguard Worker# AWS SDK must be compiled in release mode. see: https://github.com/tensorflow/tensorflow/issues/37498
262*b6fb3261SAndroid Build Coastguard Workerbuild:dbg --copt -DDEBUG_BUILD
263*b6fb3261SAndroid Build Coastguard Worker
264*b6fb3261SAndroid Build Coastguard Worker# Config to build TPU backend
265*b6fb3261SAndroid Build Coastguard Workerbuild:tpu --define=with_tpu_support=true
266*b6fb3261SAndroid Build Coastguard Worker
267*b6fb3261SAndroid Build Coastguard Workerbuild:tensorrt --repo_env TF_NEED_TENSORRT=1
268*b6fb3261SAndroid Build Coastguard Worker
269*b6fb3261SAndroid Build Coastguard Workerbuild:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain
270*b6fb3261SAndroid Build Coastguard Workerbuild:rocm --define=using_rocm_hipcc=true
271*b6fb3261SAndroid Build Coastguard Workerbuild:rocm --define=tensorflow_mkldnn_contraction_kernel=0
272*b6fb3261SAndroid Build Coastguard Workerbuild:rocm --repo_env TF_NEED_ROCM=1
273*b6fb3261SAndroid Build Coastguard Workerbuild:rocm --experimental_link_static_libraries_once=false  # b/230048163
274*b6fb3261SAndroid Build Coastguard Worker
275*b6fb3261SAndroid Build Coastguard Worker# Options extracted from configure script
276*b6fb3261SAndroid Build Coastguard Workerbuild:numa --define=with_numa_support=true
277*b6fb3261SAndroid Build Coastguard Worker
278*b6fb3261SAndroid Build Coastguard Worker# Options to disable default on features
279*b6fb3261SAndroid Build Coastguard Workerbuild:noaws --define=no_aws_support=true
280*b6fb3261SAndroid Build Coastguard Workerbuild:nogcp --define=no_gcp_support=true
281*b6fb3261SAndroid Build Coastguard Workerbuild:nohdfs --define=no_hdfs_support=true
282*b6fb3261SAndroid Build Coastguard Workerbuild:nonccl --define=no_nccl_support=true
283*b6fb3261SAndroid Build Coastguard Worker
284*b6fb3261SAndroid Build Coastguard Workerbuild:stackdriver_support --define=stackdriver_support=true
285*b6fb3261SAndroid Build Coastguard Worker
286*b6fb3261SAndroid Build Coastguard Worker# Modular TF build options
287*b6fb3261SAndroid Build Coastguard Workerbuild:dynamic_kernels --define=dynamic_loaded_kernels=true
288*b6fb3261SAndroid Build Coastguard Workerbuild:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS
289*b6fb3261SAndroid Build Coastguard Worker
290*b6fb3261SAndroid Build Coastguard Worker# Don't trigger --config=<host platform> when cross-compiling.
291*b6fb3261SAndroid Build Coastguard Workerbuild:android --noenable_platform_specific_config
292*b6fb3261SAndroid Build Coastguard Workerbuild:ios --noenable_platform_specific_config
293*b6fb3261SAndroid Build Coastguard Worker
294*b6fb3261SAndroid Build Coastguard Worker# Suppress C++ compiler warnings, otherwise build logs become 10s of MBs.
295*b6fb3261SAndroid Build Coastguard Workerbuild:android --copt=-w
296*b6fb3261SAndroid Build Coastguard Workerbuild:ios --copt=-w
297*b6fb3261SAndroid Build Coastguard Workerbuild:linux --copt=-w
298*b6fb3261SAndroid Build Coastguard Workerbuild:linux --host_copt=-w
299*b6fb3261SAndroid Build Coastguard Workerbuild:macos --copt=-w
300*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=/W0
301*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=/W0
302*b6fb3261SAndroid Build Coastguard Worker
303*b6fb3261SAndroid Build Coastguard Worker
304*b6fb3261SAndroid Build Coastguard Worker# On Windows, `__cplusplus` is wrongly defined without this switch
305*b6fb3261SAndroid Build Coastguard Worker# See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
306*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=/Zc:__cplusplus
307*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=/Zc:__cplusplus
308*b6fb3261SAndroid Build Coastguard Worker
309*b6fb3261SAndroid Build Coastguard Worker# Tensorflow uses M_* math constants that only get defined by MSVC headers if
310*b6fb3261SAndroid Build Coastguard Worker# _USE_MATH_DEFINES is defined.
311*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=/D_USE_MATH_DEFINES
312*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=/D_USE_MATH_DEFINES
313*b6fb3261SAndroid Build Coastguard Worker
314*b6fb3261SAndroid Build Coastguard Worker# Windows has a relatively short command line limit, which TF has begun to hit.
315*b6fb3261SAndroid Build Coastguard Worker# See https://docs.bazel.build/versions/main/windows.html
316*b6fb3261SAndroid Build Coastguard Workerbuild:windows --features=compiler_param_file
317*b6fb3261SAndroid Build Coastguard Worker
318*b6fb3261SAndroid Build Coastguard Worker# Speed Windows compile times. Available in VS 16.4 (we are on 16.11). See
319*b6fb3261SAndroid Build Coastguard Worker# https://groups.google.com/a/tensorflow.org/d/topic/build/SsW98Eo7l3o/discussion
320*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=/d2ReducedOptimizeHugeFunctions
321*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=/d2ReducedOptimizeHugeFunctions
322*b6fb3261SAndroid Build Coastguard Worker
323*b6fb3261SAndroid Build Coastguard Worker# Default paths for TF_SYSTEM_LIBS
324*b6fb3261SAndroid Build Coastguard Workerbuild:linux --define=PREFIX=/usr
325*b6fb3261SAndroid Build Coastguard Workerbuild:linux --define=LIBDIR=$(PREFIX)/lib
326*b6fb3261SAndroid Build Coastguard Workerbuild:linux --define=INCLUDEDIR=$(PREFIX)/include
327*b6fb3261SAndroid Build Coastguard Workerbuild:linux --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include
328*b6fb3261SAndroid Build Coastguard Workerbuild:macos --define=PREFIX=/usr
329*b6fb3261SAndroid Build Coastguard Workerbuild:macos --define=LIBDIR=$(PREFIX)/lib
330*b6fb3261SAndroid Build Coastguard Workerbuild:macos --define=INCLUDEDIR=$(PREFIX)/include
331*b6fb3261SAndroid Build Coastguard Workerbuild:macos --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include
332*b6fb3261SAndroid Build Coastguard Worker# TF_SYSTEM_LIBS do not work on windows.
333*b6fb3261SAndroid Build Coastguard Worker
334*b6fb3261SAndroid Build Coastguard Worker# By default, build TF in C++ 17 mode.
335*b6fb3261SAndroid Build Coastguard Workerbuild:android --cxxopt=-std=c++17
336*b6fb3261SAndroid Build Coastguard Workerbuild:android --host_cxxopt=-std=c++17
337*b6fb3261SAndroid Build Coastguard Workerbuild:ios --cxxopt=-std=c++17
338*b6fb3261SAndroid Build Coastguard Workerbuild:ios --host_cxxopt=-std=c++17
339*b6fb3261SAndroid Build Coastguard Workerbuild:linux --cxxopt=-std=c++17
340*b6fb3261SAndroid Build Coastguard Workerbuild:linux --host_cxxopt=-std=c++17
341*b6fb3261SAndroid Build Coastguard Workerbuild:macos --cxxopt=-std=c++17
342*b6fb3261SAndroid Build Coastguard Workerbuild:macos --host_cxxopt=-std=c++17
343*b6fb3261SAndroid Build Coastguard Workerbuild:windows --cxxopt=/std:c++17
344*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_cxxopt=/std:c++17
345*b6fb3261SAndroid Build Coastguard Worker
346*b6fb3261SAndroid Build Coastguard Worker# On windows, we still link everything into a single DLL.
347*b6fb3261SAndroid Build Coastguard Workerbuild:windows --config=monolithic
348*b6fb3261SAndroid Build Coastguard Worker
349*b6fb3261SAndroid Build Coastguard Worker# On linux, we dynamically link small amount of kernels
350*b6fb3261SAndroid Build Coastguard Workerbuild:linux --config=dynamic_kernels
351*b6fb3261SAndroid Build Coastguard Worker
352*b6fb3261SAndroid Build Coastguard Worker# Make sure to include as little of windows.h as possible
353*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=-DWIN32_LEAN_AND_MEAN
354*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=-DWIN32_LEAN_AND_MEAN
355*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=-DNOGDI
356*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=-DNOGDI
357*b6fb3261SAndroid Build Coastguard Worker
358*b6fb3261SAndroid Build Coastguard Worker# MSVC (Windows): Standards-conformant preprocessor mode
359*b6fb3261SAndroid Build Coastguard Worker# See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
360*b6fb3261SAndroid Build Coastguard Workerbuild:windows --copt=/experimental:preprocessor
361*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_copt=/experimental:preprocessor
362*b6fb3261SAndroid Build Coastguard Worker
363*b6fb3261SAndroid Build Coastguard Worker# Misc build options we need for windows.
364*b6fb3261SAndroid Build Coastguard Workerbuild:windows --linkopt=/DEBUG
365*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_linkopt=/DEBUG
366*b6fb3261SAndroid Build Coastguard Workerbuild:windows --linkopt=/OPT:REF
367*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_linkopt=/OPT:REF
368*b6fb3261SAndroid Build Coastguard Workerbuild:windows --linkopt=/OPT:ICF
369*b6fb3261SAndroid Build Coastguard Workerbuild:windows --host_linkopt=/OPT:ICF
370*b6fb3261SAndroid Build Coastguard Worker
371*b6fb3261SAndroid Build Coastguard Worker# Verbose failure logs when something goes wrong
372*b6fb3261SAndroid Build Coastguard Workerbuild:windows --verbose_failures
373*b6fb3261SAndroid Build Coastguard Worker
374*b6fb3261SAndroid Build Coastguard Worker# Work around potential issues with large command lines on windows.
375*b6fb3261SAndroid Build Coastguard Worker# See: https://github.com/bazelbuild/bazel/issues/5163
376*b6fb3261SAndroid Build Coastguard Workerbuild:windows --features=compiler_param_file
377*b6fb3261SAndroid Build Coastguard Worker
378*b6fb3261SAndroid Build Coastguard Worker# On windows, we never cross compile
379*b6fb3261SAndroid Build Coastguard Workerbuild:windows --distinct_host_configuration=false
380*b6fb3261SAndroid Build Coastguard Worker# On linux, don't cross compile by default
381*b6fb3261SAndroid Build Coastguard Workerbuild:linux --distinct_host_configuration=false
382*b6fb3261SAndroid Build Coastguard Worker
383*b6fb3261SAndroid Build Coastguard Worker# Do not risk cache corruption. See:
384*b6fb3261SAndroid Build Coastguard Worker# https://github.com/bazelbuild/bazel/issues/3360
385*b6fb3261SAndroid Build Coastguard Workerbuild:linux --experimental_guard_against_concurrent_changes
386*b6fb3261SAndroid Build Coastguard Worker
387*b6fb3261SAndroid Build Coastguard Worker# Configure short or long logs
388*b6fb3261SAndroid Build Coastguard Workerbuild:short_logs --output_filter=DONT_MATCH_ANYTHING
389*b6fb3261SAndroid Build Coastguard Workerbuild:verbose_logs --output_filter=
390*b6fb3261SAndroid Build Coastguard Worker
391*b6fb3261SAndroid Build Coastguard Worker# Instruction set optimizations
392*b6fb3261SAndroid Build Coastguard Worker# TODO(gunan): Create a feature in toolchains for avx/avx2 to
393*b6fb3261SAndroid Build Coastguard Worker#   avoid having to define linux/win separately.
394*b6fb3261SAndroid Build Coastguard Workerbuild:avx_linux --copt=-mavx
395*b6fb3261SAndroid Build Coastguard Workerbuild:avx_linux --host_copt=-mavx
396*b6fb3261SAndroid Build Coastguard Workerbuild:avx2_linux --copt=-mavx2
397*b6fb3261SAndroid Build Coastguard Workerbuild:native_arch_linux --copt=-march=native
398*b6fb3261SAndroid Build Coastguard Workerbuild:avx_win --copt=/arch=AVX
399*b6fb3261SAndroid Build Coastguard Workerbuild:avx2_win --copt=/arch=AVX2
400*b6fb3261SAndroid Build Coastguard Worker
401*b6fb3261SAndroid Build Coastguard Worker# Options to build TensorFlow 1.x or 2.x.
402*b6fb3261SAndroid Build Coastguard Workerbuild:v1 --define=tf_api_version=1 --action_env=TF2_BEHAVIOR=0
403*b6fb3261SAndroid Build Coastguard Workerbuild:v2 --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
404*b6fb3261SAndroid Build Coastguard Worker
405*b6fb3261SAndroid Build Coastguard Worker# Disable XLA on mobile.
406*b6fb3261SAndroid Build Coastguard Workerbuild:xla     --define=with_xla_support=true # TODO: remove, it's on by default.
407*b6fb3261SAndroid Build Coastguard Workerbuild:android --define=with_xla_support=false
408*b6fb3261SAndroid Build Coastguard Workerbuild:ios     --define=with_xla_support=false
409*b6fb3261SAndroid Build Coastguard Worker
410*b6fb3261SAndroid Build Coastguard Worker# BEGIN TF REMOTE BUILD EXECUTION OPTIONS
411*b6fb3261SAndroid Build Coastguard Worker# Options when using remote execution
412*b6fb3261SAndroid Build Coastguard Worker# WARNING: THESE OPTIONS WONT WORK IF YOU DO NOT HAVE PROPER AUTHENTICATION AND PERMISSIONS
413*b6fb3261SAndroid Build Coastguard Worker
414*b6fb3261SAndroid Build Coastguard Worker# Flag to enable remote config
415*b6fb3261SAndroid Build Coastguard Workercommon --experimental_repo_remote_exec
416*b6fb3261SAndroid Build Coastguard Worker
417*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
418*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --google_default_credentials
419*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --bes_backend=buildeventservice.googleapis.com
420*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --bes_results_url="https://source.cloud.google.com/results/invocations"
421*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --bes_timeout=600s
422*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --define=EXECUTOR=remote
423*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --distinct_host_configuration=false
424*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --flaky_test_attempts=3
425*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --jobs=800
426*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --remote_executor=grpcs://remotebuildexecution.googleapis.com
427*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --remote_timeout=3600
428*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --spawn_strategy=remote,worker,standalone,local
429*b6fb3261SAndroid Build Coastguard Workertest:rbe --test_env=USER=anon
430*b6fb3261SAndroid Build Coastguard Worker# Attempt to minimize the amount of data transfer between bazel and the remote
431*b6fb3261SAndroid Build Coastguard Worker# workers:
432*b6fb3261SAndroid Build Coastguard Workerbuild:rbe --remote_download_toplevel
433*b6fb3261SAndroid Build Coastguard Worker
434*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_base --config=rbe
435*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_base --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"
436*b6fb3261SAndroid Build Coastguard Worker
437*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux --config=rbe_linux_base
438*b6fb3261SAndroid Build Coastguard Worker# Non-rbe settings we should include because we do not run configure
439*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux --config=avx_linux
440*b6fb3261SAndroid Build Coastguard Worker# TODO(gunan): Check why we need this specified in rbe, but not in other builds.
441*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux --linkopt=-lrt
442*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux --host_linkopt=-lrt
443*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux --linkopt=-lm
444*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux --host_linkopt=-lm
445*b6fb3261SAndroid Build Coastguard Worker
446*b6fb3261SAndroid Build Coastguard Worker# Use the GPU toolchain until the CPU one is ready.
447*b6fb3261SAndroid Build Coastguard Worker# https://github.com/bazelbuild/bazel/issues/13623
448*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux_base --host_crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
449*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux_base --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
450*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux_base --extra_toolchains="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64"
451*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux_base --extra_execution_platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
452*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux_base --host_platform="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
453*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux_base --platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
454*b6fb3261SAndroid Build Coastguard Worker
455*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux --config=rbe_linux
456*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_cpu_linux --config=rbe_cpu_linux_base
457*b6fb3261SAndroid Build Coastguard Worker
458*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_lite_linux --config=rbe_linux_base
459*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_lite_linux --config=rbe_cpu_linux_base
460*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_lite_linux --config=rbe_linux_py3_base
461*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_lite_linux --noexperimental_check_desugar_deps
462*b6fb3261SAndroid Build Coastguard Worker
463*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_base --config=rbe_linux
464*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_base --config=cuda
465*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_base --config=tensorrt
466*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_base --action_env=TF_CUDA_VERSION=11
467*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_base --action_env=TF_CUDNN_VERSION=8
468*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_base --repo_env=REMOTE_GPU_TESTING=1
469*b6fb3261SAndroid Build Coastguard Worker# TensorRT 7 for CUDA 11.1 is compatible with CUDA 11.2, but requires
470*b6fb3261SAndroid Build Coastguard Worker# libnvrtc.so.11.1. See https://github.com/NVIDIA/TensorRT/issues/1064.
471*b6fb3261SAndroid Build Coastguard Worker# TODO(b/187962120): Remove when upgrading to TensorRT 8.
472*b6fb3261SAndroid Build Coastguard Workertest:rbe_linux_cuda_base --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.1/lib64"
473*b6fb3261SAndroid Build Coastguard Worker
474*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --config=rbe_linux_cuda_base
475*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --host_crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
476*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
477*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --extra_toolchains="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64"
478*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --extra_execution_platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
479*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --host_platform="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
480*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
481*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda"
482*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_tensorrt"
483*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_nccl"
484*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_py3.7 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.7"
485*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_py3.8 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.8"
486*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_py3.9 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9"
487*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda11.2_nvcc_py3.10 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.10"
488*b6fb3261SAndroid Build Coastguard Worker
489*b6fb3261SAndroid Build Coastguard Worker# Map default to CUDA 11.2.
490*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_nvcc_py37 --config=rbe_linux_cuda11.2_nvcc_py3.7
491*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_nvcc_py38 --config=rbe_linux_cuda11.2_nvcc_py3.8
492*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_nvcc_py39 --config=rbe_linux_cuda11.2_nvcc_py3.9
493*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_nvcc_py310 --config=rbe_linux_cuda11.2_nvcc_py3.10
494*b6fb3261SAndroid Build Coastguard Worker
495*b6fb3261SAndroid Build Coastguard Worker# Deprecated configs that people might still use.
496*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_nvcc --config=rbe_linux_cuda_nvcc_py39
497*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_gpu_linux       --config=rbe_linux_cuda_nvcc
498*b6fb3261SAndroid Build Coastguard Worker
499*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --config=rbe_linux_cuda_base
500*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --repo_env TF_CUDA_CLANG=1
501*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --@local_config_cuda//:cuda_compiler=clang
502*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --crosstool_top="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
503*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --extra_toolchains="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64"
504*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --extra_execution_platforms="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
505*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --host_platform="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
506*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --platforms="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform"
507*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda"
508*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_tensorrt"
509*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_nccl"
510*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_py37 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.7"
511*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_py38 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.8"
512*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_py39 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9"
513*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_cuda_clang_py310 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.10"
514*b6fb3261SAndroid Build Coastguard Worker
515*b6fb3261SAndroid Build Coastguard Worker# ROCm
516*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --config=rocm
517*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --config=rbe_linux
518*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-rocm_config_rocm//crosstool:toolchain"
519*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --extra_toolchains="@ubuntu20.04-gcc9_manylinux2014-rocm_config_rocm//crosstool:toolchain-linux-x86_64"
520*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --extra_execution_platforms="@ubuntu20.04-gcc9_manylinux2014-rocm_config_platform//:platform"
521*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --host_platform="@ubuntu20.04-gcc9_manylinux2014-rocm_config_platform//:platform"
522*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --platforms="@ubuntu20.04-gcc9_manylinux2014-rocm_config_platform//:platform"
523*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_base --action_env=TF_ROCM_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_rocm"
524*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_py3.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.7"
525*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_py3.8 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.8"
526*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_py3.9 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.9"
527*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_rocm_py3.10 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.10"
528*b6fb3261SAndroid Build Coastguard Worker
529*b6fb3261SAndroid Build Coastguard Worker# Linux CPU
530*b6fb3261SAndroid Build Coastguard Worker
531*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_py3 --config=rbe_linux
532*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_py3 --config=rbe_linux_py3_base
533*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_py3_base --python_path="/usr/local/bin/python3.9"
534*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_linux_py3_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9"
535*b6fb3261SAndroid Build Coastguard Worker
536*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --config=rbe
537*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --crosstool_top="//tensorflow/tools/toolchains/win/tf_win_06152022:toolchain"
538*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --extra_toolchains="//tensorflow/tools/toolchains/win/tf_win_06152022:cc-toolchain-x64_windows"
539*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --extra_execution_platforms="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019"
540*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --host_platform="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019"
541*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --platforms="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019"
542*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe
543*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --experimental_strict_action_env=true
544*b6fb3261SAndroid Build Coastguard Worker
545*b6fb3261SAndroid Build Coastguard Worker# TODO(gunan): Remove once we use MSVC 2019 with latest patches.
546*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --define=override_eigen_strong_inline=true
547*b6fb3261SAndroid Build Coastguard Worker
548*b6fb3261SAndroid Build Coastguard Worker# Don't build the python zip archive in the RBE build.
549*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --remote_download_minimal
550*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --enable_runfiles
551*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win --nobuild_python_zip
552*b6fb3261SAndroid Build Coastguard Worker
553*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py37 --config=rbe
554*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO="@windows_py37_config_python"
555*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py37 --python_path=C:\\Python37\\python.exe
556*b6fb3261SAndroid Build Coastguard Worker
557*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py38 --config=rbe
558*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py38 --repo_env=PYTHON_BIN_PATH=C:\\Python38\\python.exe
559*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py38 --repo_env=PYTHON_LIB_PATH=C:\\Python38\\lib\\site-packages
560*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py38 --repo_env=TF_PYTHON_CONFIG_REPO=//tensorflow/tools/toolchains/win_1803/py38
561*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py38 --python_path=C:\\Python38\\python.exe
562*b6fb3261SAndroid Build Coastguard Worker
563*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py39 --config=rbe
564*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py39 --repo_env=PYTHON_BIN_PATH=C:\\Python39\\python.exe
565*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py39 --repo_env=PYTHON_LIB_PATH=C:\\Python39\\lib\\site-packages
566*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py39 --repo_env=TF_PYTHON_CONFIG_REPO=//tensorflow/tools/toolchains/win_1803/py39
567*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py39 --python_path=C:\\Python39\\python.exe
568*b6fb3261SAndroid Build Coastguard Worker
569*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py310 --config=rbe
570*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py310 --repo_env=PYTHON_BIN_PATH=C:\\Python310\\python.exe
571*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py310 --repo_env=PYTHON_LIB_PATH=C:\\Python310\\lib\\site-packages
572*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py310 --repo_env=TF_PYTHON_CONFIG_REPO=//tensorflow/tools/toolchains/win_1803/py310
573*b6fb3261SAndroid Build Coastguard Workerbuild:rbe_win_py310 --python_path=C:\\Python310\\python.exe
574*b6fb3261SAndroid Build Coastguard Worker
575*b6fb3261SAndroid Build Coastguard Worker# These you may need to change for your own GCP project.
576*b6fb3261SAndroid Build Coastguard Workerbuild:tensorflow_testing_rbe --project_id=tensorflow-testing
577*b6fb3261SAndroid Build Coastguard Workercommon:tensorflow_testing_rbe_linux --remote_instance_name=projects/tensorflow-testing/instances/default_instance
578*b6fb3261SAndroid Build Coastguard Workerbuild:tensorflow_testing_rbe_linux --config=tensorflow_testing_rbe
579*b6fb3261SAndroid Build Coastguard Worker# Build GPU binaries for the RBE test machines (Tesla T4s).
580*b6fb3261SAndroid Build Coastguard Workerbuild:tensorflow_testing_rbe_linux --repo_env=TF_CUDA_COMPUTE_CAPABILITIES=sm_75
581*b6fb3261SAndroid Build Coastguard Worker
582*b6fb3261SAndroid Build Coastguard Workercommon:tensorflow_testing_rbe_win --remote_instance_name=projects/tensorflow-testing/instances/windows
583*b6fb3261SAndroid Build Coastguard Workerbuild:tensorflow_testing_rbe_win --config=tensorflow_testing_rbe
584*b6fb3261SAndroid Build Coastguard Worker
585*b6fb3261SAndroid Build Coastguard Worker# TFLite build configs for generic embedded Linux
586*b6fb3261SAndroid Build Coastguard Workerbuild:elinux --crosstool_top=@local_config_embedded_arm//:toolchain
587*b6fb3261SAndroid Build Coastguard Workerbuild:elinux --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
588*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_aarch64 --config=elinux
589*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_aarch64 --cpu=aarch64
590*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_aarch64 --distinct_host_configuration=true
591*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_armhf --config=elinux
592*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_armhf --cpu=armhf
593*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_armhf --distinct_host_configuration=true
594*b6fb3261SAndroid Build Coastguard Workerbuild:elinux_armhf --copt -mfp16-format=ieee
595*b6fb3261SAndroid Build Coastguard Worker# END TF REMOTE BUILD EXECUTION OPTIONS
596*b6fb3261SAndroid Build Coastguard Worker
597*b6fb3261SAndroid Build Coastguard Worker# Config-specific options should come above this line.
598*b6fb3261SAndroid Build Coastguard Worker
599*b6fb3261SAndroid Build Coastguard Worker# Load rc file written by ./configure.
600*b6fb3261SAndroid Build Coastguard Workertry-import %workspace%/.tf_configure.bazelrc
601*b6fb3261SAndroid Build Coastguard Worker
602*b6fb3261SAndroid Build Coastguard Worker# Load rc file with user-specific options.
603*b6fb3261SAndroid Build Coastguard Workertry-import %workspace%/.bazelrc.user
604*b6fb3261SAndroid Build Coastguard Worker
605*b6fb3261SAndroid Build Coastguard Worker# Here are bazelrc configs for release builds
606*b6fb3261SAndroid Build Coastguard Workerbuild:release_base --config=v2
607*b6fb3261SAndroid Build Coastguard Workerbuild:release_base --distinct_host_configuration=false
608*b6fb3261SAndroid Build Coastguard Workertest:release_base --flaky_test_attempts=3
609*b6fb3261SAndroid Build Coastguard Workertest:release_base --test_size_filters=small,medium
610*b6fb3261SAndroid Build Coastguard Worker
611*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_linux --config=release_base
612*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_linux --config=avx_linux
613*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_linux --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain"
614*b6fb3261SAndroid Build Coastguard Workertest:release_cpu_linux --test_env=LD_LIBRARY_PATH
615*b6fb3261SAndroid Build Coastguard Worker
616*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_macos --config=release_base
617*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_macos --config=avx_linux
618*b6fb3261SAndroid Build Coastguard Worker
619*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_base --config=cuda
620*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_base --action_env=TF_CUDA_VERSION="11"
621*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_base --action_env=TF_CUDNN_VERSION="8"
622*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_base --repo_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"
623*b6fb3261SAndroid Build Coastguard Worker
624*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux --config=release_cpu_linux
625*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux --config=release_gpu_base
626*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux --config=tensorrt
627*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux --action_env=CUDA_TOOLKIT_PATH="/usr/local/cuda-11.2"
628*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.1/lib64:/usr/local/tensorrt/lib"
629*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux --action_env=GCC_HOST_COMPILER_PATH="/dt9/usr/bin/gcc"
630*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_linux [email protected]_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain
631*b6fb3261SAndroid Build Coastguard Worker
632*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_windows --config=release_base
633*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_windows --config=avx_win
634*b6fb3261SAndroid Build Coastguard Workerbuild:release_cpu_windows --define=no_tensorflow_py_deps=true
635*b6fb3261SAndroid Build Coastguard Worker
636*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_windows --config=release_cpu_windows
637*b6fb3261SAndroid Build Coastguard Workerbuild:release_gpu_windows --config=release_gpu_base
638*b6fb3261SAndroid Build Coastguard Worker
639*b6fb3261SAndroid Build Coastguard Worker# Address sanitizer
640*b6fb3261SAndroid Build Coastguard Worker# CC=clang bazel build --config asan
641*b6fb3261SAndroid Build Coastguard Workerbuild:asan --strip=never
642*b6fb3261SAndroid Build Coastguard Workerbuild:asan --copt -fsanitize=address
643*b6fb3261SAndroid Build Coastguard Workerbuild:asan --copt -DADDRESS_SANITIZER
644*b6fb3261SAndroid Build Coastguard Workerbuild:asan --copt -g
645*b6fb3261SAndroid Build Coastguard Workerbuild:asan --copt -O3
646*b6fb3261SAndroid Build Coastguard Workerbuild:asan --copt -fno-omit-frame-pointer
647*b6fb3261SAndroid Build Coastguard Workerbuild:asan --linkopt -fsanitize=address
648*b6fb3261SAndroid Build Coastguard Worker
649*b6fb3261SAndroid Build Coastguard Worker# Memory sanitizer
650*b6fb3261SAndroid Build Coastguard Worker# CC=clang bazel build --config msan
651*b6fb3261SAndroid Build Coastguard Workerbuild:msan --strip=never
652*b6fb3261SAndroid Build Coastguard Workerbuild:msan --copt -fsanitize=memory
653*b6fb3261SAndroid Build Coastguard Workerbuild:msan --copt -DMEMORY_SANITIZER
654*b6fb3261SAndroid Build Coastguard Workerbuild:msan --copt -g
655*b6fb3261SAndroid Build Coastguard Workerbuild:msan --copt -O3
656*b6fb3261SAndroid Build Coastguard Workerbuild:msan --copt -fno-omit-frame-pointer
657*b6fb3261SAndroid Build Coastguard Workerbuild:msan --linkopt -fsanitize=memory
658*b6fb3261SAndroid Build Coastguard Worker
659*b6fb3261SAndroid Build Coastguard Worker# Undefined Behavior Sanitizer
660*b6fb3261SAndroid Build Coastguard Worker# CC=clang bazel build --config ubsan
661*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --strip=never
662*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --copt -fsanitize=undefined
663*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --copt -DUNDEFINED_BEHAVIOR_SANITIZER
664*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --copt -g
665*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --copt -O3
666*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --copt -fno-omit-frame-pointer
667*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --linkopt -fsanitize=undefined
668*b6fb3261SAndroid Build Coastguard Workerbuild:ubsan --linkopt -lubsan
669*b6fb3261SAndroid Build Coastguard Worker
670*b6fb3261SAndroid Build Coastguard Worker# Disable TFRT integration for now unless --config=tfrt is specified.
671*b6fb3261SAndroid Build Coastguard Workerbuild      --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,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/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/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/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,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
672*b6fb3261SAndroid Build Coastguard Worker# TODO(b/240450920): We are in the process of migrating JitRt backend to XLA
673*b6fb3261SAndroid Build Coastguard Worker# and while we are doing this we can't keep it buildable/testable in OSS.
674*b6fb3261SAndroid Build Coastguard Workerbuild:tfrt --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,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/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/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/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,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
675