blob: 195450209fe7cf6da70bfe6b46248f130fc2337d [file] [log] [blame]
# cros-bazel.eclass does not support bzlmod yet.
# Disable it to avoid generating MODULE.bazel file.
common --noexperimental_enable_bzlmod
# Ignore warnings from dependencies.
build --per_file_copt=external/.*@-Wno-everything
# Treat warnings as errors.
build --copt=-Werror
# Use C++20.
build --cxxopt=-std=gnu++20
# Default options borrowed from TensorFlow:
# https://github.com/tensorflow/tensorflow/blob/master/.bazelrc
common --experimental_repo_remote_exec
build --noincompatible_remove_legacy_whole_archive
build --features=-force_no_whole_archive
build --define=framework_shared_object=true
build --define=tsl_protobuf_header_only=true
build --define=use_fast_cpp_protos=true
build --define=allow_oversize_protos=true
build --define=no_aws_support=true
build --define=no_hdfs_support=true
# Ensure that libm is linked to avoid undefined symbols error. This is also set
# in the upstream Tensorflow repo in some configurations. See
# https://github.com/bazelbuild/bazel/issues/12023 for more details.
build --linkopt="-lm"
build --host_linkopt="-lm"
# Use --config=asan to enable AddressSanitizer.
build:asan --copt=-fsanitize=address --linkopt=-fsanitize=address
# Use --config=host_clang to build things with clang on host.
build:host_clang --repo_env=CC=clang
# Use --config=cros to build things in cros_sdk chroot.
build:cros --auto_output_filter=packages
build:cros --copt=-DEGL_NO_X11
build:cros --copt=-DFORCE_ENABLE_GPU_DELEGATE
build:cros --copt=-DGOOGLE_UNSUPPORTED_OS_LOONIX
build:cros --define=tensorflow_mkldnn_contraction_kernel=0
build:cros --define=tflite_keep_symbols=true
build:cros --define=with_xla_support=false
build:cros --repo_env=TF_PYTHON_VERSION=3.9
# Currently tensorflow is confused by the flatbuffers v23 in SDK and v24 in
# board broot, so we temporarily removed it from the list.
# TODO(b/348328994): Add back flatbuffers after the v24 update is complete.
build:cros --action_env=TF_SYSTEM_LIBS=" \
absl_py, \
astor_archive, \
astunparse_archive, \
boringssl, \
com_github_googlecloudplatform_google_cloud_cpp, \
com_github_grpc_grpc, \
com_google_absl, \
com_google_protobuf, \
com_googlesource_code_re2, \
curl, \
cython, \
dill_archive, \
double_conversion, \
functools32_archive, \
gast_archive, \
gif, \
hwloc, \
icu, \
jsoncpp_git, \
libjpeg_turbo, \
nasm, \
nsync, \
opt_einsum_archive, \
org_sqlite, \
pasta, \
png, \
pybind11, \
six_archive, \
snappy, \
tblib_archive, \
termcolor_archive, \
typing_extensions_archive, \
wrapt, \
zlib \
"