-
Notifications
You must be signed in to change notification settings - Fork 53
/
.bazelrc
133 lines (115 loc) · 3.9 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
121
122
123
124
125
126
127
128
129
130
131
132
133
# Bazel configuration for Yggdrasil Decision Forests
#
# OPTIONS
#
# Linux
#
# linux_cpp17: Linux build. Uses C++17.
#
# Linux options:
#
# linux_avx2: AVX2.
#
# Windows
#
# On Windows, uncomment the output_user_root option to avoid long path issues.
#
# windows_cpp17: Windows build. Uses C++17.
#
# Windows options:
#
# windows_avx2: AVX2.
#
# TensorFlow Defines:
#
# use_tensorflow_io=1: Uses tensorflow for IO operations. Otherwise, use the
# c++ Standard Library <filesystem>. Note: <filesystem> does not exist in
# cpp<=14 and it had some issue with gcc<=8. Required to consume dataset
# encoded as TFRecord of TF.Examples.
# tensorflow_with_header_lib=1: Uses tensorflow header only library. Useful to
# use tensorflow dynamic linking. Otherwise, links tensorflow statically (if
# tensorflow is used).
#
# Common flags.
common --experimental_repo_remote_exec
# Avoid long path issues on Windows
# startup --output_user_root=C:/tmpbld
# Flags to compile with or without recent version of Bazel.
# Required for bazel <=4, fails with bazel >= 5.
# common --incompatible_restrict_string_escapes=false
build -c opt
build --announce_rc
build --noincompatible_strict_action_env
# Enable after adding python headers to protobuf.
build --define=use_fast_cpp_protos=true
build --define=allow_oversize_protos=true
build --define=grpc_no_ares=true
# Nice print
build:linux --copt=-fdiagnostics-color=always
build --color=yes
# Disable dependencies to Tensorflow.
build --define=use_ydf_tensorflow_proto=1
# Suppress C++ compiler warnings.
build:linux --copt=-w
build:linux --host_copt=-w
build:macos --copt=-w
build:windows --copt=/W0
build:wasm --copt=-w
build:wasm --host_copt=-w
# Build mode.
build:linux_cpp17 --cxxopt=-std=c++17
build:linux_cpp17 --host_cxxopt=-std=c++17
build:linux_cpp17 --config=linux
build:macos --cxxopt=-std=c++17
build:macos --host_cxxopt=-std=c++17
build:windows_cpp17 --cxxopt=/std:c++17
build:windows_cpp17 --host_cxxopt=/std:c++17
build:windows_cpp17 --config=windows
build:windows_cpp20 --cxxopt=/std:c++20
build:windows_cpp20 --host_cxxopt=/std:c++20
build:windows_cpp20 --config=windows
# Instruction set optimizations
build:linux_avx2 --copt=-mavx2
build:windows_avx2 --copt=/arch:AVX2
# Misc build options we need for windows.
build:windows --copt=/D_USE_MATH_DEFINES
build:windows --host_copt=/D_USE_MATH_DEFINES
build:windows --copt=-DWIN32_LEAN_AND_MEAN
build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
build:windows --copt=-DNOGDI
build:windows --host_copt=-DNOGDI
build:windows --linkopt=/NDEBUG
build:windows --host_linkopt=/NDEBUG
build:windows --linkopt=/OPT:REF
build:windows --host_linkopt=/OPT:REF
build:windows --linkopt=/OPT:ICF
build:windows --host_linkopt=/OPT:ICF
build:windows --experimental_strict_action_env=true
build:windows --copt=/Zc:preprocessor
build:windows --host_copt=/Zc:preprocessor
build:windows --materialize_param_files
build:windows --features=compiler_param_file
build:windows --verbose_failures
build:windows --copt=/Oi
build:windows --host_copt=/Oi
build:windows --copt=/GL
build:windows --host_copt=/GL
# Wasm
build:wasm --crosstool_top=@emsdk//emscripten_toolchain:everything
build:wasm --cpu=wasm
build:wasm --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
build:wasm --copt="-Wno-deprecated-non-prototype"
build:wasm --copt="-Wno-unused-value"
build:wasm --copt="-Wno-unused-function"
build:wasm --copt="-Wno-deprecated-declarations"
build:wasm --copt="-Wno-unused-lambda-capture"
build:wasm --spawn_strategy=local
build:wasm --cxxopt=-std=c++17
build:wasm --host_cxxopt=-std=c++17
build:wasm --host_cxxopt="-fno-exceptions"
# Use absl::anyInvocable. This breaks builds with TF <= 2.12 but is required
# for builds with TF >= 2.13.
build:use_absl_anyinvocable --define=use_absl_anyinvocable=1
# Optional. Just to make it compatible with dynamic linking and TensorFlow.
# build --cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"
# build --host_cxxopt="-D_GLIBCXX_USE_CXX11_ABI=0"