Repository: pytorch
Issue: Trying to build from source with use_flash_attention fails on windows due to fatal error C1189
Labels: module: build,module: windows,triaged,module: sdpa

### 🐛 Describe the bug

Trying to build pytorch with Cuda from source with Flash Attention is failing due to fatal error C1198:

```E:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\xkeycheck.h(54): fatal error C1189: #error:  The C++ Standard Library forbids macroizing the keyword "bool". Enable warning C4005 to find the forbidden define.```

``` Assembling: E:\Python\pytorch\third_party\ideep\mkl-dnn\src\common\ittnotify\ittptmark64.asm
[5169/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\s8x8s32\jit_avx2_u8_copy_sum_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5172/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\s8x8s32\jit_avx2_u8_copy_sum_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5175/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\s8x8s32\jit_avx2_u8_copy_sum_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5187/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_24x8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5190/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_24x8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5193/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_48x8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5196/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_24x8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5197/7857] Building CXX object third_party\ideep\mkl-dnn\...x64.dir\gemm\f32\jit_avx2_f32_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5198/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_48x8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5199/7857] Building CXX object third_party\ideep\mkl-dnn\...x64.dir\gemm\f32\jit_avx2_f32_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5200/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_48x8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5201/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_24x8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5202/7857] Building CXX object third_party\ideep\mkl-dnn\...bf16\jit_avx512_core_s16_48x8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5203/7857] Building CXX object third_party\ideep\mkl-dnn\...x64.dir\gemm\f32\jit_avx2_f32_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5204/7857] Building CXX object third_party\ideep\mkl-dnn\...x64.dir\gemm\f32\jit_avx2_f32_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5207/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\f32\jit_avx512_core_f32_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5208/7857] Building CXX object third_party\ideep\mkl-dnn\..._x64.dir\gemm\f32\jit_avx_f32_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5209/7857] Building CXX object third_party\ideep\mkl-dnn\..._x64.dir\gemm\f32\jit_avx_f32_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5210/7857] Building CXX object third_party\ideep\mkl-dnn\..._x64.dir\gemm\f32\jit_avx_f32_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5211/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\f32\jit_avx512_core_f32_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5212/7857] Building CXX object third_party\ideep\mkl-dnn\..._x64.dir\gemm\f32\jit_avx_f32_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5213/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\f32\jit_avx512_core_f32_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5219/7857] Building CXX object third_party\ideep\mkl-dnn\...64.dir\gemm\f32\jit_sse41_f32_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5220/7857] Building CXX object third_party\ideep\mkl-dnn\...64.dir\gemm\f32\jit_sse41_f32_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5228/7857] Building CXX object third_party\ideep\mkl-dnn\...64.dir\gemm\f32\jit_sse41_f32_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5229/7857] Building CXX object third_party\ideep\mkl-dnn\...64.dir\gemm\f32\jit_sse41_f32_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5231/7857] Building CXX object third_party\ideep\mkl-dnn\....dir\gemm\s8x8s32\jit_avx2_u8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5232/7857] Building CXX object third_party\ideep\mkl-dnn\...ir\gemm\f32\jit_sse41_kernel_b0_sgemm_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5233/7857] Building CXX object third_party\ideep\mkl-dnn\....dir\gemm\s8x8s32\jit_avx2_u8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5236/7857] Building CXX object third_party\ideep\mkl-dnn\...4.dir\gemm\f32\jit_sse41_kernel_sgemm_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5237/7857] Building CXX object third_party\ideep\mkl-dnn\....dir\gemm\s8x8s32\jit_avx2_u8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5240/7857] Building CXX object third_party\ideep\mkl-dnn\....dir\gemm\s8x8s32\jit_avx2_u8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5242/7857] Building CXX object third_party\ideep\mkl-dnn\...\gemm\s8x8s32\jit_avx2_u8_copy_sum_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5243/7857] Building CXX object third_party\ideep\mkl-dnn\...\s8x8s32\jit_avx2_vnni_u8_copy_sum_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5244/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_avx2_vnni_u8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5245/7857] Building CXX object third_party\ideep\mkl-dnn\...mm\s8x8s32\jit_avx512_core_u8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5246/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_avx2_vnni_u8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5247/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_avx2_vnni_u8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5248/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_avx2_vnni_u8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5249/7857] Building CXX object third_party\ideep\mkl-dnn\...\s8x8s32\jit_avx2_vnni_u8_copy_sum_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5250/7857] Building CXX object third_party\ideep\mkl-dnn\...\s8x8s32\jit_avx2_vnni_u8_copy_sum_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5252/7857] Building CXX object third_party\ideep\mkl-dnn\...mm\s8x8s32\jit_avx512_core_u8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5253/7857] Building CXX object third_party\ideep\mkl-dnn\...8x8s32\jit_avx512_core_u8_copy_sum_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5254/7857] Building CXX object third_party\ideep\mkl-dnn\...8x8s32\jit_avx512_core_u8_copy_sum_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5255/7857] Building CXX object third_party\ideep\mkl-dnn\...\s8x8s32\jit_avx2_vnni_u8_copy_sum_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5257/7857] Building CXX object third_party\ideep\mkl-dnn\...mm\s8x8s32\jit_avx512_core_u8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5259/7857] Building CXX object third_party\ideep\mkl-dnn\...8s32\jit_avx_kernel_b0_r_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5260/7857] Building CXX object third_party\ideep\mkl-dnn\...8x8s32\jit_avx512_core_u8_copy_sum_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5261/7857] Building CXX object third_party\ideep\mkl-dnn\...mm\s8x8s32\jit_avx512_core_u8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5262/7857] Building CXX object third_party\ideep\mkl-dnn\...8x8s32\jit_avx512_core_u8_copy_sum_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5263/7857] Building CXX object third_party\ideep\mkl-dnn\...8x8s32\jit_avx_kernel_b0_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5264/7857] Building CXX object third_party\ideep\mkl-dnn\...s8x8s32\jit_avx_kernel_b_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5265/7857] Building CXX object third_party\ideep\mkl-dnn\...m\s8x8s32\jit_avx_kernel_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5266/7857] Building CXX object third_party\ideep\mkl-dnn\...8s32\jit_avx_kernel_b0_b_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5267/7857] Building CXX object third_party\ideep\mkl-dnn\...4.dir\gemm\s8x8s32\jit_avx_u8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5268/7857] Building CXX object third_party\ideep\mkl-dnn\...8s32\jit_avx_kernel_b0_c_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5269/7857] Building CXX object third_party\ideep\mkl-dnn\...4.dir\gemm\s8x8s32\jit_avx_u8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5270/7857] Building CXX object third_party\ideep\mkl-dnn\...4.dir\gemm\s8x8s32\jit_avx_u8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5271/7857] Building CXX object third_party\ideep\mkl-dnn\...4.dir\gemm\s8x8s32\jit_avx_u8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5272/7857] Building CXX object third_party\ideep\mkl-dnn\...s8x8s32\jit_avx_kernel_r_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5273/7857] Building CXX object third_party\ideep\mkl-dnn\...r\gemm\s8x8s32\jit_avx_u8_copy_sum_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5274/7857] Building CXX object third_party\ideep\mkl-dnn\...r\gemm\s8x8s32\jit_avx_u8_copy_sum_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5275/7857] Building CXX object third_party\ideep\mkl-dnn\...r\gemm\s8x8s32\jit_avx_u8_copy_sum_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5276/7857] Building CXX object third_party\ideep\mkl-dnn\...r\gemm\s8x8s32\jit_avx_u8_copy_sum_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5277/7857] Building CXX object third_party\ideep\mkl-dnn\...s8x8s32\jit_avx_kernel_c_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5278/7857] Building CXX object third_party\ideep\mkl-dnn\...32\jit_sse41_kernel_b0_r_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5279/7857] Building CXX object third_party\ideep\mkl-dnn\...dir\gemm\s8x8s32\jit_sse41_u8_copy_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5280/7857] Building CXX object third_party\ideep\mkl-dnn\...x8s32\jit_sse41_kernel_r_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5281/7857] Building CXX object third_party\ideep\mkl-dnn\...8s32\jit_sse41_kernel_b0_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5282/7857] Building CXX object third_party\ideep\mkl-dnn\...32\jit_sse41_kernel_b0_b_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5283/7857] Building CXX object third_party\ideep\mkl-dnn\...s8x8s32\jit_sse41_kernel_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5284/7857] Building CXX object third_party\ideep\mkl-dnn\...32\jit_sse41_kernel_b0_c_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5285/7857] Building CXX object third_party\ideep\mkl-dnn\...x8s32\jit_sse41_kernel_c_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5286/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_sse41_u8_copy_sum_an_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5287/7857] Building CXX object third_party\ideep\mkl-dnn\...dir\gemm\s8x8s32\jit_sse41_u8_copy_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5288/7857] Building CXX object third_party\ideep\mkl-dnn\...x8s32\jit_sse41_kernel_b_gemm_s8u8s32_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5289/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_sse41_u8_copy_sum_at_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5290/7857] Building CXX object third_party\ideep\mkl-dnn\...dir\gemm\s8x8s32\jit_sse41_u8_copy_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5291/7857] Building CXX object third_party\ideep\mkl-dnn\...dir\gemm\s8x8s32\jit_sse41_u8_copy_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5292/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_sse41_u8_copy_sum_bt_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5293/7857] Building CXX object third_party\ideep\mkl-dnn\...gemm\s8x8s32\jit_sse41_u8_copy_sum_bn_kern_autogen.cpp.obj
cl : Command line warning D9025 : overriding '/O2' with '/Od'
[5495/7857] Building CXX object third_party\kineto\libkineto\CMakeFiles\kineto_api.dir\src\ThreadUtil.cpp.obj
E:\Python\pytorch\third_party\kineto\libkineto\src\ThreadUtil.cpp(19): warning C4005: 'WIN32_LEAN_AND_MEAN': macro redefinition
E:\Python\pytorch\third_party\kineto\libkineto\src\ThreadUtil.cpp(19): note: 'WIN32_LEAN_AND_MEAN' previously declared on the command line
E:\Python\pytorch\third_party\kineto\libkineto\src\ThreadUtil.cpp(20): warning C4005: 'NOGDI': macro redefinition
E:\Python\pytorch\third_party\kineto\libkineto\src\ThreadUtil.cpp(20): note: 'NOGDI' previously declared on the command line
[5500/7857] Building CXX object third_party\mimalloc\CMakeFiles\mimalloc-static.dir\src\heap.c.obj
FAILED: third_party/mimalloc/CMakeFiles/mimalloc-static.dir/src/heap.c.obj
"E:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\cl.exe"  /nologo /TP -DFLASHATTENTION_DISABLE_ALIBI -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DMI_STATIC_LIB -DNOMINMAX -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -DUSE_MIMALLOC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_UCRT_LEGACY_INFINITY -IE:\Python\pytorch\build\aten\src -IE:\Python\pytorch\aten\src -IE:\Python\pytorch\build -IE:\Python\pytorch -IE:\Python\pytorch\cmake\..\third_party\benchmark\include -IE:\Python\pytorch\third_party\onnx -IE:\Python\pytorch\build\third_party\onnx -IE:\Python\pytorch\nlohmann -IE:\Python\pytorch\third_party\mimalloc\include -external:IE:\Python\pytorch\build\third_party\gloo -external:IE:\Python\pytorch\cmake\..\third_party\gloo -external:IE:\Python\pytorch\cmake\..\third_party\googletest\googlemock\include -external:IE:\Python\pytorch\cmake\..\third_party\googletest\googletest\include -external:IE:\Python\pytorch\third_party\protobuf\src -external:IE:\Python\Anaconda\envs\pytorchbuild_env\Library\include -external:IE:\Python\pytorch\third_party\XNNPACK\include -external:IE:\Python\pytorch\third_party\ittapi\include -external:IE:\Python\pytorch\cmake\..\third_party\eigen -external:I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include" -external:IE:\Python\pytorch\third_party\ideep\mkl-dnn\include\oneapi\dnnl -external:IE:\Python\pytorch\third_party\ideep\include -external:IE:\Python\pytorch\INTERFACE -external:IE:\Python\pytorch\third_party\nlohmann\include -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /Zc:__cplusplus /bigobj /FS /utf-8 -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DLIBKINETO_NOXPUPTI=ON -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE /wd4624 /wd4068 /wd4067 /wd4267 /wd4661 /wd4717 /wd4244 /wd4804 /wd4273 /O2 /Ob2 /DNDEBUG /bigobj -DNDEBUG -std:c++17 -MD -DMKL_HAS_SBGEMM -DMKL_HAS_SHGEMM -DCAFFE2_USE_GLOO /Zc:__cplusplus /showIncludes /Fothird_party\mimalloc\CMakeFiles\mimalloc-static.dir\src\heap.c.obj /Fdthird_party\mimalloc\CMakeFiles\mimalloc-static.dir\mimalloc-static.pdb /FS -c E:\Python\pytorch\third_party\mimalloc\src\heap.c
E:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\xkeycheck.h(54): fatal error C1189: #error:  The C++ Standard Library forbids macroizing the keyword "bool". Enable warning C4005 to find the forbidden define.
[5502/7857] Building CXX object third_party\mimalloc\CMakeFiles\mimalloc-static.dir\src\alloc.c.obj
FAILED: third_party/mimalloc/CMakeFiles/mimalloc-static.dir/src/alloc.c.obj
"E:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\cl.exe"  /nologo /TP -DFLASHATTENTION_DISABLE_ALIBI -DIDEEP_USE_MKL -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DMI_STATIC_LIB -DNOMINMAX -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -DUSE_MIMALLOC -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_DEPRECATE=1 -D_UCRT_LEGACY_INFINITY -IE:\Python\pytorch\build\aten\src -IE:\Python\pytorch\aten\src -IE:\Python\pytorch\build -IE:\Python\pytorch -IE:\Python\pytorch\cmake\..\third_party\benchmark\include -IE:\Python\pytorch\third_party\onnx -IE:\Python\pytorch\build\third_party\onnx -IE:\Python\pytorch\nlohmann -IE:\Python\pytorch\third_party\mimalloc\include -external:IE:\Python\pytorch\build\third_party\gloo -external:IE:\Python\pytorch\cmake\..\third_party\gloo -external:IE:\Python\pytorch\cmake\..\third_party\googletest\googlemock\include -external:IE:\Python\pytorch\cmake\..\third_party\googletest\googletest\include -external:IE:\Python\pytorch\third_party\protobuf\src -external:IE:\Python\Anaconda\envs\pytorchbuild_env\Library\include -external:IE:\Python\pytorch\third_party\XNNPACK\include -external:IE:\Python\pytorch\third_party\ittapi\include -external:IE:\Python\pytorch\cmake\..\third_party\eigen -external:I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\include" -external:IE:\Python\pytorch\third_party\ideep\mkl-dnn\include\oneapi\dnnl -external:IE:\Python\pytorch\third_party\ideep\include -external:IE:\Python\pytorch\INTERFACE -external:IE:\Python\pytorch\third_party\nlohmann\include -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /Zc:__cplusplus /bigobj /FS /utf-8 -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DLIBKINETO_NOXPUPTI=ON -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE /wd4624 /wd4068 /wd4067 /wd4267 /wd4661 /wd4717 /wd4244 /wd4804 /wd4273 /O2 /Ob2 /DNDEBUG /bigobj -DNDEBUG -std:c++17 -MD -DMKL_HAS_SBGEMM -DMKL_HAS_SHGEMM -DCAFFE2_USE_GLOO /Zc:__cplusplus /showIncludes /Fothird_party\mimalloc\CMakeFiles\mimalloc-static.dir\src\alloc.c.obj /Fdthird_party\mimalloc\CMakeFiles\mimalloc-static.dir\mimalloc-static.pdb /FS -c E:\Python\pytorch\third_party\mimalloc\src\alloc.c
E:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\xkeycheck.h(54): fatal error C1189: #error:  The C++ Standard Library forbids macroizing the keyword "bool". Enable warning C4005 to find the forbidden define.
[5513/7857] Building CXX object third_party\kineto\libkineto\CMakeFiles\kineto_base.dir\src\output_json.cpp.obj
ninja: build stopped: subcommand failed.```

### Versions

```(pytorchbuild_env) E:\Python>python collect_env.py
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro
GCC version: Could not collect
Clang version: Could not collect
CMake version: version 3.27.4
Libc version: N/A

Python version: 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:03:56) [MSC v.1929 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-11-10.0.22631-SP0
Is CUDA available: N/A
CUDA runtime version: 12.6.68
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3080
Nvidia driver version: 560.94
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A

CPU:
Architecture=9
CurrentClockSpeed=3801
DeviceID=CPU0
Family=107
L2CacheSize=3072
L2CacheSpeed=
Manufacturer=AuthenticAMD
MaxClockSpeed=3801
Name=AMD Ryzen 5 3600X 6-Core Processor
ProcessorType=3
Revision=28928

Versions of relevant libraries:
[pip3] flake8==7.0.0
[pip3] mypy==1.10.0
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] numpydoc==1.7.0
[pip3] optree==0.12.1
[conda] _anaconda_depends         2024.06             py312_mkl_2
[conda] blas                      1.0                         mkl
[conda] mkl                       2023.1.0         h6b88ed4_46358
[conda] mkl-include               2024.2.1                 pypi_0    pypi
[conda] mkl-service               2.4.0           py312h2bbff1b_1
[conda] mkl-static                2024.2.1                 pypi_0    pypi
[conda] mkl_fft                   1.3.8           py312h2bbff1b_0
[conda] mkl_random                1.2.4           py312h59b6b97_0
[conda] numpy                     1.26.4          py312hfd52020_0
[conda] numpy-base                1.26.4          py312h4dde369_0
[conda] numpydoc                  1.7.0           py312haa95532_0
[conda] optree                    0.12.1                   pypi_0    pypi```

cc @malfet @seemethere @peterjc123 @mszhanyi @skyline75489 @nbcsm @iremyux @Blackhex @jbschlosser @bhosmer @cpuhrsch @erichan1 @drisspg @mikaylagawarecki