Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 1 | # TensorFlow Bazel configuration file. |
| 2 | # This file tries to group and simplify build options for TensorFlow |
| 3 | # |
| 4 | # ----CONFIG OPTIONS---- |
| 5 | # Android options: |
| 6 | # android: |
| 7 | # android_arm: |
| 8 | # android_x86: |
| 9 | # android_x86_64: |
| 10 | # |
| 11 | # iOS options: |
| 12 | # ios: |
| 13 | # ios_armv7: |
| 14 | # ios_arm64: |
YoungSeok Yoon | 29e6eaf | 2019-11-22 18:59:46 -0800 | [diff] [blame] | 15 | # ios_i386: |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 16 | # ios_x86_64: |
| 17 | # ios_fat: |
| 18 | # |
| 19 | # Compiler options: |
| 20 | # cuda_clang: Use clang when building CUDA code. |
| 21 | # c++17: Build with C++17 options |
| 22 | # C++1z: Build with C++17 options |
| 23 | # avx_linux: Build with avx instruction set on linux. |
| 24 | # avx2_linux: Build with avx2 instruction set on linux. |
| 25 | # arch_native_linux: Build with instruction sets available to the host machine on linux |
| 26 | # avx_win: Build with avx instruction set on windows |
| 27 | # avx2_win: Build with avx2 instruction set on windows |
| 28 | # |
| 29 | # Other build options: |
| 30 | # short_logs: Only log errors during build, skip warnings. |
| 31 | # monolithic: Build all TF C++ code into a single shared object. |
| 32 | # dynamic_kernels: Try to link all kernels dynamically (experimental). |
| 33 | # |
| 34 | # |
| 35 | # TF version options; |
| 36 | # v1: Build TF V1 (without contrib) |
| 37 | # v2: Build TF v2 |
| 38 | # |
| 39 | # Feature and Third party library support options: |
| 40 | # xla: Build TF with XLA |
| 41 | # using_cuda: CUDA is available to build system. |
| 42 | # cuda: Build with full cuda support. |
| 43 | # rocm: Build with AMD GPU support (rocm). |
| 44 | # sycl: Build with SYCL support. |
| 45 | # sycl_nodouble: |
| 46 | # sycl_asan: |
| 47 | # sycl_trisycl: |
| 48 | # mkl: Enable full mkl support. |
| 49 | # mkl_open_source_only: Enable MKL support only using open source MKL libraries. |
| 50 | # tensorrt: Enable Tensorrt support. |
| 51 | # ngraph: Enable ngraph support. |
| 52 | # numa: Enable numa using hwloc. |
| 53 | # noaws: Disable AWS S3 storage support |
| 54 | # nogcp: Disable GCS support. |
| 55 | # nohdfs: Disable hadoop hdfs support. |
| 56 | # nonccl: Disable nccl support. |
| 57 | # |
| 58 | # |
| 59 | # Remote build execution options (only configured to work with TF team projects for now.) |
| 60 | # rbe: General RBE options shared by all flavors. |
| 61 | # rbe_linux: General RBE options used on all linux builds. |
| 62 | # rbe_win: General RBE options used on all windows builds. |
| 63 | # |
| 64 | # rbe_cpu_linux: RBE options to build with only CPU support. |
| 65 | # rbe_linux_cuda_nvcc: RBE options to build with GPU support using nvcc. |
| 66 | # rbe_gpu_linux: An alias for rbe_linux_cuda_nvcc |
| 67 | # |
| 68 | # rbe_linux_py2: Linux Python 2 RBE config. |
| 69 | # rbe_linux_py3: Linux Python 3 RBE config |
| 70 | # |
| 71 | # rbe_win_py37: Windows Python 3.7 RBE config |
Gunhan Gulsoy | 0b5f6be | 2020-01-30 10:46:31 -0800 | [diff] [blame] | 72 | # rbe_win_py38: Windows Python 3.8 RBE config |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 73 | # |
| 74 | # tensorflow_testing_rbe_linux: RBE options to use RBE with tensorflow-testing project on linux |
| 75 | # tensorflow_testing_rbe_win: RBE options to use RBE with tensorflow-testing project on windows |
| 76 | # |
| 77 | |
| 78 | |
| 79 | |
Austin Anderson | 0f68a22 | 2018-01-10 15:16:01 -0800 | [diff] [blame] | 80 | # Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the |
| 81 | # target CPU to build transient dependencies correctly. See |
| 82 | # https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu |
Michael Case | d31531a | 2018-01-05 14:09:41 -0800 | [diff] [blame] | 83 | build:android --crosstool_top=//external:android/crosstool |
| 84 | build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain |
| 85 | build:android_arm --config=android |
| 86 | build:android_arm --cpu=armeabi-v7a |
Austin Anderson | 0f68a22 | 2018-01-10 15:16:01 -0800 | [diff] [blame] | 87 | build:android_arm --fat_apk_cpu=armeabi-v7a |
Michael Case | d31531a | 2018-01-05 14:09:41 -0800 | [diff] [blame] | 88 | build:android_arm64 --config=android |
| 89 | build:android_arm64 --cpu=arm64-v8a |
Austin Anderson | 0f68a22 | 2018-01-10 15:16:01 -0800 | [diff] [blame] | 90 | build:android_arm64 --fat_apk_cpu=arm64-v8a |
Joe Bowser | 560cdce | 2019-04-23 10:22:12 -0700 | [diff] [blame] | 91 | build:android_x86 --config=android |
| 92 | build:android_x86 --cpu=x86 |
Joe Bowser | 2f0654c | 2019-05-13 13:28:47 -0700 | [diff] [blame] | 93 | build:android_x86 --fat_apk_cpu=x86 |
Joe Bowser | 560cdce | 2019-04-23 10:22:12 -0700 | [diff] [blame] | 94 | build:android_x86_64 --config=android |
| 95 | build:android_x86_64 --cpu=x86_64 |
| 96 | build:android_x86_64 --fat_apk_cpu=x86_64 |
Michael Case | d31531a | 2018-01-05 14:09:41 -0800 | [diff] [blame] | 97 | |
A. Unique TensorFlower | dc34ddc | 2019-03-01 14:37:15 -0800 | [diff] [blame] | 98 | # Sets the default Apple platform to macOS. |
| 99 | build --apple_platform_type=macos |
| 100 | |
A. Unique TensorFlower | 32aaaec | 2019-09-17 23:21:24 -0700 | [diff] [blame] | 101 | # iOS configs for each architecture and the fat binary builds. |
| 102 | build:ios --apple_platform_type=ios |
| 103 | build:ios --apple_bitcode=embedded --copt=-fembed-bitcode |
YoungSeok Yoon | 05ed82f | 2019-12-02 20:43:51 -0800 | [diff] [blame] | 104 | build:ios --copt=-Wno-c++11-narrowing |
A. Unique TensorFlower | 32aaaec | 2019-09-17 23:21:24 -0700 | [diff] [blame] | 105 | build:ios_armv7 --config=ios |
| 106 | build:ios_armv7 --cpu=ios_armv7 |
A. Unique TensorFlower | 32aaaec | 2019-09-17 23:21:24 -0700 | [diff] [blame] | 107 | build:ios_arm64 --config=ios |
| 108 | build:ios_arm64 --cpu=ios_arm64 |
YoungSeok Yoon | 29e6eaf | 2019-11-22 18:59:46 -0800 | [diff] [blame] | 109 | build:ios_i386 --config=ios |
| 110 | build:ios_i386 --cpu=ios_i386 |
A. Unique TensorFlower | 32aaaec | 2019-09-17 23:21:24 -0700 | [diff] [blame] | 111 | build:ios_x86_64 --config=ios |
| 112 | build:ios_x86_64 --cpu=ios_x86_64 |
| 113 | build:ios_fat --config=ios |
YoungSeok Yoon | 29e6eaf | 2019-11-22 18:59:46 -0800 | [diff] [blame] | 114 | build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64 |
A. Unique TensorFlower | 32aaaec | 2019-09-17 23:21:24 -0700 | [diff] [blame] | 115 | |
Michael Case | d31531a | 2018-01-05 14:09:41 -0800 | [diff] [blame] | 116 | # Config to use a mostly-static build and disable modular op registration |
| 117 | # support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python). |
| 118 | # By default, TensorFlow will build with a dependence on |
| 119 | # //tensorflow:libtensorflow_framework.so. |
| 120 | build:monolithic --define framework_shared_object=false |
| 121 | |
| 122 | # For projects which use TensorFlow as part of a Bazel build process, putting |
| 123 | # nothing in a bazelrc will default to a monolithic build. The following line |
| 124 | # opts in to modular op registration support by default. |
| 125 | build --define framework_shared_object=true |
| 126 | |
Yifei Feng | 2021e7f | 2019-08-05 16:21:44 -0700 | [diff] [blame] | 127 | # Flags for open source build, always set to be true. |
| 128 | build --define open_source_build=true |
| 129 | test --define open_source_build=true |
| 130 | |
A. Unique TensorFlower | 46c3cb0 | 2019-10-17 08:39:52 -0700 | [diff] [blame] | 131 | # For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1 |
| 132 | build --java_toolchain=//third_party/toolchains/java:tf_java_toolchain |
| 133 | build --host_java_toolchain=//third_party/toolchains/java:tf_java_toolchain |
| 134 | |
Michael Case | d31531a | 2018-01-05 14:09:41 -0800 | [diff] [blame] | 135 | # Please note that MKL on MacOS or windows is still not supported. |
| 136 | # If you would like to use a local MKL instead of downloading, please set the |
| 137 | # environment variable "TF_MKL_ROOT" every time before build. |
A. Unique TensorFlower | c63d21b | 2018-09-25 22:57:54 -0700 | [diff] [blame] | 138 | build:mkl --define=build_with_mkl=true --define=enable_mkl=true |
Penporn Koanantakool | 044b34b | 2019-01-07 11:13:45 -0800 | [diff] [blame] | 139 | build:mkl --define=tensorflow_mkldnn_contraction_kernel=0 |
Michael Case | d31531a | 2018-01-05 14:09:41 -0800 | [diff] [blame] | 140 | build:mkl -c opt |
| 141 | |
Mahmoud Abuzaina | 64117da | 2018-07-05 13:56:22 -0700 | [diff] [blame] | 142 | # This config option is used to enable MKL-DNN open source library only, |
| 143 | # without depending on MKL binary version. |
Gunhan Gulsoy | 6cd6115 | 2018-10-17 13:02:06 -0700 | [diff] [blame] | 144 | build:mkl_open_source_only --define=build_with_mkl_dnn_only=true |
Bhavani Subramanian | 48671af | 2019-06-26 13:11:12 -0700 | [diff] [blame] | 145 | build:mkl_open_source_only --define=build_with_mkl_dnn_v1_only=true |
A. Unique TensorFlower | c63d21b | 2018-09-25 22:57:54 -0700 | [diff] [blame] | 146 | build:mkl_open_source_only --define=build_with_mkl=true --define=enable_mkl=true |
Penporn Koanantakool | 044b34b | 2019-01-07 11:13:45 -0800 | [diff] [blame] | 147 | build:mkl_open_source_only --define=tensorflow_mkldnn_contraction_kernel=0 |
Mahmoud Abuzaina | 64117da | 2018-07-05 13:56:22 -0700 | [diff] [blame] | 148 | |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 149 | # This config refers to building with CUDA available. It does not necessarily |
| 150 | # mean that we build CUDA op kernels. |
| 151 | build:using_cuda --define=using_cuda=true |
| 152 | build:using_cuda --action_env TF_NEED_CUDA=1 |
| 153 | build:using_cuda --crosstool_top=@local_config_cuda//crosstool:toolchain |
| 154 | |
| 155 | # This config refers to building CUDA op kernels with nvcc. |
| 156 | build:cuda --config=using_cuda |
| 157 | build:cuda --define=using_cuda_nvcc=true |
| 158 | |
| 159 | # This config refers to building CUDA op kernels with clang. |
| 160 | build:cuda_clang --config=using_cuda |
| 161 | build:cuda_clang --define=using_cuda_clang=true |
| 162 | build:cuda_clang --define=using_clang=true |
Christian Sigg | 866724d | 2019-09-19 02:17:43 -0700 | [diff] [blame] | 163 | build:cuda_clang --action_env TF_CUDA_CLANG=1 |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 164 | |
Bas Aarts | 56ec786 | 2019-11-08 10:36:51 -0800 | [diff] [blame] | 165 | # dbg config, as a shorthand for '--config=opt -c dbg' |
| 166 | build:dbg --config=opt -c dbg |
| 167 | # for now, disable arm_neon. see: https://github.com/tensorflow/tensorflow/issues/33360 |
| 168 | build:dbg --cxxopt -DTF_LITE_DISABLE_X86_NEON |
| 169 | |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 170 | build:tensorrt --action_env TF_NEED_TENSORRT=1 |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 171 | |
Wen-Heng (Jack) Chung | 69d3b8f | 2018-06-22 23:09:43 -0500 | [diff] [blame] | 172 | build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain |
| 173 | build:rocm --define=using_rocm=true --define=using_rocm_hipcc=true |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 174 | build:rocm --action_env TF_NEED_ROCM=1 |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 175 | |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 176 | build:sycl --crosstool_top=@local_config_sycl//crosstool:toolchain |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 177 | build:sycl --define=using_sycl=true |
| 178 | build:sycl --action_env TF_NEED_OPENCL_SYCL=1 |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 179 | |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 180 | build:sycl_nodouble --config=sycl |
| 181 | build:sycl_nodouble --cxxopt -DTENSORFLOW_SYCL_NO_DOUBLE |
Jonathan Hseu | 9cc871e | 2017-07-19 15:04:52 -0700 | [diff] [blame] | 182 | |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 183 | build:sycl_nodouble --config=sycl |
| 184 | build:sycl_asan --copt -fno-omit-frame-pointer --copt -fsanitize-coverage=3 --copt -DGPR_NO_DIRECT_SYSCALLS --linkopt -fPIC --linkopt -fsanitize=address |
Yifei Feng | b1d8c59 | 2017-11-22 13:42:21 -0800 | [diff] [blame] | 185 | |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 186 | build:sycl_nodouble --config=sycl |
| 187 | build:sycl_trisycl --define=using_trisycl=true |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 188 | |
Gunhan Gulsoy | 3da0dff | 2018-09-26 11:55:50 -0700 | [diff] [blame] | 189 | # Options extracted from configure script |
Gunhan Gulsoy | 3da0dff | 2018-09-26 11:55:50 -0700 | [diff] [blame] | 190 | build:ngraph --define=with_ngraph_support=true |
A. Unique TensorFlower | a6bf9c8 | 2019-02-26 10:08:35 -0800 | [diff] [blame] | 191 | build:numa --define=with_numa_support=true |
Gunhan Gulsoy | 3da0dff | 2018-09-26 11:55:50 -0700 | [diff] [blame] | 192 | |
Gunhan Gulsoy | 3437098 | 2018-10-12 15:26:01 -0700 | [diff] [blame] | 193 | # Options to disable default on features |
| 194 | build:noaws --define=no_aws_support=true |
| 195 | build:nogcp --define=no_gcp_support=true |
| 196 | build:nohdfs --define=no_hdfs_support=true |
Gunhan Gulsoy | eea8168 | 2018-11-26 16:51:23 -0800 | [diff] [blame] | 197 | build:nonccl --define=no_nccl_support=true |
Gunhan Gulsoy | 3437098 | 2018-10-12 15:26:01 -0700 | [diff] [blame] | 198 | |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 199 | build --define=use_fast_cpp_protos=true |
| 200 | build --define=allow_oversize_protos=true |
| 201 | |
Dong Lin | ee5bf62 | 2019-07-17 14:06:21 -0700 | [diff] [blame] | 202 | build --spawn_strategy=standalone |
A. Unique TensorFlower | aaa5600 | 2017-05-02 08:25:23 -0800 | [diff] [blame] | 203 | build -c opt |
Gunhan Gulsoy | 5a5e42e | 2018-08-03 14:44:58 -0700 | [diff] [blame] | 204 | |
A. Unique TensorFlower | e617d32 | 2019-05-27 00:29:46 -0700 | [diff] [blame] | 205 | # Make Bazel print out all options from rc files. |
| 206 | build --announce_rc |
| 207 | |
Gunhan Gulsoy | 3da0dff | 2018-09-26 11:55:50 -0700 | [diff] [blame] | 208 | # Other build flags. |
| 209 | build --define=grpc_no_ares=true |
| 210 | |
A. Unique TensorFlower | c9d1b6d | 2019-11-27 14:17:37 -0800 | [diff] [blame] | 211 | # See https://github.com/bazelbuild/bazel/issues/7362 for information on what |
| 212 | # --incompatible_remove_legacy_whole_archive flag does. |
| 213 | # This flag is set to true in Bazel 1.0 and newer versions. We tried to migrate |
| 214 | # Tensorflow to the default, however test coverage wasn't enough to catch the |
| 215 | # errors. |
| 216 | # There is ongoing work on Bazel team's side to provide support for transitive |
| 217 | # shared libraries. As part of migrating to transitive shared libraries, we |
| 218 | # hope to provide a better mechanism for control over symbol exporting, and |
| 219 | # then tackle this issue again. |
| 220 | # |
| 221 | # TODO: Remove this line once TF doesn't depend on Bazel wrapping all library |
| 222 | # archives in -whole_archive -no_whole_archive. |
| 223 | build --noincompatible_remove_legacy_whole_archive |
A. Unique TensorFlower | f58c9f8 | 2019-10-29 12:27:05 -0700 | [diff] [blame] | 224 | |
Gunhan Gulsoy | 5a5e42e | 2018-08-03 14:44:58 -0700 | [diff] [blame] | 225 | # Modular TF build options |
| 226 | build:dynamic_kernels --define=dynamic_loaded_kernels=true |
Gunhan Gulsoy | ce12659 | 2018-10-18 14:07:57 -0700 | [diff] [blame] | 227 | build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS |
Jason Zaman | 05b43db | 2018-08-15 15:20:56 +0800 | [diff] [blame] | 228 | |
Gunhan Gulsoy | 3bc5132 | 2019-02-01 13:27:15 -0800 | [diff] [blame] | 229 | # Build TF with C++ 17 features. |
| 230 | build:c++17 --cxxopt=-std=c++1z |
| 231 | build:c++17 --cxxopt=-stdlib=libc++ |
A. Unique TensorFlower | fef5167 | 2019-05-23 04:19:20 -0700 | [diff] [blame] | 232 | build:c++1z --config=c++17 |
Gunhan Gulsoy | 3bc5132 | 2019-02-01 13:27:15 -0800 | [diff] [blame] | 233 | |
Gunhan Gulsoy | 1868de8 | 2019-12-02 13:31:04 -0800 | [diff] [blame] | 234 | # Enable using platform specific build settings |
| 235 | build --enable_platform_specific_config |
Jason Zaman | b41761c | 2018-10-14 11:28:53 +0800 | [diff] [blame] | 236 | |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 237 | # Suppress C++ compiler warnings, otherwise build logs become 10s of MBs. |
Gunhan Gulsoy | 1868de8 | 2019-12-02 13:31:04 -0800 | [diff] [blame] | 238 | build:linux --copt=-w |
| 239 | build:macos --copt=-w |
| 240 | build:windows --copt=/w |
| 241 | |
Artem Belevich | 42f8dd1 | 2019-12-20 14:37:39 -0800 | [diff] [blame] | 242 | # Tensorflow uses M_* math constants that only get defined by MSVC headers if |
| 243 | # _USE_MATH_DEFINES is defined. |
| 244 | build:windows --copt=/D_USE_MATH_DEFINES |
| 245 | |
Gunhan Gulsoy | 1868de8 | 2019-12-02 13:31:04 -0800 | [diff] [blame] | 246 | # Default paths for TF_SYSTEM_LIBS |
| 247 | build:linux --define=PREFIX=/usr |
| 248 | build:linux --define=LIBDIR=$(PREFIX)/lib |
| 249 | build:linux --define=INCLUDEDIR=$(PREFIX)/include |
| 250 | build:macos --define=PREFIX=/usr |
| 251 | build:macos --define=LIBDIR=$(PREFIX)/lib |
| 252 | build:macos --define=INCLUDEDIR=$(PREFIX)/include |
| 253 | # TF_SYSTEM_LIBS do not work on windows. |
| 254 | |
| 255 | # By default, build TF in C++ 14 mode. |
| 256 | build:linux --cxxopt=-std=c++14 |
| 257 | build:linux --host_cxxopt=-std=c++14 |
| 258 | build:macos --cxxopt=-std=c++14 |
| 259 | build:macos --host_cxxopt=-std=c++14 |
| 260 | build:windows --cxxopt=/std:c++14 |
| 261 | build:windows --host_cxxopt=/std:c++14 |
| 262 | |
| 263 | # On windows, we still link everything into a single DLL. |
| 264 | build:windows --config=monolithic |
| 265 | |
Gunhan Gulsoy | 904c276 | 2019-12-16 10:36:27 -0800 | [diff] [blame] | 266 | # On linux, we dynamically link small amount of kernels |
Gunhan Gulsoy | 57c057b | 2019-12-12 02:17:20 -0800 | [diff] [blame] | 267 | build:linux --config=dynamic_kernels |
Gunhan Gulsoy | 57c057b | 2019-12-12 02:17:20 -0800 | [diff] [blame] | 268 | |
Gunhan Gulsoy | 1868de8 | 2019-12-02 13:31:04 -0800 | [diff] [blame] | 269 | # Make sure to include as little of windows.h as possible |
| 270 | build:windows --copt=-DWIN32_LEAN_AND_MEAN |
| 271 | build:windows --host_copt=-DWIN32_LEAN_AND_MEAN |
| 272 | build:windows --copt=-DNOGDI |
| 273 | build:windows --host_copt=-DNOGDI |
| 274 | |
| 275 | # Misc build options we need for windows. |
| 276 | build:windows --linkopt=/DEBUG |
| 277 | build:windows --host_linkopt=/DEBUG |
| 278 | build:windows --linkopt=/OPT:REF |
| 279 | build:windows --host_linkopt=/OPT:REF |
| 280 | build:windows --linkopt=/OPT:ICF |
| 281 | build:windows --host_linkopt=/OPT:ICF |
| 282 | build:windows --experimental_strict_action_env=true |
Gunhan Gulsoy | 1868de8 | 2019-12-02 13:31:04 -0800 | [diff] [blame] | 283 | |
| 284 | # Verbose failure logs when something goes wrong |
| 285 | build:windows --verbose_failures |
| 286 | |
| 287 | # On windows, we never cross compile |
| 288 | build:windows --distinct_host_configuration=false |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 289 | |
Gunhan Gulsoy | 08dfb5c | 2019-06-03 10:37:43 -0700 | [diff] [blame] | 290 | # Suppress all warning messages. |
| 291 | build:short_logs --output_filter=DONT_MATCH_ANYTHING |
| 292 | |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 293 | # Instruction set optimizations |
| 294 | # TODO(gunan): Create a feature in toolchains for avx/avx2 to |
| 295 | # avoid having to define linux/win separately. |
| 296 | build:avx_linux --copt=-mavx |
| 297 | build:avx2_linux --copt=-mavx2 |
| 298 | build:native_arch_linux --copt=-march=native |
| 299 | build:avx_win --copt=/arch=AVX |
| 300 | build:avx2_win --copt=/arch=AVX2 |
Gunhan Gulsoy | 71f9f0c | 2019-06-12 21:16:40 -0700 | [diff] [blame] | 301 | |
Anna R | 50515e8 | 2019-09-26 09:50:26 -0700 | [diff] [blame] | 302 | # Options to build TensorFlow 1.x or 2.x. |
| 303 | build:v1 --define=tf_api_version=1 |
| 304 | build:v2 --define=tf_api_version=2 |
Brian Atkinson | 0ebcbd9 | 2019-10-24 12:59:32 -0700 | [diff] [blame] | 305 | build:v1 --action_env=TF2_BEHAVIOR=0 |
| 306 | build:v2 --action_env=TF2_BEHAVIOR=1 |
A. Unique TensorFlower | 2a8e870 | 2019-10-02 18:45:34 -0700 | [diff] [blame] | 307 | build --config=v2 |
| 308 | test --config=v2 |
Anna R | 50515e8 | 2019-09-26 09:50:26 -0700 | [diff] [blame] | 309 | |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 310 | # Enable XLA |
| 311 | build:xla --action_env=TF_ENABLE_XLA=1 |
| 312 | build:xla --define=with_xla_support=true |
| 313 | |
| 314 | # BEGIN TF REMOTE BUILD EXECUTION OPTIONS |
| 315 | # Options when using remote execution |
| 316 | # WARNING: THESE OPTIONS WONT WORK IF YOU DO NOT HAVE PROPER AUTHENTICATION AND PERMISSIONS |
| 317 | build:rbe --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 |
| 318 | build:rbe --auth_enabled=true |
| 319 | build:rbe --auth_scope=https://www.googleapis.com/auth/cloud-source-tools |
| 320 | build:rbe --bes_backend=buildeventservice.googleapis.com |
| 321 | build:rbe --bes_best_effort=false |
| 322 | build:rbe --bes_results_url="https://source.cloud.google.com/results/invocations" |
| 323 | build:rbe --bes_timeout=600s |
| 324 | build:rbe --define=EXECUTOR=remote |
| 325 | build:rbe --flaky_test_attempts=3 |
| 326 | build:rbe --jobs=200 |
| 327 | build:rbe --remote_executor=grpcs://remotebuildexecution.googleapis.com |
| 328 | build:rbe --remote_timeout=3600 |
Gunhan Gulsoy | ff42635 | 2019-11-18 15:28:56 -0800 | [diff] [blame] | 329 | build:rbe --spawn_strategy=remote,worker,standalone,local |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 330 | test:rbe --test_env=USER=anon |
| 331 | |
| 332 | build:rbe --distinct_host_configuration=false |
| 333 | |
| 334 | build:rbe_linux --config=rbe |
| 335 | build:rbe_linux --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" |
| 336 | build:rbe_linux --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 |
| 337 | build:rbe_linux --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 |
| 338 | build:rbe_linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 |
| 339 | build:rbe_linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 |
| 340 | |
| 341 | # Non-rbe settings we should include because we do not run configure |
| 342 | build:rbe_linux --config=xla |
| 343 | build:rbe_linux --config=avx_linux |
| 344 | build:rbe_linux --config=short_logs |
| 345 | # TODO(gunan): Check why we need this specified in rbe, but not in other builds. |
| 346 | build:rbe_linux --linkopt=-lrt |
Pete Warden | adf6e22 | 2020-01-23 15:16:46 -0800 | [diff] [blame] | 347 | build:rbe_linux --linkopt=-lm |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 348 | |
| 349 | build:rbe_cpu_linux --config=rbe_linux |
| 350 | build:rbe_cpu_linux --crosstool_top="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain" |
| 351 | build:rbe_cpu_linux --extra_toolchains="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:cc-toolchain-k8" |
| 352 | build:rbe_cpu_linux --extra_execution_platforms"=@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" |
| 353 | build:rbe_cpu_linux --host_platform="@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" |
| 354 | build:rbe_cpu_linux --platforms="@org_tensorflow//third_party/toolchains:rbe_ubuntu16.04-manylinux2010" |
| 355 | |
| 356 | build:rbe_linux_cuda_nvcc --config=rbe_linux |
| 357 | build:rbe_linux_cuda_nvcc --crosstool_top="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1:toolchain" |
| 358 | build:rbe_linux_cuda_nvcc --extra_toolchains="//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1:toolchain-linux-x86_64" |
| 359 | build:rbe_linux_cuda_nvcc --extra_execution_platforms="@org_tensorflow//third_party/toolchains:rbe_cuda10.1-cudnn7-ubuntu16.04-manylinux2010,@org_tensorflow//third_party/toolchains:rbe_cuda10.1-cudnn7-ubuntu16.04-manylinux2010-gpu" |
| 360 | build:rbe_linux_cuda_nvcc --host_platform="@org_tensorflow//third_party/toolchains:rbe_cuda10.1-cudnn7-ubuntu16.04-manylinux2010" |
| 361 | build:rbe_linux_cuda_nvcc --platforms="@org_tensorflow//third_party/toolchains:rbe_cuda10.1-cudnn7-ubuntu16.04-manylinux2010" |
| 362 | build:rbe_linux_cuda_nvcc --repo_env=TF_CUDA_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/cuda10.1-cudnn7" |
Brian Zhao | 95fc3bd | 2019-11-18 10:37:52 -0800 | [diff] [blame] | 363 | build:rbe_linux_cuda_nvcc --repo_env=TF_TENSORRT_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/tensorrt6.0" |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 364 | build:rbe_linux_cuda_nvcc --repo_env=TF_NEED_TENSORRT=1 |
| 365 | build:rbe_linux_cuda_nvcc --repo_env=TF_CUDA_VERSION=10 |
| 366 | build:rbe_linux_cuda_nvcc --repo_env=TF_CUDNN_VERSION=7 |
| 367 | build:rbe_linux_cuda_nvcc --repo_env=REMOTE_GPU_TESTING=1 |
| 368 | build:rbe_linux_cuda_nvcc --repo_env=TF_NEED_CUDA=1 |
| 369 | build:rbe_linux_cuda_nvcc --define=using_cuda_nvcc=true |
| 370 | test:rbe_linux_cuda_nvcc --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" |
| 371 | |
| 372 | common:rbe_gpu_linux --config=rbe_linux_cuda_nvcc |
| 373 | |
| 374 | build:rbe_linux_py2 --config=rbe_linux |
| 375 | build:rbe_linux_py2 --repo_env=PYTHON_BIN_PATH="/usr/bin/python2" |
| 376 | build:rbe_linux_py2 --python_path="/usr/bin/python2" |
| 377 | build:rbe_linux_py2 --repo_env=TF_PYTHON_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/py" |
| 378 | |
| 379 | build:rbe_linux_py3 --config=rbe_linux |
| 380 | build:rbe_linux_py3 --repo_env=PYTHON_BIN_PATH="/usr/bin/python3" |
| 381 | build:rbe_linux_py3 --python_path="/usr/bin/python3" |
| 382 | build:rbe_linux_py3 --repo_env=TF_PYTHON_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/py3" |
| 383 | |
| 384 | build:rbe_win --config=rbe |
Gunhan Gulsoy | b618051 | 2019-12-31 05:43:55 -0800 | [diff] [blame] | 385 | build:rbe_win --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/win_1803/bazel_121:toolchain" |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 386 | build:rbe_win --extra_execution_platforms="@org_tensorflow//third_party/toolchains/preconfig/win_1803:rbe_windows_1803" |
Gunhan Gulsoy | b618051 | 2019-12-31 05:43:55 -0800 | [diff] [blame] | 387 | build:rbe_win --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/win_1803/bazel_121:cc-toolchain-x64_windows" |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 388 | build:rbe_win --host_javabase="@org_tensorflow//third_party/toolchains/preconfig/win_1803:windows_jdk8" |
| 389 | build:rbe_win --host_platform="@org_tensorflow//third_party/toolchains/preconfig/win_1803:rbe_windows_1803" |
| 390 | build:rbe_win --javabase="@org_tensorflow//third_party/toolchains/preconfig/win_1803:windows_jdk8" |
| 391 | build:rbe_win --platforms="@org_tensorflow//third_party/toolchains/preconfig/win_1803:rbe_windows_1803" |
| 392 | build:rbe_win --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe |
| 393 | |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 394 | # TODO(gunan): Remove once we use MSVC 2019 with latest patches. |
| 395 | build:rbe_win --define=override_eigen_strong_inline=true |
Gunhan Gulsoy | 0b5f6be | 2020-01-30 10:46:31 -0800 | [diff] [blame] | 396 | build:rbe_win --jobs=500 |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 397 | |
| 398 | build:rbe_win_py37 --config=rbe |
| 399 | build:rbe_win_py37 --repo_env=PYTHON_BIN_PATH=C:\\Python37\\python.exe |
| 400 | build:rbe_win_py37 --repo_env=PYTHON_LIB_PATH=C:\\Python37\\lib\\site-packages |
| 401 | build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO=@org_tensorflow//third_party/toolchains/preconfig/win_1803/py37 |
| 402 | build:rbe_win_py37 --python_path=C:\\Python37\\python.exe |
| 403 | |
Gunhan Gulsoy | 0b5f6be | 2020-01-30 10:46:31 -0800 | [diff] [blame] | 404 | build:rbe_win_py38 --config=rbe |
| 405 | build:rbe_win_py38 --repo_env=PYTHON_BIN_PATH=C:\\Python38\\python.exe |
| 406 | build:rbe_win_py38 --repo_env=PYTHON_LIB_PATH=C:\\Python38\\lib\\site-packages |
| 407 | build:rbe_win_py38 --repo_env=TF_PYTHON_CONFIG_REPO=@org_tensorflow//third_party/toolchains/preconfig/win_1803/py38 |
| 408 | build:rbe_win_py38 --python_path=C:\\Python38\\python.exe |
| 409 | |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 410 | # These you may need to change for your own GCP project. |
| 411 | build:tensorflow_testing_rbe --project_id=tensorflow-testing |
Gunhan Gulsoy | 06f9ec3 | 2019-11-18 17:21:21 -0800 | [diff] [blame] | 412 | common:tensorflow_testing_rbe_linux --remote_instance_name=projects/tensorflow-testing/instances/default_instance |
Gunhan Gulsoy | e70d095 | 2019-11-15 15:29:33 -0800 | [diff] [blame] | 413 | build:tensorflow_testing_rbe_linux --config=tensorflow_testing_rbe |
| 414 | build:tensorflow_testing_rbe_linux --config=rbe |
| 415 | build:tensorflow_testing_rbe_linux --config=rbe_linux |
| 416 | |
| 417 | common:tensorflow_testing_rbe_win --remote_instance_name=projects/tensorflow-testing/instances/windows |
| 418 | build:tensorflow_testing_rbe_win --config=tensorflow_testing_rbe |
| 419 | build:tensorflow_testing_rbe_win --config=rbe_win |
| 420 | # END TF REMOTE BUILD EXECUTION OPTIONS |
| 421 | |
Jason Zaman | b41761c | 2018-10-14 11:28:53 +0800 | [diff] [blame] | 422 | # Default options should come above this line |
| 423 | |
| 424 | # Options from ./configure |
| 425 | try-import %workspace%/.tf_configure.bazelrc |
| 426 | |
| 427 | # Put user-specific options in .bazelrc.user |
| 428 | try-import %workspace%/.bazelrc.user |