cl 命令行 无法打开 calibration_statistics_collector_average_min_max.obj.params
same issue  cl : Command line error D8022 : cannot open 'bazel-out/x64_windows-opt/bin/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/_objs/calibration_statistics_collector_average_min_max/calibration_statistics_collector_average_min_max.obj.params' 
TF Version 2.15.1 Seems that the latest version of TF doesn't support MSVC 2019/MSVC2022 compiler any more,  please use CLANG to Build.  @Venkat6871  do you have any update on this issue? I had turned on Developer mode, it is not access right problem.  I checked the BUILD file under calibrator folder, no problem of this file. and calibration_statistics_collector_average_min_max.obj.params file had existed, why cl.exe cannot open this file.  it is format issue or not?
BR  Hi **@ShifengJin** ,
Sorry for the delay, Could you verify that the version of the `C` compiler used by Bazel are compatible with TensorFlow. Sometimes, mismatched compiler versions can lead to build errors. And if you are using an older version of the C++ compiler, consider upgrading to a newer version that may have better memory management. Please delete any existing build files and directories to ensure a fresh start.

Thank you!

 Microsoft (R) C/C++ Optimizing Compiler Version 19.39.33523 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.
it should be latest version of MSVC MSVC\14.39.33519 I'm also facing exact error and it is not actually bind to this particular `calibration_statistics_collector_average_min_max.obj.params` file, but it occurs for some other *.params file as well.

Faced this while trying to build the following target,
`bazel build --config=opt --cxxopts="-std=c++17" //tensorflow:tensorflow_cc.dll` that's a problem why we cannot use c++17 to build,  i used win-clang, it can be build successfully.  actually, this file is existed on the bazel_out folder already, if you run cl.exe manually, this file can be opened. I suspected it related with build setup. but we had followed the instruction in release note.  I also met another problem of smallvector like below: 
tensorflow/dtensor/mlir/expansions/save_restore_spmd_expander.cc(812): error C2976: 'llvm::SmallVector': too few template arguments. I checked the code, find that for TFV2.15.0 they use llvm17.0.6. (I want to use the latest llvm with --override_repository=llvm-raw=<path> failed also) and in save_restore_spmd_expander.cc:812
StatusOr<llvm::SmallVector<Layout>> GetLayoutsFromAssignVariableOps
I am mad with TF c++ windows build, I gave up windows build , and works on linux environment now.   @Venkat6871 please don't wait the his response, we met the same issue, I can provided the info you wanted As @weijianghn said, I do not get any errors when compiling in LLVM/clang 17.0.6. Getting it only in MSVC. But I'm facing other error because of missing symbols while trying to link the tensorflow.dll. The problem is I could solve missing symbols by simply adding `TF_EXPORT` in the respective source and recompile, but the missing symbol is from a dynamically generated proto file C++ header stub.
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

tf 2.16.1

### Custom code

Yes

### OS platform and distribution

Windows10

### Mobile device

_No response_

### Python version

3.11

### Bazel version

6.5

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

cl: 命令行 error D8022 :无法打开 calibration_statistics_collector_average_min_max.obj.params

### Standalone code to reproduce the issue

```shell
cl: 命令行 error D8022 :无法打开“bazel-out/x64_windows-opt/bin/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/_objs/calibration_statistics_collector_average_min_max/calibration_statistics_collector_average_min_max.obj.params”
```


### Relevant log output

```shell
(python311) K:\tensorflow\tensorflow-2.16.1>bazel --output_user_root="../output_user_root" build --noincompatible_do_not_split_linking_cmdline --verbose_failures --config=opt --config=windows //tensorflow:tensorflow_cc.dll
WARNING: The following configs were expanded more than once: [monolithic, no_tfrt]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Reading 'startup' options from k:\tensorflow\tensorflow-2.16.1\.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=306
INFO: Reading rc options for 'build' from k:\tensorflow\tensorflow-2.16.1\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  'build' options: --python_path=D:/Anaconda3/envs/python311/python.exe
INFO: Reading rc options for 'build' from k:\tensorflow\tensorflow-2.16.1\.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from k:\tensorflow\tensorflow-2.16.1\.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=D:/Anaconda3/envs/python311/python.exe --action_env PYTHON_LIB_PATH=D:/Anaconda3/envs/python311/Lib/site-packages --python_path=D:/Anaconda3/envs/python311/python.exe --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true
INFO: Found applicable config definition build:short_logs in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:opt in file k:\tensorflow\tensorflow-2.16.1\.tf_configure.bazelrc: --copt=/arch:AVX --host_copt=/arch:AVX
INFO: Found applicable config definition build:windows in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --copt=/W0 --host_copt=/W0 --copt=/Zc:__cplusplus --host_copt=/Zc:__cplusplus --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --features=compiler_param_file --features=archive_param_file --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --enable_runfiles --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/Zc:preprocessor --host_copt=/Zc:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --config=no_tfrt
INFO: Found applicable config definition build:monolithic in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --define framework_shared_object=false --define tsl_protobuf_header_only=false --experimental_link_static_libraries_once=false
INFO: Found applicable config definition build:no_tfrt in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/ir,tensorflow/compiler/mlir/tfrt/ir/mlrt,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ifrt,tensorflow/compiler/mlir/tfrt/tests/mlrt,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/compiler/mlir/tfrt/transforms/mlrt,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/runtime_fallback/test,tensorflow/core/runtime_fallback/test/gpu,tensorflow/core/runtime_fallback/test/saved_model,tensorflow/core/runtime_fallback/test/testdata,tensorflow/core/tfrt/stubs,tensorflow/core/tfrt/tfrt_session,tensorflow/core/tfrt/mlrt,tensorflow/core/tfrt/mlrt/attribute,tensorflow/core/tfrt/mlrt/kernel,tensorflow/core/tfrt/mlrt/bytecode,tensorflow/core/tfrt/mlrt/interpreter,tensorflow/compiler/mlir/tfrt/translate/mlrt,tensorflow/compiler/mlir/tfrt/translate/mlrt/testdata,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils,tensorflow/core/tfrt/utils/debug,tensorflow/core/tfrt/saved_model/python,tensorflow/core/tfrt/graph_executor/python,tensorflow/core/tfrt/saved_model/utils
INFO: Found applicable config definition build:windows in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --copt=/W0 --host_copt=/W0 --copt=/Zc:__cplusplus --host_copt=/Zc:__cplusplus --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --features=compiler_param_file --features=archive_param_file --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --enable_runfiles --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/Zc:preprocessor --host_copt=/Zc:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --config=no_tfrt
INFO: Found applicable config definition build:monolithic in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --define framework_shared_object=false --define tsl_protobuf_header_only=false --experimental_link_static_libraries_once=false
INFO: Found applicable config definition build:no_tfrt in file k:\tensorflow\tensorflow-2.16.1\.bazelrc: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/ir,tensorflow/compiler/mlir/tfrt/ir/mlrt,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ifrt,tensorflow/compiler/mlir/tfrt/tests/mlrt,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/compiler/mlir/tfrt/transforms/mlrt,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/runtime_fallback/test,tensorflow/core/runtime_fallback/test/gpu,tensorflow/core/runtime_fallback/test/saved_model,tensorflow/core/runtime_fallback/test/testdata,tensorflow/core/tfrt/stubs,tensorflow/core/tfrt/tfrt_session,tensorflow/core/tfrt/mlrt,tensorflow/core/tfrt/mlrt/attribute,tensorflow/core/tfrt/mlrt/kernel,tensorflow/core/tfrt/mlrt/bytecode,tensorflow/core/tfrt/mlrt/interpreter,tensorflow/compiler/mlir/tfrt/translate/mlrt,tensorflow/compiler/mlir/tfrt/translate/mlrt/testdata,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils,tensorflow/core/tfrt/utils/debug,tensorflow/core/tfrt/saved_model/python,tensorflow/core/tfrt/graph_executor/python,tensorflow/core/tfrt/saved_model/utils
WARNING: The following configs were expanded more than once: [monolithic, no_tfrt]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
WARNING: Download from https://golang.org/dl/?mode=json&include=all failed: class java.io.IOException connect timed out
INFO: Analyzed target //tensorflow:tensorflow_cc.dll (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: K:/tensorflow/tensorflow-2.16.1/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/BUILD:97:11: Compiling tensorflow/compiler/mlir/quantization/tensorflow/calibrator/calibration_statistics_collector_average_min_max.cc failed: (Exit 2): cl.exe failed: error executing command (from target //tensorflow/compiler/mlir/quantization/tensorflow/calibrator:calibration_statistics_collector_average_min_max)
  cd /d K:/tensorflow/output_user_root/nxvry2vz/execroot/org_tensorflow
  SET INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt
    SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\\Extensions\Microsoft\IntelliCode\CLI;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Team Tools\Performance Tools;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\\x64;C:\Program Files (x86)\Microsoft Visual Studio\Shared\Common\VSPerfCollectionTools\vs2019\;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\HTML Help Workshop;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\devinit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\;;C:\Windows\system32;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\VC\Linux\bin\ConnectionManagerExe
    SET PWD=/proc/self/cwd
    SET PYTHON_BIN_PATH=D:/Anaconda3/envs/python311/python.exe
    SET PYTHON_LIB_PATH=D:/Anaconda3/envs/python311/Lib/site-packages
    SET TEMP=C:\Users\ALVA\AppData\Local\Temp
    SET TF2_BEHAVIOR=1
    SET TMP=C:\Users\ALVA\AppData\Local\Temp
  C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64\cl.exe @bazel-out/x64_windows-opt/bin/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/_objs/calibration_statistics_collector_average_min_max/calibration_statistics_collector_average_min_max.obj.params
# Configuration: a55a642a68a20afa079b952d4b022b7bc800f40fe5a8b93a3ee5697ec31a8ff5
# Execution platform: @local_execution_config_platform//:platform
用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.29.30153 版
版权所有(C) Microsoft Corporation。保留所有权利。

cl: 命令行 error D8022 :无法打开“bazel-out/x64_windows-opt/bin/tensorflow/compiler/mlir/quantization/tensorflow/calibrator/_objs/calibration_statistics_collector_average_min_max/calibration_statistics_collector_average_min_max.obj.params”
Target //tensorflow:tensorflow_cc.dll failed to build
INFO: Elapsed time: 0.783s, Critical Path: 0.08s
INFO: 13 processes: 13 internal.
FAILED: Build did NOT complete successfully
```
