-
Notifications
You must be signed in to change notification settings - Fork 99
/
.bazelrc
73 lines (59 loc) · 2.91 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
build --experimental_cc_implementation_deps
build --copt -fPIC
build --cxxopt -std=c++2b
build --linkopt=-lm
build --flag_alias=enable_cuda=@rules_cuda//cuda:enable
build --flag_alias=cuda_archs=@rules_cuda//cuda:archs
build --flag_alias=cuda_compiler=@rules_cuda//cuda:compiler
build --flag_alias=cuda_copts=@rules_cuda//cuda:copts
build --flag_alias=cuda_host_copts=@rules_cuda//cuda:host_copts
build --flag_alias=cuda_runtime=@rules_cuda//cuda:runtime
build --@rules_cuda//cuda:archs=compute_70:compute_70,sm_70
build --@rules_cuda//cuda:runtime=@local_cuda//:cuda_runtime_static
build --enable_cuda=True
# Use --config=clang to build with clang instead of gcc and nvcc.
build:clang --repo_env=CC=clang
build:clang --@rules_cuda//cuda:compiler=clang
build:clang --action_env CC=/usr/bin/clang-18
build:clang --action_env CXX=/usr/bin/clang++-18
build --@rules_cuda//cuda:copts=-std=c++2b
build --@rules_cuda//cuda:host_copts=-std=c++2b
build --config=clang
# Add options from
# https://stackoverflow.com/a/57733619
build:asan --strip=never
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -fno-omit-frame-pointer
build:asan --copt -fsanitize=address
build:asan --@rules_cuda//cuda:host_copts=-DADDRESS_SANITIZER
build:asan --@rules_cuda//cuda:host_copts=-D_LIBCPP_HAS_NO_ASAN
build:asan --@rules_cuda//cuda:host_copts=-fno-omit-frame-pointer
build:asan --@rules_cuda//cuda:host_copts=-fsanitize=address
build:asan --@rules_cuda//cuda:copts=-DADDRESS_SANITIZER
build:asan --@rules_cuda//cuda:copts=-D_LIBCPP_HAS_NO_ASAN
build:asan --@rules_cuda//cuda:copts=-fno-omit-frame-pointer
build:asan --@rules_cuda//cuda:copts=-fsanitize=address
build:asan --linkopt -fsanitize=address
build:asan --linkopt -fuse-ld=lld
build:asan --linkopt -rtlib=compiler-rt
# work around for https://github.com/google/sanitizers/issues/856
build:asan --linkopt -no-pie
# For asan to work with cuda, we need to add this option
# See https://github.com/google/sanitizers/issues/629#issuecomment-161357276
run:asan --action_env=ASAN_OPTIONS=protect_shadow_gap=0:detect_container_overflow=0
test:asan --action_env=ASAN_OPTIONS=protect_shadow_gap=0:detect_container_overflow=0
# Hack to add suppressions for libcuda
# See https://github.com/bazelbuild/bazel/issues/3216
# https://stackoverflow.com/a/74297943
build:asan --workspace_status_command=./ci/lsan_hack.sh
run:asan --action_env=LSAN_OPTIONS=suppressions=/tmp/sxt-blitzar-lsan.supp
test:asan --action_env=LSAN_OPTIONS=suppressions=/tmp/sxt-blitzar-lsan.supp
# For machines with many cpu cores available, we could not compile
# the code. Many times (not always) the following error was launched:
# `ptxas /tmp/tmpfxt_00000017_00000000-0, line 1; fatal : Missing .version...`
# See https://github.com/bazelbuild/bazel/issues/14410#issuecomment-997843606
# for more information.
# To fix the problem, we added the following line:
build --sandbox_add_mount_pair=.:/tmp
build --spawn_strategy local
test --test_output=errors