forked from google/deepvariant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bazelrc
71 lines (58 loc) · 3.11 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
# For more information about the format and semantics of this file, see:
# https://docs.bazel.build/versions/master/bazel-user-manual.html#bazelrc
#
# Test inherits all of the rules of build, so we need only specify many of
# our configuration options for build and they will also apply to test.
# We need the same basic configuration defined by tensorflow, plus
# the local configuration. (Our WORKSPACE file assumes tensorflow is
# installed in a specific location, and there doesn't seem to be a
# way to refer to it symbolically, like BUILD files can.)
import %workspace%/../tensorflow/.bazelrc
import %workspace%/../tensorflow/.tf_configure.bazelrc
# In tensorflow/.bazelrc v2.9.1, setting this to false broke our build.
# So, setting it back to true.
build:linux --distinct_host_configuration=true
# Use 128 jobs to build. Unfortunately there doesn't seem to be any way to set
# the number of jobs to the number of actual cores on the machine (e.g., by
# looking at cpuinfo. See https://github.com/bazelbuild/bazel/issues/3814.
build --jobs 128
# We have to use the monolithic build configuration of TF. See internal.
build --config=monolithic
# A timestamp is added to each message generated by Bazel specifying the time at
# which the message was displayed.
build --show_timestamps
# Print additional information when there's a failure.
build --verbose_failures
# Use CPP protos for python, not the reflection ones.
build --define=use_fast_cpp_protos=true
# Turn off meddlesome mostly false positive warnings. Unfortunately these only
# affect the Nucleus build itself, not our deps, which is where most of the
# problems are coming from.
#
# These are largely errors due to protobuf.size(). We want to see them in our
# own build.
# build --copt="-Wno-sign-compare"
# These are essentially all false positives from our CLIF bindings, we disable
# them in our own build.
build --copt="-Wno-maybe-uninitialized"
build --copt="-Wno-unused-function"
# Set c++ version.
build --cxxopt="-std=c++17"
# These are errors coming from the protobuf library itself. We'd like to see
# them in our own build.
# build --copt="-Wno-write-strings"
# Errors sends combined stdout/stderr output from failed tests only into the
# stdout immediately after test is completed, ensuring that test output from
# simultaneous tests is not interleaved with each other. Prints a summary at the
# build as per summary output above.
test --test_output=errors
# Until https://github.com/bazelbuild/bazel/issues/4815 is fixed, we need
# to force the use of our py_runtime.
# Versions of bazel used by TensorFlow 2.1+ disable the use of --python_top by
# default with the below error message, necessitating the additional flag.
# "ERROR: `--python_top` is disabled by `--incompatible_use_python_toolchains`.
# Instead of configuring the Python runtime directly, register a Python
# toolchain. See https://github.com/bazelbuild/bazel/issues/7899. You can
# temporarily revert to the legacy flag-based way of specifying toolchains by
# setting `--incompatible_use_python_toolchains=false`."
build --python_top=//:deepvariant_python_runtime --incompatible_use_python_toolchains=false