-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathbazel.rc
326 lines (293 loc) · 13.1 KB
/
bazel.rc
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# Default to an optimized build.
build -c opt
# Default build options.
build --force_pic
build --strip=never
build --crosstool_top=//tools:default-toolchain
# Only show warnings from Drake, not from externals.
build --output_filter="^//"
# Default test options.
test --test_output=errors
test --test_summary=terse
# By default, disable execution of tests that require proprietary software.
# Individual targets that use proprietary software are responsible for ensuring
# they can also build without it, typically by using a select statement.
# config_setting rules for proprietary software are provided in //tools.
test --test_tag_filters=-gurobi,-mosek,-snopt
# Inject DISPLAY into test runner environment for tests that use X.
test --test_env=DISPLAY
### A configuration that enables Gurobi. ###
# -- To use this config, the GUROBI_PATH environment variable must be the
# -- linux64 directory in the Gurobi 7.0.2 release.
#
# -- To run tests where Gurobi is used, ensure that you include
# -- "gurobi_test_tags()" from //tools:gurobi.bzl. If Gurobi is optional, set
# -- gurobi_required=False.
build:gurobi --define=WITH_GUROBI=ON
# -- By default, Gurobi looks for the license file in the homedir.
test:gurobi --test_env=HOME
# -- If set, the GRB_LICENSE_FILE path takes precedence.
test:gurobi --test_env=GRB_LICENSE_FILE
### A configuration that enables MOSEK. ###
# -- To use this config, you must have a MOSEK license file installed to
# -- $HOME/mosek/mosek.lic.
#
# -- To run tests where MOSEK is used, ensure that you include
# -- "mosek_test_tags()" from //tools:mosek.bzl. If MOSEK is optional, set
# -- mosek_required=False.
build:mosek --define=WITH_MOSEK=ON
# -- MOSEK looks for its license file at $HOME/mosek/mosek.lic
test:mosek --test_env=HOME
### A configuration that enables SNOPT. ###
# -- To use this config, you must have access to the private repository
# -- RobotLocomotion/snopt on GitHub, and your local git must be configured
# -- with SSH keys as documented at http://drake.mit.edu/from_source.html.
#
# -- To run tests that require SNOPT, also specify a set of test_tag_filters
# -- that does not exclude the "snopt" tag.
build:snopt --define=WITH_SNOPT=ON
### A configuration that enables all optional dependencies. ###
test:everything --test_tag_filters=
# -- Options for Gurobi.
build:everything --define=WITH_GUROBI=ON
test:everything --test_env=GRB_LICENSE_FILE
# -- Options for MOSEK.
build:everything --define=WITH_MOSEK=ON
# -- Options for Gurobi and MOSEK.
test:everything --test_env=HOME
# -- Options for SNOPT.
build:everything --define=WITH_SNOPT=ON
### Unsupported Crosstool ###
# Use the default Bazel-generated CROSSTOOL.
# This may be useful for developers with unsupported workstation configurations.
build:unsupported_crosstool --crosstool_top=//external:cc_toolchain
### git submodules
# If a CMake build is performed from the same source tree, it will checkout git
# submodules, and if they have BUILD files then `bazel build //...` will find
# them and complain that the paths don't line up correctly anymore. Here, we
# manually list out all git submodule externals' BUILD files.
#
# TODO(jwnimmer-tri) Remove this once git submodules are no longer used.
build --deleted_packages=externals/protobuf,externals/protobuf/util/python,externals/gflags
### Lint. ###
# Run the tests for code style compliance, but not any functional (unit) tests.
test:lint --build_tests_only
test:lint --test_tag_filters=lint
### Debug symbols on OS X. ###
# See https://github.com/bazelbuild/bazel/issues/2537
build:apple_debug --spawn_strategy=standalone
build:apple_debug --genrule_strategy=standalone
build:apple_debug --compilation_mode=dbg
# We don't actually use APPLE_DEBUG in code. It's just here to invalidate any
# sandboxed .o files that might be in cache if a developer tried to build
# with --compilation_mode=dbg instead of --config=apple_debug.
build:apple_debug --copt="-DAPPLE_DEBUG"
### Kcov coverage build. ###
build:kcov --copt -g
build:kcov --copt -O0
test:kcov --spawn_strategy=standalone
test:kcov --run_under //tools:kcov
test:kcov --local_test_jobs=1
test:kcov --test_tag_filters=-cpplint,-gurobi,-pycodestyle
test:kcov --nocache_test_results
### ASan build. ###
build:asan --copt -g
build:asan --copt -fsanitize=address
build:asan --copt -O1
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address
test:asan --run_under=//tools:asan
test:asan --test_env=ASAN_OPTIONS
test:asan --test_env=ASAN_SYMBOLIZER_PATH
test:asan --test_tag_filters=-gurobi,-mosek,-snopt,-no_asan
test:asan --test_lang_filters=-py
# Typical slowdown introduced by AddressSanitizer is 2x.
# See https://clang.llvm.org/docs/AddressSanitizer.html
test:asan --test_timeout=120,600,1800,7200
### ASan everything build. ###
build:asan_everything --define=WITH_GUROBI=ON
build:asan_everything --define=WITH_MOSEK=ON
build:asan_everything --define=WITH_SNOPT=ON
build:asan_everything --copt -g
build:asan_everything --copt -fsanitize=address
build:asan_everything --copt -O1
build:asan_everything --copt -fno-omit-frame-pointer
build:asan_everything --linkopt -fsanitize=address
test:asan_everything --test_env=GRB_LICENSE_FILE
test:asan_everything --test_env=HOME
test:asan_everything --test_tag_filters=-no_asan
test:asan_everything --run_under=//tools:asan
test:asan_everything --test_env=ASAN_OPTIONS
test:asan_everything --test_env=ASAN_SYMBOLIZER_PATH
test:asan_everything --test_lang_filters=-py
# Typical slowdown introduced by AddressSanitizer is 2x.
# See https://clang.llvm.org/docs/AddressSanitizer.html
test:asan_everything--test_timeout=120,600,1800,7200
### LSan build. ###
build:lsan --copt -g
build:lsan --copt -fsanitize=leak
build:lsan --copt -O1
build:lsan --copt -fno-omit-frame-pointer
build:lsan --linkopt -fsanitize=leak
test:lsan --run_under=//tools:lsan
test:lsan --test_env=LSAN_OPTIONS
test:lsan --test_env=LSAN_SYMBOLIZER_PATH
test:lsan --test_tag_filters=-gurobi,-mosek,-snopt,-no_lsan
test:lsan --test_lang_filters=-py
### LSan everything build. ###
build:lsan_everything --define=WITH_GUROBI=ON
build:lsan_everything --define=WITH_MOSEK=ON
build:lsan_everything --define=WITH_SNOPT=ON
build:lsan_everything --copt -g
build:lsan_everything --copt -fsanitize=leak
build:lsan_everything --copt -O1
build:lsan_everything --copt -fno-omit-frame-pointer
build:lsan_everything --linkopt -fsanitize=leak
test:lsan_everything --test_env=GRB_LICENSE_FILE
test:lsan_everything --test_env=HOME
test:lsan_everything --test_tag_filters=-no_lsan
test:lsan_everything --run_under=//tools:lsan
test:lsan_everything --test_env=LSAN_OPTIONS
test:lsan_everything --test_env=LSAN_SYMBOLIZER_PATH
test:lsan_everything --test_lang_filters=-py
### MSan build. ###
build:msan --copt -g
build:msan --copt -fsanitize=memory
build:msan --copt -fsanitize-memory-track-origins
build:msan --copt -O1
build:msan --copt -fno-omit-frame-pointer
build:msan --linkopt -fsanitize=memory
test:msan --run_under=//tools:msan
test:msan --test_tag_filters=-gurobi,-mosek,-snopt,-no_msan
test:msan --test_lang_filters=-py
test:msan --test_env=MSAN_OPTIONS
test:msan --test_env=MSAN_SYMBOLIZER_PATH
# Typical slowdown introduced by MemorySanitizer is 3x.
# See https://clang.llvm.org/docs/MemorySanitizer.html
test:msan --test_timeout=180,900,2700,10800
### MSan everything build. ###
build:msan_everything --define=WITH_GUROBI=ON
build:msan_everything --define=WITH_MOSEK=ON
build:msan_everything --define=WITH_SNOPT=ON
build:msan_everything --copt -g
build:msan_everything --copt -fsanitize=memory
build:msan_everything --copt -fsanitize-memory-track-origins
build:msan_everything --copt -O1
build:msan_everything --copt -fno-omit-frame-pointer
build:msan_everything --linkopt -fsanitize=memory
test:msan_everything --test_env=GRB_LICENSE_FILE
test:msan_everything --test_env=HOME
test:msan_everything --test_tag_filters=-no_msan
test:msan_everything --run_under=//tools:msan
test:msan_everything --test_lang_filters=-py
test:msan_everything --test_env=MSAN_OPTIONS
test:msan_everything --test_env=MSAN_SYMBOLIZER_PATH
# Typical slowdown introduced by MemorySanitizer is 3x.
# See https://clang.llvm.org/docs/MemorySanitizer.html
test:msan_everything --test_timeout=180,900,2700,10800
### TSan build. ###
build:tsan --copt -g
build:tsan --copt -fsanitize=thread
build:tsan --copt -O1
build:tsan --copt -fno-omit-frame-pointer
# From Tsan documentation for Clang-3.9:
# fsanitize=thread flag will cause Clang to act as though the -fPIE flag
# had been supplied if compiling without -fPIC, and as though the
# -pie flag had been supplied if linking an executable
# Bug in GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67308
build:tsan --noforce_pic
build:tsan --linkopt -fsanitize=thread
test:tsan --run_under=//tools:tsan
test:tsan --test_env=TSAN_OPTIONS
test:tsan --test_tag_filters=-gurobi,-mosek,-snopt,-no_tsan
test:tsan --test_lang_filters=-py
# Typical slowdown introduced by ThreadSanitizer is about 5x-15x
# See https://clang.llvm.org/docs/ThreadSanitizer.html
test:tsan --test_timeout=300,1500,5400,18000
### TSan everything build. ###
build:tsan_everything --define=WITH_GUROBI=ON
build:tsan_everything --define=WITH_MOSEK=ON
build:tsan_everything --define=WITH_SNOPT=ON
build:tsan_everything --copt -g
build:tsan_everything --copt -fsanitize=thread
build:tsan_everything --copt -O1
build:tsan_everything --copt -fno-omit-frame-pointer
build:tsan_everything --linkopt -fsanitize=thread
test:tsan_everything --test_env=GRB_LICENSE_FILE
test:tsan_everything --test_env=HOME
test:tsan_everything --test_tag_filters=-no_tsan
test:tsan_everything --run_under=//tools:tsan
test:tsan_everything --test_env=TSAN_OPTIONS
test:tsan_everything --test_lang_filters=-py
# Typical slowdown introduced by ThreadSanitizer is about 5x-15x
# See https://clang.llvm.org/docs/ThreadSanitizer.html
test:tsan_everything --test_timeout=300,1500,5400,18000
### UBSan build. ###
build:ubsan --copt -g
build:ubsan --copt -fsanitize=undefined
build:ubsan --copt -fno-sanitize=float-divide-by-zero
build:ubsan --copt -O1
build:ubsan --copt -fno-omit-frame-pointer
build:ubsan --linkopt -fsanitize=undefined
# https://groups.google.com/forum/#!topic/bazel-discuss/15h4GPixeGI
build:ubsan --linkopt /usr/lib/llvm-3.9/lib/clang/3.9.1/lib/linux/libclang_rt.ubsan_standalone_cxx-x86_64.a #noqa
build:ubsan --linkopt /usr/lib/llvm-3.9/lib/clang/3.9.1/lib/linux/libclang_rt.ubsan_standalone-x86_64.a #noqa
test:ubsan --run_under=//tools:ubsan
test:ubsan --test_env=UBSAN_OPTIONS
test:ubsan --test_tag_filters=-gurobi,-mosek,-snopt,-no_ubsan
test:ubsan --test_lang_filters=-py
### UBSan everything build. ###
build:ubsan_everything --define=WITH_GUROBI=ON
build:ubsan_everything --define=WITH_MOSEK=ON
build:ubsan_everything --define=WITH_SNOPT=ON
build:ubsan_everything --copt -g
build:ubsan_everything --copt -fsanitize=undefined
build:ubsan_everything --copt -O1
build:ubsan_everything --copt -fno-omit-frame-pointer
build:ubsan_everything --linkopt -fsanitize=undefined
# https://groups.google.com/forum/#!topic/bazel-discuss/15h4GPixeGI
build:ubsan_everything --linkopt /usr/lib/llvm-3.9/lib/clang/3.9.1/lib/linux/libclang_rt.ubsan_standalone_cxx-x86_64.a #noqa
build:ubsan_everything --linkopt /usr/lib/llvm-3.9/lib/clang/3.9.1/lib/linux/libclang_rt.ubsan_standalone-x86_64.a #noqa
test:ubsan_everything --test_env=GRB_LICENSE_FILE
test:ubsan_everything --test_env=HOME
test:ubsan_everything --test_tag_filters=-no_ubsan
test:ubsan_everything --run_under=//tools:ubsan
test:ubsan_everything --test_env=UBSAN_OPTIONS
test:ubsan_everything --test_lang_filters=-py
### Memcheck build. ###
build:memcheck --copt -g
build:memcheck --copt -O1
test:memcheck --run_under=//tools:valgrind
test:memcheck --test_tag_filters=-gurobi,-mosek,-snopt,-no_memcheck
test:memcheck --test_lang_filters=-sh,-py
# Slowdown factor can range from 5-100.
# See http://valgrind.org/info/about.html
test:memcheck --test_timeout=600,3000,10800,36000 # 10x
### Memcheck everything build. ###
build:memcheck_everything --define=WITH_GUROBI=ON
build:memcheck_everything --define=WITH_MOSEK=ON
build:memcheck_everything --define=WITH_SNOPT=ON
build:memcheck_everything --copt -g
build:memcheck_everything --copt -O1
test:memcheck_everything --test_env=GRB_LICENSE_FILE
test:memcheck_everything --test_env=HOME
test:memcheck_everything --test_tag_filters=-no_memcheck
test:memcheck_everything --run_under=//tools:valgrind
test:memcheck_everything --test_lang_filters=-sh,-py
# Slowdown factor can range from 5-100.
# See http://valgrind.org/info/about.html
test:memcheck_everything --test_timeout=600,3000,10800,36000 # 10x
# Fast memcheck.
#
# This build runs tests under valgrind, but (unlike `--config memcheck`) does
# not alter the compile flags. Thus, the already-cached compilation results
# from a `bazel build` or `bazel test` can be reused. This is useful to scan a
# local build for memory errors quickly. For more specific error reporting
# when errors are found, try `-c dbg --config fastmemcheck` or `--config
# memcheck` to recompile with line numbers and lower optimization levels.
#
test:fastmemcheck --run_under=//tools:valgrind
test:fastmemcheck --test_lang_filters=-sh,-py
# Slowdown factor can range from 5-100.
# See http://valgrind.org/info/about.html
test:fastmemcheck --test_timeout=600,3000,10800,36000 # 10x