build --announce_rc

# TODO: Migrate for https://github.com/bazelbuild/bazel/issues/7260
common --noincompatible_enable_cc_toolchain_resolution
common --experimental_repo_remote_exec
common --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
common --cxxopt=-w --host_cxxopt=-w
common --define=grpc_no_ares=true
common --define=tsl_link_protobuf=true
common --define open_source_build=true
common
common --define framework_shared_object=true
common --define tsl_protobuf_header_only=true
common --define=use_fast_cpp_protos=true
common --define=allow_oversize_protos=true

build -c opt

build:cuda --repo_env TF_NEED_CUDA=1
build:cuda --repo_env TF_NVCC_CLANG=1
build:cuda --repo_env TF_NCCL_USE_STUB=1
build:cuda --repo_env=HERMETIC_CUDA_VERSION="12.8.1"
build:cuda --repo_env=HERMETIC_CUDNN_VERSION="9.8.0"
# "sm" means we emit only cubin, which is forward compatible within a GPU generation.
# "compute" means we emit both cubin and PTX, which is larger but also forward compatible to future GPU generations.
build:cuda --repo_env HERMETIC_CUDA_COMPUTE_CAPABILITIES="sm_50,sm_60,sm_70,sm_80,compute_90"
build:cuda --crosstool_top="@local_config_cuda//crosstool:toolchain"
build:cuda --@local_config_cuda//:enable_cuda
# Default hermetic CUDA and CUDNN versions.
build:cuda --@local_config_cuda//cuda:include_cuda_libs=true
build:cuda --@local_config_cuda//:cuda_compiler=nvcc

build:rocm --repo_env TF_NEED_ROCM=1
build:rocm --define=using_rocm=true
build:rocm --define=using_rocm_hipcc=true
build:rocm --action_env TF_ROCM_AMDGPU_TARGETS="gfx900,gfx906,gfx908,gfx90a,gfx1030"

