forked from tensorflow/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
88 lines (72 loc) · 3.6 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
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
build --enable_platform_specific_config
build:linux --config=clang # On Linux, build with clang by default.
build:windows --config=msvc # On Windows, build with MSVC by default.
# LLVM's LIT test runner needs %PATHEXT% on Windows
test:windows --test_env=PATHEXT
# Build with MSVC (and nvcc if --config=cuda)
build:msvc --config=nvcc
build:msvc --cxxopt=/std:c++14 --host_cxxopt=/std:c++14
# Workaround for https://github.com/tensorflow/runtime/issues/65
build:msvc --cxxopt=/d2ReducedOptimizeHugeFunctions
# Build with clang.
build:clang --repo_env=CC=clang
# This should be 'build:clang' as well, but then could no longer be overriden by
# --config=nvcc. See https://github.com/bazelbuild/bazel/issues/13603.
build --@rules_cuda//cuda:compiler=clang
build:clang --@rules_cuda//cuda:copts=-Wno-unknown-cuda-version
build:clang --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
# Build with gcc (and nvcc if --config=cuda).
build:gcc --repo_env=CC=gcc
build:gcc --config=nvcc
build:gcc --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
build:gcc --cxxopt=-Wno-maybe-uninitialized
build:gcc --cxxopt=-Wno-sign-compare
# Build with CUDA device code with nvcc.
build:nvcc --@rules_cuda//cuda:compiler=nvcc
build:nvcc --repo_env=BAZEL_CXXOPTS= # Prevent warning: 'std' redefinition.
build:nvcc --@rules_cuda//cuda:copts=--expt-relaxed-constexpr
# Default to an optimized build.
# Override via: "-c dbg" or --compilation_mode=dbg
build --compilation_mode=opt
# Build settings for //backends/gpu/...
build --@rules_cuda//cuda:cuda_targets=sm_60
build --@rules_cuda//cuda:cuda_runtime=@tf_runtime//backends/gpu:cuda_stubs
build --copt=-U_FORTIFY_SOURCE # TODO(csigg): fix and remove
# CUDA support
build:cuda --//:enable_gpu # Link //backends/gpu to //tools targets.
build:cuda --@rules_cuda//cuda:enable_cuda # Build CUDA device code.
test:cuda --test_env=CUDA_CACHE_DISABLE=1 # Do not cache CUDA JIT
test:cuda --test_strategy=exclusive # Run tests serially to avoid GPU OOM.
# Build Event Service
build:bes --bes_backend=buildeventservice.googleapis.com
build:bes --bes_results_url=http://source.cloud.google.com/results/invocations/
build:bes --bes_timeout=1m
build:bes --project_id=tensorflow-testing # TODO(chuanhao): use tf-runtime
build:bes --google_default_credentials
# Remote Build and Execution
# Note: at the moment, this only uses remote caching.
build:rbe --remote_cache=grpcs://remotebuildexecution.googleapis.com
build:rbe --remote_instance_name=projects/tf-runtime/instances/tf-runtime-rbe-instance
build:rbe --host_platform_remote_properties_override='properties:{name:"cache-silo-key" value:"FirstCachedBuild"}'
build:rbe --google_default_credentials
# Disable RTTI and exceptions
build:disable_rtti_and_exceptions --no//:rtti_and_exceptions
# Minimize code size for //tools:code_size_test_driver target.
build:code_size_test --compilation_mode=opt --copt=-Os
build:code_size_test --linkopt=-Wl,--strip-all --linkopt=-Wl,--icf=safe
build:code_size_test --config=disable_rtti_and_exceptions
# Put user-specific options in .bazelrc.user
try-import %workspace%/.bazelrc.user