1# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the 2# target CPU to build transient dependencies correctly. See 3# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu 4build:android --crosstool_top=//external:android/crosstool 5build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain 6build:android_arm --config=android 7build:android_arm --cpu=armeabi-v7a 8build:android_arm --fat_apk_cpu=armeabi-v7a 9build:android_arm64 --config=android 10build:android_arm64 --cpu=arm64-v8a 11build:android_arm64 --fat_apk_cpu=arm64-v8a 12 13# Sets the default Apple platform to macOS. 14build --apple_platform_type=macos 15 16# Config to use a mostly-static build and disable modular op registration 17# support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python). 18# By default, TensorFlow will build with a dependence on 19# //tensorflow:libtensorflow_framework.so. 20build:monolithic --define framework_shared_object=false 21 22# For projects which use TensorFlow as part of a Bazel build process, putting 23# nothing in a bazelrc will default to a monolithic build. The following line 24# opts in to modular op registration support by default. 25build --define framework_shared_object=true 26 27# Please note that MKL on MacOS or windows is still not supported. 28# If you would like to use a local MKL instead of downloading, please set the 29# environment variable "TF_MKL_ROOT" every time before build. 30build:mkl --define=build_with_mkl=true --define=enable_mkl=true 31build:mkl --define=tensorflow_mkldnn_contraction_kernel=0 32build:mkl -c opt 33 34# This config option is used to enable MKL-DNN open source library only, 35# without depending on MKL binary version. 36build:mkl_open_source_only --define=build_with_mkl_dnn_only=true 37build:mkl_open_source_only --define=build_with_mkl=true --define=enable_mkl=true 38build:mkl_open_source_only --define=tensorflow_mkldnn_contraction_kernel=0 39 40build:download_clang --crosstool_top=@local_config_download_clang//:toolchain 41build:download_clang --define=using_clang=true 42# Instruct clang to use LLD for linking. 43# This only works with GPU builds currently, since Bazel sets -B/usr/bin in 44# auto-generated CPU crosstool, forcing /usr/bin/ld.lld to be preferred over 45# the downloaded one. 46build:download_clang_use_lld --linkopt='-fuse-ld=lld' 47 48build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain 49build:cuda --define=using_cuda=true --define=using_cuda_nvcc=true 50 51build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain 52build:rocm --define=using_rocm=true --define=using_rocm_hipcc=true 53 54build:cuda_clang --crosstool_top=@local_config_cuda//crosstool:toolchain 55build:cuda_clang --define=using_cuda=true --define=using_cuda_clang=true --define=using_clang=true 56 57build:sycl --crosstool_top=@local_config_sycl//crosstool:toolchain 58build:sycl --define=using_sycl=true --define=using_trisycl=false 59 60build:sycl_nodouble --crosstool_top=@local_config_sycl//crosstool:toolchain 61build:sycl_nodouble --define=using_sycl=true --cxxopt -DTENSORFLOW_SYCL_NO_DOUBLE 62 63build:sycl_asan --crosstool_top=@local_config_sycl//crosstool:toolchain 64build:sycl_asan --define=using_sycl=true --define=using_trisycl=false --copt -fno-omit-frame-pointer --copt -fsanitize-coverage=3 --copt -DGPR_NO_DIRECT_SYSCALLS --linkopt -fPIC --linkopt -fsanitize=address 65 66build:sycl_trisycl --crosstool_top=@local_config_sycl//crosstool:toolchain 67build:sycl_trisycl --define=using_sycl=true --define=using_trisycl=true 68 69# Options extracted from configure script 70build:gdr --define=with_gdr_support=true 71build:ngraph --define=with_ngraph_support=true 72build:verbs --define=with_verbs_support=true 73build:numa --define=with_numa_support=true 74 75# Options to disable default on features 76build:noaws --define=no_aws_support=true 77build:nogcp --define=no_gcp_support=true 78build:nohdfs --define=no_hdfs_support=true 79build:nokafka --define=no_kafka_support=true 80build:noignite --define=no_ignite_support=true 81build:nonccl --define=no_nccl_support=true 82 83build --define=use_fast_cpp_protos=true 84build --define=allow_oversize_protos=true 85 86build --spawn_strategy=standalone 87build --strategy=Genrule=standalone 88build -c opt 89 90# Other build flags. 91build --define=grpc_no_ares=true 92 93# Modular TF build options 94build:dynamic_kernels --define=dynamic_loaded_kernels=true 95build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS 96 97# Build TF with C++ 17 features. 98build:c++17 --cxxopt=-std=c++1z 99build:c++17 --cxxopt=-stdlib=libc++ 100build:c++1z --cxxopt=-std=c++1z 101build:c++1z --cxxopt=-stdlib=libc++ 102 103# Default paths for TF_SYSTEM_LIBS 104build --define=PREFIX=/usr 105build --define=LIBDIR=$(PREFIX)/lib 106build --define=INCLUDEDIR=$(PREFIX)/include 107 108# Disable MKL-DNN contraction kernels by default. 109build --define=tensorflow_mkldnn_contraction_kernel=0 110 111# Default options should come above this line 112 113# Options from ./configure 114try-import %workspace%/.tf_configure.bazelrc 115 116# Put user-specific options in .bazelrc.user 117try-import %workspace%/.bazelrc.user 118