iree-org / iree

A retargetable MLIR-based machine learning compiler and runtime toolkit.
http://iree.dev/
Apache License 2.0
2.86k stars 624 forks source link

Build fails on Windows with clang #12025

Open absorensen opened 1 year ago

absorensen commented 1 year ago

What happened?

I am trying to build IREE from source on Windows 10. I am especially interested in Vulkan and CPU inference in C++. I follow the instructions from the IREE webpage.

I pull the code from the git repo into the iree folder.

I start the Developer Command Prompt for VS 2022.

When running the command (from the iree folder): cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_HOST_TRIPLE=x86_64 -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_LLVM_CPU=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON

Everything passes. But when I then run the command

cmake --build ../iree-build/

I get a few warnings, until finally in [3193/5025] I get the following error:

[3073/5128] Building CXX object third_party\llvm-project\llvm\tools\mlir\lib\Dialect\Linalg\Transforms\CMakeFiles\obj.MLIRLinalgTransforms.dir\DataLayoutPropagation.cpp.obj
FAILED: third_party/llvm-project/llvm/tools/mlir/lib/Dialect/Linalg/Transforms/CMakeFiles/obj.MLIRLinalgTransforms.dir/DataLayoutPropagation.cpp.obj
C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1434~1.319\bin\Hostx86\x86\cl.exe  /nologo /TP -DGTEST_HAS_RTTI=0 -DMLIR_CUDA_CONVERSIONS_ENABLED=1 -DMLIR_ROCM_CONVERSIONS_ENABLED=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\Programming\iree-build\third_party\llvm-project\llvm\tools\mlir\lib\Dialect\Linalg\Transforms -IC:\Programming\iree\third_party\llvm-project\mlir\lib\Dialect\Linalg\Transforms -IC:\Programming\iree-build\third_party\llvm-project\llvm\include -IC:\Programming\iree\third_party\llvm-project\llvm\include -IC:\Programming\iree\third_party\llvm-project\mlir\include -IC:\Programming\iree-build\third_party\llvm-project\llvm\tools\mlir\include -IC:\Programming\iree\third_party\llvm-project\lld\include -IC:\Programming\iree-build\third_party\llvm-project\llvm\tools\lld\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:__cplusplus /Oi /bigobj /permissive- -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /Gw /Zi /O2 /Ob1 -MD  /EHs-c- /GR- -std:c++17 /showIncludes /Fothird_party\llvm-project\llvm\tools\mlir\lib\Dialect\Linalg\Transforms\CMakeFiles\obj.MLIRLinalgTransforms.dir\DataLayoutPropagation.cpp.obj /Fdthird_party\llvm-project\llvm\tools\mlir\lib\Dialect\Linalg\Transforms\CMakeFiles\obj.MLIRLinalgTransforms.dir\ /FS -c C:\Programming\iree\third_party\llvm-project\mlir\lib\Dialect\Linalg\Transforms\DataLayoutPropagation.cpp
C:\Programming\iree\third_party\llvm-project\llvm\include\llvm/ADT/STLExtras.h(894): error C2672: 'llvm::all_equal': no matching overloaded function found
C:\Programming\iree\third_party\llvm-project\llvm\include\llvm/ADT/STLExtras.h(735): note: could be 'bool llvm::all_equal(std::initializer_list<_Elem>)'
C:\Programming\iree\third_party\llvm-project\llvm\include\llvm/ADT/STLExtras.h(894): note: 'bool llvm::all_equal(std::initializer_list<_Elem>)': template parameter 'T' is ambiguous
C:\Programming\iree\third_party\llvm-project\llvm\include\llvm/ADT/STLExtras.h(894): note: could be 'int'
C:\Programming\iree\third_party\llvm-project\llvm\include\llvm/ADT/STLExtras.h(894): note: or       '__int64'
C:\Programming\iree\third_party\llvm-project\llvm\include\llvm/ADT/STLExtras.h(894): note: 'bool llvm::all_equal(std::initializer_list<_Elem>)': could not deduce template argument for '_Elem' from 'int'
C:\Programming\iree\third_party\llvm-project\mlir\lib\Dialect\Linalg\Transforms\DataLayoutPropagation.cpp(59): note: see reference to function template instantiation 'llvm::detail::zippy<llvm::detail::zip_first,llvm::iota_range<unsigned int>,llvm::ArrayRef<int64_t> &,llvm::SmallVector<mlir::OpFoldResult,13>> llvm::zip_equal<llvm::iota_range<unsigned int>,llvm::ArrayRef<int64_t>&,llvm::SmallVector<mlir::OpFoldResult,13>>(T &&,U,llvm::SmallVector<mlir::OpFoldResult,13> &&)' being compiled
        with
        [
            T=llvm::iota_range<unsigned int>,
            U=llvm::ArrayRef<int64_t> &
        ]
[3082/5128] Building CXX object third_party\llvm-project\llvm\tools\mlir\lib\Dialect\Linalg\IR\CMakeFiles\obj.MLIRLinalgDialect.dir\LinalgDialect.cpp.obj
ninja: build stopped: subcommand failed.

I have tried using Clang 15.0.6 and 15.0.1, Visual Studio 2019 and 2022. With VS19 and VS22, I tried running the commands in the "Developer Command Prompt for VS 2019" and "Developer Command Prompt for VS 2022". Everything ends in the same llvm::all_equal error.

The cmake version is 3.25.0-rc2 The ninja version is 1.11.1 The vulkan version is 1.3.236.0

Steps to reproduce your issue

  1. Checkout code from github
  2. Start Developer Command Prompt for VS 2022
  3. Navigate to iree folder
  4. cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_HOST_TRIPLE=x86_64 -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_LLVM_CPU=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON
  5. cmake --build ../iree-build/

What component(s) does this issue relate to?

Other

Version information

f19cc5b977e5210411068c820dab688cec5cc377

Additional context

No response

ScottTodd commented 1 year ago

Strange... we have a few developers and CI machines building on Windows with similar settings, but that compile error doesn't look familiar to me.

I wonder if you can build LLVM on its own, outside of IREE's CMake project? You could try from C:\Programming\iree\third_party\llvm-project using the instructions at https://llvm.org/docs/CMake.html

powderluv commented 1 year ago

yeah I tried to build IREE with clang on windows and gave up. It is a rabbit hole but it would be nice to have fixed.

If you use MSVC you will be fine. We have nightly windows releases based on IREE here: https://github.com/nod-ai/SHARK-Runtime/actions/runs/4063247358/jobs/6995260752

powderluv commented 1 year ago

Also a fork for the IREE samples repo with vulkan inferencing for arbitrary VMFB models is here: https://github.com/nod-ai/SHARK/tree/main/cpp

ScottTodd commented 1 year ago

The output from your CMake configure step could be useful (that mentions which compiler CMake is using, which options are enabled, etc.)

absorensen commented 1 year ago

@ScottTodd I looked at building LLVM following the instructions, but the directory in iree-build/third_party/llvm-project/llvm/ is missing a CMakeLists.txt or a ninja.build file to continue. Would building LLVM itself from scratch separately be of any help?

The CMake configure output is:

C:\Programming\iree>cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_HOST_TRIPLE=x86_64 -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_LLVM_CPU=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON
-- IREE HAL drivers:
--   - cuda
--   - local-sync
--   - local-task
--   - vulkan
-- IREE HAL local executable library loaders:
--   - embedded-elf
--   - system-library
--   - vmvx-module
-- IREE compiler input dialects:
--   - MHLO
--   - Torch MLIR
--   - TOSA
-- IREE compiler output formats:
--   - C source module
--   - VM Bytecode
--   - VM MLIR Assembly
-- Found Python3: $REDACTED$/miniconda3/python.exe (found version "3.9.1") found components: Interpreter
-- Looking for PyYAML - not found (some features may not be available: install with 'python -m pip install PyYAML' or equiv for your system)
CMake Warning at CMakeLists.txt:501 (message):
  IREE's regression test suite requires PyYAML to run all tests.  It is not
  installed, so some tests will be disabled.

-- Using found CUDA toolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8
-- Using CUDA libdevice: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/../nvvm/libdevice/libdevice.10.bc
-- Using CUDA INCLUDE_DIRS from found SDK: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include
-- Adding bundled LLVM source dependency
-- IREE compiler target backends:
--   - cuda
--   - llvm-cpu
--   - llvm-cpu (wasm)
--   - metal-spirv
--   - vulkan-spirv
--   - vmvx
-- Adding LLVM external project mlir-iree-dialects (MLIR_IREE_DIALECTS) -> C:/Programming/iree/llvm-external-projects/iree-dialects
-- Adding LLVM external project mlir-hlo (MLIR_HLO) -> C:/Programming/iree/third_party/mlir-hlo
-- Adding LLVM external project torch-mlir-dialects (TORCH_MLIR_DIALECTS) -> C:/Programming/iree/third_party/torch-mlir-dialects
-- bolt project is disabled
-- clang project is disabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- cross-project-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- lld project is enabled
-- lldb project is disabled
-- mlir project is enabled
-- openmp project is disabled
-- polly project is disabled
-- pstl project is disabled
-- flang project is disabled
-- mlir-iree-dialects project is enabled
-- mlir-hlo project is enabled
-- torch-mlir-dialects project is enabled
-- Found Python3:  $REDACTED$/miniconda3/python.exe (found suitable version "3.9.1", minimum required is "3.0") found components: Interpreter
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Ninja version: 1.11.1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- LLVM host triple: x86_64
-- LLVM default target triple: x86_64
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting NVPTX
-- Targeting X86
-- Targeting ARM
-- Targeting AArch64
-- Targeting RISCV
-- Targeting WebAssembly
-- LLD version: 17.0.0
-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Building iree-dialects project at C:/Programming/iree/llvm-external-projects/iree-dialects (into C:/Programming/iree-build/third_party/llvm-project/llvm/tools/mlir-iree-dialects)
-- Building MHLO as an external LLVM project
-- Building StableHLO as part of another project
-- Building torch-mlir-dialects project at C:/Programming/iree/third_party/torch-mlir-dialects (into C:/Programming/iree-build/third_party/llvm-project/llvm/tools/torch-mlir-dialects)
-- git version: v1.7.1-4-gda652a74 normalized to 1.7.1.4
-- Version: 1.7.1.4
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_STEADY_CLOCK -- success
-- SPIRV-Cross: Finding Git version for SPIRV-Cross.
-- SPIRV-Cross: Git hash: 50b4d538
-- IREE custom_dispatch/cuda/kernels ignored -- nvcc not found
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Programming/iree-build

@powderluv Thanks! I will give it a shot :)

GMNGeoffrey commented 1 year ago

Yes I believe Scott was referring to building LLVM separately following their build instructions. Note that you need to do that from the llvm source directory, not the build directory. Scott pointed to IREE's LLVM submodule, or you could make a separate clone of LLVM.

allieculp commented 1 year ago

@absorensen Assigning this to you, let us know if this is in progress or no longer active.

absorensen commented 1 year ago

Hi! Sorry for the delay. I appreciate you trying to fix it!

I restarted from scratch and got to

[4805/6551] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\StructuredTransformOpsExt.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4858/6551] Building CXX object llvm-external-projects\mlir-hlo\stablehlo\stablehlo\dialect\CMakeFiles\obj.StablehloBase.dir\Base.cpp.obj
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): note: while calling the constructor 'mlir::FailureOr<mlir::ShapedType>::FailureOr(T &&)'
        with
        [
            T=mlir::ShapedType
        ]
C:\Programming\iree\third_party\llvm-project\mlir\include\mlir/Support/LogicalResult.h(87): note: see declaration of 'mlir::FailureOr<mlir::ShapedType>::FailureOr'
[4875/6551] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorInterfaces.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4876/6551] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4878/6551] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\ScalarLoopOpInterface.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4886/6551] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[5142/6551] Building CXX object compiler\src\iree\compiler\Codegen\LLVMGPU\Utils\CMakeFiles\iree_compiler_Codegen_LLVMGPU_Utils_Utils.objects.dir\LLVMGPULayoutAnalysisAndDistribution.cpp.obj
C:\Programming\iree\compiler\src\iree\compiler\Codegen\LLVMGPU\Utils\LLVMGPULayoutAnalysisAndDistribution.cpp(132) : warning C4715: 'mlir::iree_compiler::`anonymous namespace'::getMMADimensions': not all control paths return a value
C:\Programming\iree\compiler\src\iree\compiler\Codegen\LLVMGPU\Utils\LLVMGPULayoutAnalysisAndDistribution.cpp(150) : warning C4715: 'mlir::iree_compiler::`anonymous namespace'::getMMACanonicalShape': not all control paths return a value
[5485/6551] Building CXX object runtime\src\iree\hal\drivers\vulkan\util\CMakeFiles\iree_hal_drivers_vulkan_util_intrusive_list_test.dir\intrusive_list_test.cc.obj
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(463): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::iterator_category': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(483): note: see reference to class template instantiation 'std::_Iterator_traits_base<_Iter,void>' being compiled
        with
        [
            _Iter=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6742): note: see reference to class template instantiation 'std::iterator_traits<_FwdIt>' being compiled
        with
        [
            _FwdIt=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6742): note: see reference to alias template instantiation 'std::_Iter_diff_t<_FwdIt>' being compiled
        with
        [
            _FwdIt=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>
        ]
C:\Programming\iree\runtime\src\iree\hal\drivers\vulkan\util\intrusive_list_test.cc(360): note: see reference to function template instantiation '_FwdIt std::upper_bound<IteratorT,iree::`anonymous-namespace'::Item*,bool(__cdecl *)(iree::`anonymous-namespace'::Item *,iree::`anonymous-namespace'::Item *)>(_FwdIt,_FwdIt,const _Ty &,_Pr)' being compiled
        with
        [
            _FwdIt=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>,
            IteratorT=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>,
            _Ty=iree::`anonymous-namespace'::Item *,
            _Pr=bool (__cdecl *)(iree::`anonymous-namespace'::Item *,iree::`anonymous-namespace'::Item *)
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(464): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::value_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(465): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(466): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::pointer': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(467): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::reference': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
[6253/6551] Linking CXX executable tools\iree-e2e-matmul-test.exe

Hung on the last line for well over an hour before I closed the terminal (was not reacting to ctr+c). I opened up Developer Prompt VS 2022 again and reentered cmake --build ../iree-build/. I got the following error:

C:\Programming\iree>cmake --build ../iree-build/
[0/2] Re-checking globbed directories...
[1/298] Linking CXX shared library tools\IREECompiler.dll
FAILED: tools/IREECompiler.dll lib/IREECompiler.lib
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp  /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL  -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def /MANIFEST /MANIFESTFILE:compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir/intermediate.manifest compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir/manifest.res" failed (exit code 1201) with the following output:
   Creating library lib\IREECompiler.lib and object lib\IREECompiler.exp
LINK : fatal error LNK1201: error writing to program database 'C:\Programming\iree-build\tools\IREECompiler.pdb'; check for insufficient disk space, invalid path, or insufficient privilege
ninja: build stopped: subcommand failed.

And I got it again when restarting Developer Command Prompt with admin rights.

GMNGeoffrey commented 1 year ago

@absorensen could you please try building llvm itself following the build instructions for llvm?

https://llvm.org/docs/CMake.html

This is what Scott and I are suggesting above. Your error is coming from deep within llvm and doesn't appear to relate directly to IREE. This will help us narrow down whether something is going on with the way we're configuring the llvm build, there's some kind of incompatibility between your setup and llvm, or what.

It would also be helpful if you could provide the full logs. You mentioned there were some warnings earlier on and those could help us diagnose what's going on (maybe). Could you upload the full logs to a GitHub gist or similar?

absorensen commented 1 year ago

@GMNGeoffrey Yes! I built and installed LLVM from scratch following the linked instructions. It succeeded. But I am in doubt as to how I integrate it with the iree build process.

I haven't been able to find a log file which contains the entirety of what I posted above, but I found the .ninja_log, CMakeOutput.log and CMakeError.log files and put them in a Gist -

In terms of the warnings given before 4805/6551, they were exclusively of the

cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'

variety. All other warnings are the ones posted.

GMNGeoffrey commented 1 year ago

Ok good to know. Sounds like we've got something messed up with our setup. Are you still trying to use clang-cl? As Anush said above, that's not a well lit path. We've got CI and devs using MSVC on Windows, but not clang. Apologies if that should be obvious from the logs: I'm on my phone and also not very familiar with the different options on Windows. I see it's using MSVC standard library paths, but that doesn't necessarily indicate the compiler. If so, is there a reason you want to be using clang on Windows here? We can look into this issue, but you might have a better time just using MSVC.

absorensen commented 1 year ago

No worries! I have no preference whether it is MSVC or clang. For this last run I have only used MSVC, at least that's how I interpret the configuration step:

`C:\Programming\iree>cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_HOST_TRIPLE=x86_64 -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_LLVM_CPU=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON -- The ASM compiler identification is MSVC -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx86/x86/cl.exe -- The C compiler identification is MSVC 19.35.32216.1 -- The CXX compiler identification is MSVC 19.35.32216.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx86/x86/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx86/x86/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- The ASM_MASM compiler identification is MSVC -- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx86/x86/ml.exe -- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include (found version "11.8.89") -- IREE HAL drivers: -- - cuda -- - local-sync -- - local-task -- - vulkan -- IREE HAL local executable library loaders: -- - embedded-elf -- - system-library -- - vmvx-module -- IREE HAL local executable plugin mechanisms: -- - embedded-elf -- - system-library -- IREE compiler input dialects: -- - MHLO -- - Torch MLIR -- - TOSA -- IREE compiler output formats: -- - 'vm-c': textual C source module -- - 'vm-bytecode': VM bytecode -- - 'vm-asm': VM MLIR assembly -- IREE_ENABLE_ASSERTIONS force disabled NDEBUG for CMAKE_CXX_FLAGS_RELWITHDEBINFO: '/Zi /O2 /Ob1 /DNDEBUG' -> '/Zi /O2 /Ob1 ' -- IREE_ENABLE_ASSERTIONS force disabled NDEBUG for CMAKE_C_FLAGS_RELWITHDEBINFO: '/Zi /O2 /Ob1 /DNDEBUG' -> '/Zi /O2 /Ob1 ' -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - not found -- Found Threads: TRUE -- Looking for dlopen -- Looking for dlopen - not found -- Performing Test IREE_SUPPORTS_VISIBILITY_DEFAULT -- Performing Test IREE_SUPPORTS_VISIBILITY_DEFAULT - Failed -- Found Python3: C:/Users/User/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter -- Looking for PyYAML - not found (some features may not be available: install with 'python -m pip install PyYAML' or equiv for your system) CMake Warning at CMakeLists.txt:622 (message): IREE's regression test suite requires PyYAML to run all tests. It is not installed, so some tests will be disabled.

-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.32.0.windows.2") -- Using found CUDA toolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8 -- Using CUDA libdevice: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/../nvvm/libdevice/libdevice.10.bc -- Using CUDA INCLUDE_DIRS from found SDK: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include -- Adding bundled LLVM source dependency -- IREE compiler target backends: -- - cuda -- - llvm-cpu -- - llvm-cpu (wasm) -- - metal-spirv -- - vulkan-spirv -- - vmvx -- bolt project is disabled -- clang project is enabled -- clang-tools-extra project is disabled -- compiler-rt project is disabled -- cross-project-tests project is disabled -- libc project is disabled -- libclc project is disabled -- lld project is enabled -- lldb project is disabled -- mlir project is enabled -- openmp project is disabled -- polly project is disabled -- pstl project is disabled -- flang project is disabled -- Found Python3: C:/Users/User/AppData/Local/Programs/Python/Python310/python.exe (found suitable version "3.10.6", minimum required is "3.0") found components: Interpreter -- Looking for dlfcn.h -- Looking for dlfcn.h - not found -- Looking for errno.h -- Looking for errno.h - found -- Looking for fcntl.h -- Looking for fcntl.h - found -- Looking for link.h -- Looking for link.h - not found -- Looking for malloc/malloc.h -- Looking for malloc/malloc.h - not found -- Looking for signal.h -- Looking for signal.h - found -- Looking for sys/ioctl.h -- Looking for sys/ioctl.h - not found -- Looking for sys/mman.h -- Looking for sys/mman.h - not found -- Looking for sys/param.h -- Looking for sys/param.h - not found -- Looking for sys/resource.h -- Looking for sys/resource.h - not found -- Looking for sys/stat.h -- Looking for sys/stat.h - found -- Looking for sys/time.h -- Looking for sys/time.h - not found -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for sysexits.h -- Looking for sysexits.h - not found -- Looking for termios.h -- Looking for termios.h - not found -- Looking for unistd.h -- Looking for unistd.h - not found -- Looking for valgrind/valgrind.h -- Looking for valgrind/valgrind.h - not found -- Looking for fenv.h -- Looking for fenv.h - found -- Looking for FE_ALL_EXCEPT -- Looking for FE_ALL_EXCEPT - found -- Looking for FE_INEXACT -- Looking for FE_INEXACT - found -- Looking for mach/mach.h -- Looking for mach/mach.h - not found -- Looking for CrashReporterClient.h -- Looking for CrashReporterClient.h - not found -- Looking for pfm_initialize in pfm -- Looking for pfm_initialize in pfm - not found -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) -- Looking for xar_open in xar -- Looking for xar_open in xar - not found -- Looking for arc4random -- Looking for arc4random - not found -- Looking for backtrace -- Looking for backtrace - not found -- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR) -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed -- Looking for register_frame -- Looking for __register_frame - not found -- Looking for deregister_frame -- Looking for deregister_frame - not found -- Looking for __unw_add_dynamic_fde -- Looking for unw_add_dynamic_fde - not found -- Looking for _Unwind_Backtrace -- Looking for _Unwind_Backtrace - not found -- Looking for getpagesize -- Looking for getpagesize - not found -- Looking for sysconf -- Looking for sysconf - not found -- Looking for getrusage -- Looking for getrusage - not found -- Looking for setrlimit -- Looking for setrlimit - not found -- Looking for isatty -- Looking for isatty - not found -- Looking for futimens -- Looking for futimens - not found -- Looking for futimes -- Looking for futimes - not found -- Looking for sigaltstack -- Looking for sigaltstack - not found -- Looking for mallctl -- Looking for mallctl - not found -- Looking for mallinfo -- Looking for mallinfo - not found -- Looking for mallinfo2 -- Looking for mallinfo2 - not found -- Looking for malloc_zone_statistics -- Looking for malloc_zone_statistics - not found -- Looking for getrlimit -- Looking for getrlimit - not found -- Looking for posix_spawn -- Looking for posix_spawn - not found -- Looking for pread -- Looking for pread - not found -- Looking for sbrk -- Looking for sbrk - not found -- Looking for strerror -- Looking for strerror - found -- Looking for strerror_r -- Looking for strerror_r - not found -- Looking for strerror_s -- Looking for strerror_s - found -- Looking for setenv -- Looking for setenv - not found -- Looking for _chsize_s -- Looking for _chsize_s - found -- Looking for _alloca -- Looking for _alloca - not found -- Looking for alloca -- Looking for alloca - not found -- Looking for chkstk -- Looking for chkstk - not found -- Looking for chkstk_ms -- Looking for chkstkms - not found -- Looking for chkstk -- Looking for _chkstk - not found -- Looking for _chkstk_ms -- Looking for ___chkstk_ms - not found -- Looking for ashldi3 -- Looking for ashldi3 - not found -- Looking for ashrdi3 -- Looking for ashrdi3 - not found -- Looking for divdi3 -- Looking for divdi3 - not found -- Looking for fixdfdi -- Looking for fixdfdi - not found -- Looking for fixsfdi -- Looking for fixsfdi - not found -- Looking for floatdidf -- Looking for floatdidf - not found -- Looking for lshrdi3 -- Looking for lshrdi3 - not found -- Looking for moddi3 -- Looking for moddi3 - not found -- Looking for udivdi3 -- Looking for udivdi3 - not found -- Looking for umoddi3 -- Looking for umoddi3 - not found -- Looking for main -- Looking for main - not found -- Looking for cmpdi2 -- Looking for cmpdi2 - not found -- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC -- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed -- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC -- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Failed -- Looking for GLIBC -- Looking for GLIBC__ - not found -- Looking for proc_pid_rusage -- Looking for proc_pid_rusage - not found -- Performing Test LLVM_HAS_ATOMICS -- Performing Test LLVM_HAS_ATOMICS - Success -- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG -- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Failed -- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG -- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed -- Native target architecture is X86 -- Threads enabled. -- Doxygen disabled. -- Ninja version: 1.11.1 -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) -- OCaml bindings disabled. -- Could NOT find Python module pygments -- Could NOT find Python module pygments.lexers.c_cpp -- Could NOT find Python module yaml -- LLVM host triple: x86_64 -- LLVM default target triple: x86_64 -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Performing Test HAS_WERROR_GLOBAL_CTORS -- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed -- Looking for _M_X64 -- Looking for _M_X64 - not found -- LLVMHello ignored -- Loadable modules not supported on this platform. -- Targeting NVPTX -- Targeting X86 -- Targeting ARM -- Targeting AArch64 -- Targeting RISCV -- Targeting WebAssembly -- Looking for sys/resource.h -- Looking for sys/resource.h - not found -- Clang version: 17.0.0 -- LLD version: 17.0.0 -- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION -- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Failed -- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS -- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed -- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR -- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed -- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR -- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed -- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES -- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES - Failed -- BugpointPasses ignored -- Loadable modules not supported on this platform. -- Adding LLVM external project mlir-iree-dialects -> C:/Programming/iree/llvm-external-projects/iree-dialects -- Building iree-dialects project at C:/Programming/iree/llvm-external-projects/iree-dialects (into C:/Programming/iree-build/llvm-external-projects/mlir-iree-dialects) -- Adding LLVM external project mlir-hlo -> C:/Programming/iree/third_party/mlir-hlo -- Building MHLO as an external LLVM project -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Building StableHLO as part of another project -- Adding LLVM external project torch-mlir-dialects -> C:/Programming/iree/third_party/torch-mlir-dialects -- Building torch-mlir-dialects project at C:/Programming/iree/third_party/torch-mlir-dialects (into C:/Programming/iree-build/llvm-external-projects/torch-mlir-dialects) -- Found Python: C:/Users/User/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter -- git version: v1.7.1-4-gda652a74 normalized to 1.7.1.4 -- Version: 1.7.1.4 -- Looking for shm_open in rt -- Looking for shm_open in rt - not found -- Compiling and running to test HAVE_STD_REGEX -- Performing Test HAVE_STD_REGEX -- success -- Compiling and running to test HAVE_GNU_POSIX_REGEX -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile -- Compiling and running to test HAVE_POSIX_REGEX -- Performing Test HAVE_POSIX_REGEX -- failed to compile -- Compiling and running to test HAVE_STEADY_CLOCK -- Performing Test HAVE_STEADY_CLOCK -- success -- SPIRV-Cross: Finding Git version for SPIRV-Cross. -- SPIRV-Cross: Git hash: 3550a54a -- Configuring compiler plugins -- Registering static linked compiler plugin 'example' (iree::samples::compiler_plugins::example::registration) -- Registering static linked compiler plugin 'simple_io_sample' (iree::samples::compiler_plugins::simple_io_sample::registration) -- Performing Test IREE_UK_BUILD_X86_64_AVX2_FMA -- Performing Test IREE_UK_BUILD_X86_64_AVX2_FMA - Success -- Performing Test IREE_UK_BUILD_X86_64_AVX512_BASE -- Performing Test IREE_UK_BUILD_X86_64_AVX512_BASE - Success -- Performing Test IREE_UK_BUILD_X86_64_AVX512_VNNI -- Performing Test IREE_UK_BUILD_X86_64_AVX512_VNNI - Success -- IREE custom_dispatch/cpu/plugin standalone example ignored -- #12801 required to make MSVC work -- Looking for a CUDA compiler -- Looking for a CUDA compiler - NOTFOUND -- IREE custom_dispatch/cuda/kernels ignored -- nvcc not found -- Configuring done -- Generating done -- Build files have been written to: C:/Programming/iree-build`

It's nothing critical, I was working on a technical survey of Vulkan-compatible options for inference to add machine learning to a graphics engine.

ScottTodd commented 1 year ago

This is a standard Windows build error that I see fairly regularly:

LINK : fatal error LNK1201: error writing to program database 'C:\Programming\iree-build\tools\IREECompiler.pdb'; check for insufficient disk space, invalid path, or insufficient privilege
ninja: build stopped: subcommand failed.

See https://learn.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk1201?view=msvc-170 - I typically just delete whatever .pdb file it is complaining about and re-run the build. Also check that you have enough disk space, etc. (the .pdb files can get into the 10GB+ range)

That linking is at the very end of the build, so you're pretty close.


Not sure about the [6253/6551] Linking CXX executable tools\iree-e2e-matmul-test.exe hanging, and you can mostly ignore warnings (most are from dependencies and not IREE itself).

absorensen commented 1 year ago

I tried running it again - got to here

cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4721/6550] Building CXX object llvm-external-projects\mli...nalgTransformDialect.dir\StructuredTransformOpsExt.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4775/6550] Building CXX object llvm-external-projects\mli...ehlo\dialect\CMakeFiles\obj.StablehloBase.dir\Base.cpp.obj
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): note: while calling the constructor 'mlir::FailureOr<mlir::ShapedType>::FailureOr(T &&)'
        with
        [
            T=mlir::ShapedType
        ]
C:\Programming\iree\third_party\llvm-project\mlir\include\mlir/Support/LogicalResult.h(87): note: see declaration of 'mlir::FailureOr<mlir::ShapedType>::FailureOr'
[4788/6550] Building CXX object llvm-external-projects\tor...bj.TorchMLIRTMTensorDialect.dir\TMTensorInterfaces.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4789/6550] Building CXX object llvm-external-projects\tor...s\obj.TorchMLIRTMTensorDialect.dir\TMTensorDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4793/6550] Building CXX object llvm-external-projects\tor...TorchMLIRTMTensorDialect.dir\ScalarLoopOpInterface.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4842/6550] Building CXX object llvm-external-projects\tor...Files\obj.TorchMLIRTMTensorDialect.dir\TMTensorOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[5127/6550] Building CXX object compiler\src\iree\compiler...s.objects.dir\LLVMGPULayoutAnalysisAndDistribution.cpp.obj
C:\Programming\iree\compiler\src\iree\compiler\Codegen\LLVMGPU\Utils\LLVMGPULayoutAnalysisAndDistribution.cpp(150) : warning C4715: 'mlir::iree_compiler::`anonymous namespace'::getMMACanonicalShape': not all control paths return a value
C:\Programming\iree\compiler\src\iree\compiler\Codegen\LLVMGPU\Utils\LLVMGPULayoutAnalysisAndDistribution.cpp(132) : warning C4715: 'mlir::iree_compiler::`anonymous namespace'::getMMADimensions': not all control paths return a value
[5451/6550] Linking CXX executable tools\iree-tblgen.exe
FAILED: tools/iree-tblgen.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-tblgen.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-tblgen.rsp  /out:tools\iree-tblgen.exe /implib:tools\iree-tblgen.lib /pdb:tools\iree-tblgen.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
FINAL LINK: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-tblgen.rsp /out:tools\iree-tblgen.exe /implib:tools\iree-tblgen.lib /pdb:tools\iree-tblgen.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis /MANIFEST /MANIFESTFILE:tools\CMakeFiles\iree-tblgen.dir/intermediate.manifest tools\CMakeFiles\iree-tblgen.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'tools\iree-tblgen.exe'
[5459/6550] Building CXX object runtime\src\iree\hal\drive...an_util_intrusive_list_test.dir\intrusive_list_test.cc.obj
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(463): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::iterator_category': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(483): note: see reference to class template instantiation 'std::_Iterator_traits_base<_Iter,void>' being compiled
        with
        [
            _Iter=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6742): note: see reference to class template instantiation 'std::iterator_traits<_FwdIt>' being compiled
        with
        [
            _FwdIt=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\xutility(6742): note: see reference to alias template instantiation 'std::_Iter_diff_t<_FwdIt>' being compiled
        with
        [
            _FwdIt=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>
        ]
C:\Programming\iree\runtime\src\iree\hal\drivers\vulkan\util\intrusive_list_test.cc(360): note: see reference to function template instantiation '_FwdIt std::upper_bound<IteratorT,iree::`anonymous-namespace'::Item*,bool(__cdecl *)(iree::`anonymous-namespace'::Item *,iree::`anonymous-namespace'::Item *)>(_FwdIt,_FwdIt,const _Ty &,_Pr)' being compiled
        with
        [
            _FwdIt=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>,
            IteratorT=iree::IntrusiveListIterator<iree::`anonymous-namespace'::Item,4,true>,
            _Ty=iree::`anonymous-namespace'::Item *,
            _Pr=bool (__cdecl *)(iree::`anonymous-namespace'::Item *,iree::`anonymous-namespace'::Item *)
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(464): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::value_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(465): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::difference_type': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(466): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::pointer': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32215\include\__msvc_iter_core.hpp(467): warning C4996: 'std::iterator<std::input_iterator_tag,int,ptrdiff_t,int *,int &>::reference': warning STL4015: The std::iterator class template (used as a base class to provide typedefs) is deprecated in C++17. (The <iterator> header is NOT deprecated.) The C++ Standard has never required user-defined iterators to derive from std::iterator. To fix this warning, stop deriving from std::iterator and start providing publicly accessible typedefs named iterator_category, value_type, difference_type, pointer, and reference. Note that value_type is required to be non-const, even for constant iterators. You can define _SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to suppress this warning.
[5460/6550] Building CXX object runtime\src\iree\hal\CMakeFiles\iree_hal_string_util_test.dir\string_util_test.cc.obj
ninja: build stopped: subcommand failed.

Reran it

C:\Programming\iree>cmake --build ../iree-build/
[0/2] Re-checking globbed directories...
[794/1091] Linking CXX shared library tools\IREECompiler.dll
FAILED: tools/IREECompiler.dll lib/IREECompiler.lib
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp  /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL  -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def /MANIFEST /MANIFESTFILE:compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir/intermediate.manifest compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir/manifest.res" failed (exit code 1201) with the following output:
   Creating library lib\IREECompiler.lib and object lib\IREECompiler.exp
iree_compiler_Codegen_TransformDialectStrategies_Common_TransformDialectStrategies.lib(Common.cpp.obj) : fatal error LNK1318: Unexpected PDB error; OK (0) ''
LINK : the 32-bit linker (C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe) ran out of heap space and is going to restart linking with a 64-bit linker
LINK : restarting link with 64-bit linker `C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx64\x86\link.exe'
LINK : fatal error LNK1201: error writing to program database 'C:\Programming\iree-build\tools\IREECompiler.pdb'; check for insufficient disk space, invalid path, or insufficient privilege
ninja: build stopped: subcommand failed.

Saw the .pdb error, deleted the .pdb file. Then I started it again, but this time I opened the resource monitor. As it turns out I think my 16GB of RAM is insufficient. It seems pretty maxed out on CPU utilization (100% for a long time), an eventual escalation to 97-98% RAM usage, with a growing amount committed and an almost constant SSD utilization, probably because of the lack of RAM. I tried restarting a couple of times, but I could imagine the RAM might be hampering the process too much. I think there was at least 200+ GB available on the disk at all times.

C:\Programming\iree>cmake --build ../iree-build/
[0/2] Re-checking globbed directories...
[2/298] Linking CXX executable tools\iree-mlir-lsp-server.exe
FAILED: tools/iree-mlir-lsp-server.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-mlir-lsp-server.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-mlir-lsp-server.dir\iree-mlir-lsp-server.cc.obj  /out:tools\iree-mlir-lsp-server.exe /implib:tools\iree-mlir-lsp-server.lib /pdb:tools\iree-mlir-lsp-server.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-mlir-lsp-server.dir\iree-mlir-lsp-server.cc.obj /out:tools\iree-mlir-lsp-server.exe /implib:tools\iree-mlir-lsp-server.lib /pdb:tools\iree-mlir-lsp-server.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis lib\IREECompiler.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:tools\CMakeFiles\iree-mlir-lsp-server.dir/intermediate.manifest tools\CMakeFiles\iree-mlir-lsp-server.dir/manifest.res" failed (exit code 1318) with the following output:
LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) ''
[3/298] Linking C executable tools\test-iree-compiler-api-test-binary.exe
FAILED: tools/test-iree-compiler-api-test-binary.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir\api-test-main.c.obj  /out:tools\test-iree-compiler-api-test-binary.exe /implib:compiler\src\iree\compiler\API\test\test-iree-compiler-api-test-binary.lib /pdb:tools\test-iree-compiler-api-test-binary.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir\api-test-main.c.obj /out:tools\test-iree-compiler-api-test-binary.exe /implib:compiler\src\iree\compiler\API\test\test-iree-compiler-api-test-binary.lib /pdb:tools\test-iree-compiler-api-test-binary.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis lib\IREECompiler.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir/intermediate.manifest compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir/manifest.res" failed (exit code 1318) with the following output:
LINK : fatal error LNK1318: Unexpected PDB error; RPC (23) ''
[6/298] Linking CXX executable tools\iree-opt.exe
FAILED: tools/iree-opt.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-opt.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-opt.dir\iree-opt-main.cc.obj  /out:tools\iree-opt.exe /implib:tools\iree-opt.lib /pdb:tools\iree-opt.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-opt.dir\iree-opt-main.cc.obj /out:tools\iree-opt.exe /implib:tools\iree-opt.lib /pdb:tools\iree-opt.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis lib\IREECompiler.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:tools\CMakeFiles\iree-opt.dir/intermediate.manifest tools\CMakeFiles\iree-opt.dir/manifest.res" failed (exit code 0) with the following output:

IREECompiler.lib(IREECompiler.dll) : fatal error LNK1000: Internal error during IMAGE::Pass2
[7/298] Linking CXX executable tools\iree-run-mlir.exe
FAILED: tools/iree-run-mlir.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-run-mlir.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-mlir.rsp  /out:tools\iree-run-mlir.exe /implib:tools\iree-run-mlir.lib /pdb:tools\iree-run-mlir.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-mlir.rsp /out:tools\iree-run-mlir.exe /implib:tools\iree-run-mlir.lib /pdb:tools\iree-run-mlir.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis /MANIFEST /MANIFESTFILE:tools\CMakeFiles\iree-run-mlir.dir/intermediate.manifest tools\CMakeFiles\iree-run-mlir.dir/manifest.res" failed (exit code 1318) with the following output:
 : fatal error LNK1318: Unexpected PDB error; OK (0) ''
ninja: build stopped: subcommand failed.

C:\Programming\iree>cmake --build ../iree-build/
[0/2] Re-checking globbed directories...
[1/295] Linking C executable tools\test-iree-compiler-api-test-binary.exe
FAILED: tools/test-iree-compiler-api-test-binary.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir\api-test-main.c.obj  /out:tools\test-iree-compiler-api-test-binary.exe /implib:compiler\src\iree\compiler\API\test\test-iree-compiler-api-test-binary.lib /pdb:tools\test-iree-compiler-api-test-binary.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir\api-test-main.c.obj /out:tools\test-iree-compiler-api-test-binary.exe /implib:compiler\src\iree\compiler\API\test\test-iree-compiler-api-test-binary.lib /pdb:tools\test-iree-compiler-api-test-binary.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis lib\IREECompiler.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir/intermediate.manifest compiler\src\iree\compiler\API\test\CMakeFiles\iree_compiler_API_test_api-test-binary.dir/manifest.res" failed (exit code 1318) with the following output:
IREECompiler.lib(IREECompiler.dll) : fatal error LNK1318: Unexpected PDB error; OK (0) ''
[3/295] Linking CXX executable tools\iree-mlir-lsp-server.exe
FAILED: tools/iree-mlir-lsp-server.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-mlir-lsp-server.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-mlir-lsp-server.dir\iree-mlir-lsp-server.cc.obj  /out:tools\iree-mlir-lsp-server.exe /implib:tools\iree-mlir-lsp-server.lib /pdb:tools\iree-mlir-lsp-server.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
FINAL LINK: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-mlir-lsp-server.dir\iree-mlir-lsp-server.cc.obj /out:tools\iree-mlir-lsp-server.exe /implib:tools\iree-mlir-lsp-server.lib /pdb:tools\iree-mlir-lsp-server.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis lib\IREECompiler.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:tools\CMakeFiles\iree-mlir-lsp-server.dir/intermediate.manifest tools\CMakeFiles\iree-mlir-lsp-server.dir/manifest.res" failed (exit code 0) with the following output:

MSVCRT.lib(cpu_disp.obj) : fatal error LNK1000: Internal error during IMAGE::Pass2
[4/295] Generating llvm-cpu_command_buffer_dispatch_test.bin from command_buffer_dispatch_test.mlir
FAILED: runtime/src/iree/hal/drivers/local_sync/cts/llvm-cpu_command_buffer_dispatch_test.bin C:/Programming/iree-build/runtime/src/iree/hal/drivers/local_sync/cts/llvm-cpu_command_buffer_dispatch_test.bin
cmd.exe /C "cd /D C:\Programming\iree-build\runtime\src\iree\hal\drivers\local_sync\cts && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --compile-mode=hal-executable --iree-hal-target-backends=llvm-cpu C:/Programming/iree/runtime/src/iree/hal/cts/testdata/command_buffer_dispatch_test.mlir -o llvm-cpu_command_buffer_dispatch_test.bin --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
[5/295] Generating cuda_executable_cache_test.bin from executable_cache_test.mlir
FAILED: runtime/src/iree/hal/drivers/cuda/cts/cuda_executable_cache_test.bin C:/Programming/iree-build/runtime/src/iree/hal/drivers/cuda/cts/cuda_executable_cache_test.bin
cmd.exe /C "cd /D C:\Programming\iree-build\runtime\src\iree\hal\drivers\cuda\cts && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --compile-mode=hal-executable --iree-hal-target-backends=cuda C:/Programming/iree/runtime/src/iree/hal/cts/testdata/executable_cache_test.mlir -o cuda_executable_cache_test.bin --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
[6/295] Generating iree_run_module_bytecode_module_vmvx.vmfb from iree-run-module.mlir
FAILED: tools/test/iree_run_module_bytecode_module_vmvx.vmfb C:/Programming/iree-build/tools/test/iree_run_module_bytecode_module_vmvx.vmfb
cmd.exe /C "cd /D C:\Programming\iree-build\tools\test && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --iree-hal-target-backends=vmvx C:/Programming/iree/tools/test/iree-run-module.mlir -o iree_run_module_bytecode_module_vmvx.vmfb --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
[7/295] Generating llvm-cpu_command_buffer_push_constants_test.bin from command_buffer_push_constants_test.mlir
FAILED: runtime/src/iree/hal/drivers/local_sync/cts/llvm-cpu_command_buffer_push_constants_test.bin C:/Programming/iree-build/runtime/src/iree/hal/drivers/local_sync/cts/llvm-cpu_command_buffer_push_constants_test.bin
cmd.exe /C "cd /D C:\Programming\iree-build\runtime\src\iree\hal\drivers\local_sync\cts && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --compile-mode=hal-executable --iree-hal-target-backends=llvm-cpu C:/Programming/iree/runtime/src/iree/hal/cts/testdata/command_buffer_push_constants_test.mlir -o llvm-cpu_command_buffer_push_constants_test.bin --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
[8/295] Generating cuda_command_buffer_dispatch_test.bin from command_buffer_dispatch_test.mlir
FAILED: runtime/src/iree/hal/drivers/cuda/cts/cuda_command_buffer_dispatch_test.bin C:/Programming/iree-build/runtime/src/iree/hal/drivers/cuda/cts/cuda_command_buffer_dispatch_test.bin
cmd.exe /C "cd /D C:\Programming\iree-build\runtime\src\iree\hal\drivers\cuda\cts && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --compile-mode=hal-executable --iree-hal-target-backends=cuda C:/Programming/iree/runtime/src/iree/hal/cts/testdata/command_buffer_dispatch_test.mlir -o cuda_command_buffer_dispatch_test.bin --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
[9/295] Generating cuda_command_buffer_push_constants_test.bin from command_buffer_push_constants_test.mlir
FAILED: runtime/src/iree/hal/drivers/cuda/cts/cuda_command_buffer_push_constants_test.bin C:/Programming/iree-build/runtime/src/iree/hal/drivers/cuda/cts/cuda_command_buffer_push_constants_test.bin
cmd.exe /C "cd /D C:\Programming\iree-build\runtime\src\iree\hal\drivers\cuda\cts && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --compile-mode=hal-executable --iree-hal-target-backends=cuda C:/Programming/iree/runtime/src/iree/hal/cts/testdata/command_buffer_push_constants_test.mlir -o cuda_command_buffer_push_constants_test.bin --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
[10/295] Linking CXX executable tools\iree-run-mlir.exe
ninja: build stopped: subcommand failed.
ScottTodd commented 1 year ago

16GB of RAM may be low for the linking step, yeah... you could try turning down parallelism (--jobs=1 I think?) or using a larger swap file...


IREECompiler.lib(IREECompiler.dll) : fatal error LNK1000: Internal error during IMAGE::Pass2

I saw that this morning too... fixed by deleting my build directory and rebuilding (which was fast thanks to ccache).


Sorry for all the trouble :/

absorensen commented 1 year ago

No worries! Might be time for an upgrade :)

I tried rerunning it with -j=1 and it failed pretty fast.

C:\Programming\iree>cmake --build ../iree-build/ -j=1
[0/2] Re-checking globbed directories...
[2/293] Generating iree_run_module_bytecode_module_vmvx.vmfb from iree-run-module.mlir
FAILED: tools/test/iree_run_module_bytecode_module_vmvx.vmfb C:/Programming/iree-build/tools/test/iree_run_module_bytecode_module_vmvx.vmfb
cmd.exe /C "cd /D C:\Programming\iree-build\tools\test && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --iree-hal-target-backends=vmvx C:/Programming/iree/tools/test/iree-run-module.mlir -o iree_run_module_bytecode_module_vmvx.vmfb --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""
ninja: build stopped: subcommand failed.
ScottTodd commented 1 year ago

That step is running IREE's compiler (iree-compile.exe) to generate a test file. So most of the build completed (to build iree-compile in the first place), but the tool that was built is broken? Or the command is failing somehow? There should be a way to get verbose logs from that, or you could run the command it printed directly (and hopefully get a callstack from a crash or more information about any missing files or other errors with the command itself).

absorensen commented 1 year ago

I was unable to find a flag in iree-compile.exe which resulted in any kind of message, output or log from iree-compile.exe. The list is a bit extensive, but I tried --debugify-level=locations, --iree-hal-executable-debug-level=3 and --iree-hal-executable-debug-level=0. Any suggestions?

ScottTodd commented 1 year ago

Ah sorry, I meant a way to get CMake to log output from the tool as it runs. You can try the cmake build with --verbose maybe (https://stackoverflow.com/questions/69074060/how-to-see-output-of-cmakes-add-custom-command).

CMake claims that this command failed: cmd.exe /C "cd /D C:\Programming\iree-build\tools\test && C:\Programming\iree-build\tools\iree-compile.exe --output-format=vm-bytecode --iree-hal-target-backends=vmvx C:/Programming/iree/tools/test/iree-run-module.mlir -o iree_run_module_bytecode_module_vmvx.vmfb --iree-hal-executable-object-search-path=\"C:/Programming/iree-build\" --iree-llvmcpu-embedded-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\" --iree-llvmcpu-wasm-linker-path=\"C:/Programming/iree-build/llvm-project/bin/lld.exe\""

If you run that directly (outside of CMake), I'd expect it to succeed, or at least give some output about why it failed.

Speculating/brainstorming what could be going wrong:

absorensen commented 1 year ago

Running cmake --build ../iree-build/ as cmake --build ../iree-build/ --verbose instead, I get:

[6245/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-run-module.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-module.rsp  /out:tools\iree-run-module.exe /implib:tools\iree-run-module.lib /pdb:tools\iree-run-module.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6246/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=runtime\src\iree\tooling\CMakeFiles\iree_tooling_vm_util_test.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_tooling_vm_util_test.rsp  /out:runtime\src\iree\tooling\vm_util_test.exe /implib:runtime\src\iree\tooling\vm_util_test.lib /pdb:runtime\src\iree\tooling\vm_util_test.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6247/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=runtime\src\iree\tooling\CMakeFiles\iree_tooling_numpy_io_test.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_tooling_numpy_io_test.rsp  /out:runtime\src\iree\tooling\numpy_io_test.exe /implib:runtime\src\iree\tooling\numpy_io_test.lib /pdb:runtime\src\iree\tooling\numpy_io_test.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6248/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-check-module.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-check-module.rsp  /out:tools\iree-check-module.exe /implib:tools\iree-check-module.lib /pdb:tools\iree-check-module.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6249/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=samples\variables_and_state\CMakeFiles\iree_samples_variables_and_state.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_samples_variables_and_state.rsp  /out:samples\variables_and_state\variables-and-state.exe /implib:samples\variables_and_state\variables-and-state.lib /pdb:samples\variables_and_state\variables-and-state.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6250/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-run-trace.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-trace.rsp  /out:tools\iree-run-trace.exe /implib:tools\iree-run-trace.lib /pdb:tools\iree-run-trace.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6251/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-e2e-matmul-test.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-e2e-matmul-test.rsp  /out:tools\iree-e2e-matmul-test.exe /implib:tools\iree-e2e-matmul-test.lib /pdb:tools\iree-e2e-matmul-test.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6252/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=samples\dynamic_shapes\CMakeFiles\iree_samples_dynamic_shapes.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_samples_dynamic_shapes.rsp  /out:samples\dynamic_shapes\dynamic-shapes.exe /implib:samples\dynamic_shapes\dynamic-shapes.lib /pdb:samples\dynamic_shapes\dynamic-shapes.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6253/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-benchmark-trace.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-benchmark-trace.rsp  /out:tools\iree-benchmark-trace.exe /implib:tools\iree-benchmark-trace.lib /pdb:tools\iree-benchmark-trace.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
[6254/6551] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp  /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL  -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def  && cd ."
FAILED: tools/IREECompiler.dll lib/IREECompiler.lib
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp  /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL  -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def /MANIFEST /MANIFESTFILE:compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir/intermediate.manifest compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir/manifest.res" failed (exit code 1102) with the following output:
   Creating library lib\IREECompiler.lib and object lib\IREECompiler.exp
LINK : the 32-bit linker (C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe) ran out of heap space and is going to restart linking with a 64-bit linker
LINK : fatal error LNK1102: out of memory
ninja: build stopped: subcommand failed.

After reaching that failure, running it again with cmake --build ../iree-build/ -j=1 --verbose:

C:\Programming\iree>cmake --build ../iree-build/ -j=1 --verbose
[0/2] "C:\Program Files\CMake\bin\cmake.exe" -P C:\Programming\iree-build\CMakeFiles\VerifyGlobs.cmake
[1/298] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_dll --intdir=compiler\src\iree\compiler\API\CMakeFiles\iree_compiler_API_SharedImpl.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree_compiler_API_SharedImpl.rsp  /out:tools\IREECompiler.dll /implib:lib\IREECompiler.lib /pdb:tools\IREECompiler.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL  -natvis:C:/Programming/iree/runtime/iree.natvis /DEF:C:\Programming\iree\compiler\src\iree\compiler\API\api_exports.def  && cd ."
[2/298] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-compile.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-compile.dir\iree-compile-main.cc.obj  /out:tools\iree-compile.exe /implib:tools\iree-compile.lib /pdb:tools\iree-compile.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[3/298] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-opt.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-opt.dir\iree-opt-main.cc.obj  /out:tools\iree-opt.exe /implib:tools\iree-opt.lib /pdb:tools\iree-opt.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[4/298] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-mlir-lsp-server.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo tools\CMakeFiles\iree-mlir-lsp-server.dir\iree-mlir-lsp-server.cc.obj  /out:tools\iree-mlir-lsp-server.exe /implib:tools\iree-mlir-lsp-server.lib /pdb:tools\iree-mlir-lsp-server.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  lib\IREECompiler.lib  kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
[5/298] cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-run-mlir.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-mlir.rsp  /out:tools\iree-run-mlir.exe /implib:tools\iree-run-mlir.lib /pdb:tools\iree-run-mlir.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
FAILED: tools/iree-run-mlir.exe
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=tools\CMakeFiles\iree-run-mlir.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x86\mt.exe --manifests  -- C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-mlir.rsp  /out:tools\iree-run-mlir.exe /implib:tools\iree-run-mlir.lib /pdb:tools\iree-run-mlir.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console  -natvis:C:/Programming/iree/runtime/iree.natvis  && cd ."
LINK Pass 1: command "C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\iree-run-mlir.rsp /out:tools\iree-run-mlir.exe /implib:tools\iree-run-mlir.lib /pdb:tools\iree-run-mlir.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console -natvis:C:/Programming/iree/runtime/iree.natvis /MANIFEST /MANIFESTFILE:tools\CMakeFiles\iree-run-mlir.dir/intermediate.manifest tools\CMakeFiles\iree-run-mlir.dir/manifest.res" failed (exit code 1318) with the following output:
 : fatal error LNK1318: Unexpected PDB error; OK (0) ''
ninja: build stopped: subcommand failed.

I was unsuccesful in rerunning the final command outside of cmake. But I monitored the resource usage while it was running. Disk seems to be fine (over 200GB free). It did seem to max out the RAM pretty hard. The lack of RAM (Only 16GB available) might make the linking process break at different points?

GMNGeoffrey commented 1 year ago

Yeah it sounds like you might just be running out of memory :-/ It seems like the first crash could've gotten you into a corrupted state. Could you try building only with limited jobs from the beginning? If you use ccache this may be much less painful. I bet you could hack the cmake so that it doesn't actually link the libraries also. Then you could do building at full parallelism and try linking on its own. (this is all for debugging purposes. Obviously this is not a reasonable development flow).

I think if you changed this line: https://github.com/openxla/iree/blob/5b4719709980161e82800f86ec4e2c7cc17115b6/build_tools/cmake/iree_cc_binary.cmake#L138

You could stop all the linking. I think switch target_link_libraries to add_dependencies (no PUBLIC either) and CMake would preserve the dependency graph but fail the link step.

I'd also recommend just building a single target for debugging, so:

  1. Hack CMake
  2. Configure
  3. cmake --build ../iree-build/ --target iree-compile
  4. Unhack CMake
  5. cmake --build ../iree-build --jobs=1 --target iree-compile (should reconfigure but hopefully not delete all your built stuff)

FYI I know nothing about Windwos and Scott is out this week, so responses might be delayed

benvanik commented 1 year ago
LINK : the 32-bit linker (C:\PROGRA~1\MICROS~4\2022\COMMUN~1\VC\Tools\MSVC\1435~1.322\bin\Hostx86\x86\link.exe) ran out of heap space and is going to restart linking with a 64-bit linker
LINK : fatal error LNK1102: out of memory

You'll need to use the 64-bit tools, not the 32-bit ones. You are building for a 32-bit target with the 32-bit tools. I don't know if the compiler will build on 32-bit systems (definitely not in debug mode), but that's probably not what you want anyway.

Make sure you have the amd64 toolkit selected by whatever way you're getting the tools on your path. In vscode you'll select the amd64 toolkit, or open the native x64 developer prompt ("x64 native tools command prompt for vs 2022 etc"), or pass -Thost=x64 to the prompt batch file.

You should see Hostx64\x64\link.exe or Hostx64\x86\link.exe being used, not Hostx86\....

benvanik commented 1 year ago

(also, sometimes incremental linking and pdb generation can die when a file gets over 2gb even on the x64 tools - a long known issue in msvc unfortunately - having a command line alias to delete the .exe/.pdb/.ilk in your build dir is handy)

oh neat, the /pdbpagesize:8192 linker flag may help (but I haven't tried and it does have some caveats with certain tooling that uses pdbs): https://developercommunity.visualstudio.com/t/pdb-limit-of-4-gib-is-likely-to-be-a-problem-in-a/904784#T-N1610751 I'll see if adding it to our default linker flags in https://github.com/google/iree/blob/main/build_tools/cmake/iree_copts.cmake#L372

absorensen commented 1 year ago

Damn, hadn't caught it was running x86. Windows search didn't care to find the x64 command prompt. Running x64 Native Tools Command Prompt for VS 2022 as admin made it properly find the x64 tools. The configuration step with the hacked cmake file:

C:\Programming\iree>cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_HOST_TRIPLE=x86_64 -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_LLVM_CPU=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- The C compiler identification is MSVC 19.35.32216.1
-- The CXX compiler identification is MSVC 19.35.32216.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM_MASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/ml64.exe
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include (found version "11.8.89")
-- IREE HAL drivers:
--   - cuda
--   - local-sync
--   - local-task
--   - vulkan
-- IREE HAL local executable library loaders:
--   - embedded-elf
--   - system-library
--   - vmvx-module
-- IREE HAL local executable plugin mechanisms:
--   - embedded-elf
--   - system-library
-- IREE compiler input dialects:
--   - MHLO
--   - Torch MLIR
--   - TOSA
-- IREE compiler output formats:
--   - 'vm-c': textual C source module
--   - 'vm-bytecode': VM bytecode
--   - 'vm-asm': VM MLIR assembly
-- IREE_ENABLE_ASSERTIONS force disabled NDEBUG for CMAKE_CXX_FLAGS_RELWITHDEBINFO: '/Zi /O2 /Ob1 /DNDEBUG' -> '/Zi /O2 /Ob1 '
-- IREE_ENABLE_ASSERTIONS force disabled NDEBUG for CMAKE_C_FLAGS_RELWITHDEBINFO: '/Zi /O2 /Ob1 /DNDEBUG' -> '/Zi /O2 /Ob1 '
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Looking for dlopen
-- Looking for dlopen - not found
-- Performing Test IREE_SUPPORTS_VISIBILITY_DEFAULT
-- Performing Test IREE_SUPPORTS_VISIBILITY_DEFAULT - Failed
-- Found Python3: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter
-- Looking for PyYAML - not found (some features may not be available: install with 'python -m pip install PyYAML' or equiv for your system)
CMake Warning at CMakeLists.txt:601 (message):
  IREE's regression test suite requires PyYAML to run all tests.  It is not
  installed, so some tests will be disabled.

-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.32.0.windows.2")
-- Using found CUDA toolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8
-- Using CUDA libdevice: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/../nvvm/libdevice/libdevice.10.bc
-- Using CUDA INCLUDE_DIRS from found SDK: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include
-- Adding bundled LLVM source dependency
-- IREE compiler target backends:
--   - cuda
--   - llvm-cpu
--   - llvm-cpu (wasm)
--   - metal-spirv
--   - vulkan-spirv
--   - vmvx
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/llvm/CMakeLists.txt:6 (include)

-- bolt project is disabled
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- cross-project-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- lld project is enabled
-- lldb project is disabled
-- mlir project is enabled
-- openmp project is disabled
-- polly project is disabled
-- pstl project is disabled
-- flang project is disabled
-- Found Python3: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found suitable version "3.10.6", minimum required is "3.0") found components: Interpreter
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - not found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - not found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - not found
-- Looking for sys/param.h
-- Looking for sys/param.h - not found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - not found
-- Looking for termios.h
-- Looking for termios.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Looking for __register_frame
-- Looking for __register_frame - not found
-- Looking for __deregister_frame
-- Looking for __deregister_frame - not found
-- Looking for __unw_add_dynamic_fde
-- Looking for __unw_add_dynamic_fde - not found
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - not found
-- Looking for getpagesize
-- Looking for getpagesize - not found
-- Looking for sysconf
-- Looking for sysconf - not found
-- Looking for getrusage
-- Looking for getrusage - not found
-- Looking for setrlimit
-- Looking for setrlimit - not found
-- Looking for isatty
-- Looking for isatty - not found
-- Looking for futimens
-- Looking for futimens - not found
-- Looking for futimes
-- Looking for futimes - not found
-- Looking for sigaltstack
-- Looking for sigaltstack - not found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - not found
-- Looking for mallinfo2
-- Looking for mallinfo2 - not found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - not found
-- Looking for posix_spawn
-- Looking for posix_spawn - not found
-- Looking for pread
-- Looking for pread - not found
-- Looking for sbrk
-- Looking for sbrk - not found
-- Looking for strerror_r
-- Looking for strerror_r - not found
-- Looking for strerror_s
-- Looking for strerror_s - found
-- Looking for setenv
-- Looking for setenv - not found
-- Looking for _chsize_s
-- Looking for _chsize_s - found
-- Looking for _alloca
-- Looking for _alloca - not found
-- Looking for __alloca
-- Looking for __alloca - not found
-- Looking for __chkstk
-- Looking for __chkstk - found
-- Looking for __chkstk_ms
-- Looking for __chkstk_ms - not found
-- Looking for ___chkstk
-- Looking for ___chkstk - not found
-- Looking for ___chkstk_ms
-- Looking for ___chkstk_ms - not found
-- Looking for __ashldi3
-- Looking for __ashldi3 - not found
-- Looking for __ashrdi3
-- Looking for __ashrdi3 - not found
-- Looking for __divdi3
-- Looking for __divdi3 - not found
-- Looking for __fixdfdi
-- Looking for __fixdfdi - not found
-- Looking for __fixsfdi
-- Looking for __fixsfdi - not found
-- Looking for __floatdidf
-- Looking for __floatdidf - not found
-- Looking for __lshrdi3
-- Looking for __lshrdi3 - not found
-- Looking for __moddi3
-- Looking for __moddi3 - not found
-- Looking for __udivdi3
-- Looking for __udivdi3 - not found
-- Looking for __umoddi3
-- Looking for __umoddi3 - not found
-- Looking for __main
-- Looking for __main - not found
-- Looking for __cmpdi2
-- Looking for __cmpdi2 - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Failed
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - not found
-- Looking for proc_pid_rusage
-- Looking for proc_pid_rusage - not found
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Failed
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Ninja version: 1.11.1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64
-- LLVM default target triple: x86_64
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for _M_X64
-- Looking for _M_X64 - found
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting NVPTX
-- Targeting X86
-- Targeting ARM
-- Targeting AArch64
-- Targeting RISCV
-- Targeting WebAssembly
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/clang/CMakeLists.txt:6 (include)

-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Clang version: 17.0.0
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/lld/CMakeLists.txt:6 (include)

-- LLD version: 17.0.0
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/mlir/CMakeLists.txt:7 (include)

-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Failed
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES - Failed
-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Adding LLVM external project mlir-iree-dialects -> C:/Programming/iree/llvm-external-projects/iree-dialects
-- Building iree-dialects project at C:/Programming/iree/llvm-external-projects/iree-dialects (into C:/Programming/iree-build/llvm-external-projects/mlir-iree-dialects)
-- Adding LLVM external project mlir-hlo -> C:/Programming/iree/third_party/mlir-hlo
-- Building MHLO as an external LLVM project
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Building StableHLO as part of another project
-- Adding LLVM external project torch-mlir-dialects -> C:/Programming/iree/third_party/torch-mlir-dialects
-- Building torch-mlir-dialects project at C:/Programming/iree/third_party/torch-mlir-dialects (into C:/Programming/iree-build/llvm-external-projects/torch-mlir-dialects)
-- Found Python: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter
-- git version: v1.7.1-4-gda652a74 normalized to 1.7.1.4
-- Version: 1.7.1.4
-- Looking for shm_open in rt
-- Looking for shm_open in rt - not found
-- Compiling and running to test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Compiling and running to test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- SPIRV-Cross: Finding Git version for SPIRV-Cross.
-- SPIRV-Cross: Git hash: 3550a54a
-- Configuring compiler plugins
-- Registering static linked compiler plugin 'hal_target_cuda' (iree::compiler::plugins::target::CUDA::CUDA)
-- Registering static linked compiler plugin 'example' (iree::samples::compiler_plugins::example::registration)
-- Registering static linked compiler plugin 'simple_io_sample' (iree::samples::compiler_plugins::simple_io_sample::registration)
-- IREE custom_dispatch/cpu/plugin standalone example ignored -- #12801 required to make MSVC work
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe
-- The CUDA compiler identification is NVIDIA 11.8.89
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Programming/iree-build

And now the build with unhacked cmake file - cmake --build ../iree-build -j=1 --target iree-compile.

C:\Programming\iree>cmake --build ../iree-build -j=1 --target iree-compile
[0/2] Re-checking globbed directories...
[1/2] Re-running CMake...-- IREE HAL drivers:
--   - cuda
--   - local-sync
--   - local-task
--   - vulkan
-- IREE HAL local executable library loaders:
--   - embedded-elf
--   - system-library
--   - vmvx-module
-- IREE HAL local executable plugin mechanisms:
--   - embedded-elf
--   - system-library
-- IREE compiler input dialects:
--   - MHLO
--   - Torch MLIR
--   - TOSA
-- IREE compiler output formats:
--   - 'vm-c': textual C source module
--   - 'vm-bytecode': VM bytecode
--   - 'vm-asm': VM MLIR assembly
-- Found Python3: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter
-- Looking for PyYAML - not found (some features may not be available: install with 'python -m pip install PyYAML' or equiv for your system)
CMake Warning at CMakeLists.txt:601 (message):
  IREE's regression test suite requires PyYAML to run all tests.  It is not
  installed, so some tests will be disabled.

-- Using found CUDA toolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8
-- Using CUDA libdevice: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/../nvvm/libdevice/libdevice.10.bc
-- Using CUDA INCLUDE_DIRS from found SDK: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include
-- Adding bundled LLVM source dependency
-- IREE compiler target backends:
--   - cuda
--   - llvm-cpu
--   - llvm-cpu (wasm)
--   - metal-spirv
--   - vulkan-spirv
--   - vmvx
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/llvm/CMakeLists.txt:6 (include)

-- bolt project is disabled
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- cross-project-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- lld project is enabled
-- lldb project is disabled
-- mlir project is enabled
-- openmp project is disabled
-- polly project is disabled
-- pstl project is disabled
-- flang project is disabled
-- Found Python3: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found suitable version "3.10.6", minimum required is "3.0") found components: Interpreter
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Ninja version: 1.11.1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- LLVM host triple: x86_64
-- LLVM default target triple: x86_64
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting NVPTX
-- Targeting X86
-- Targeting ARM
-- Targeting AArch64
-- Targeting RISCV
-- Targeting WebAssembly
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/clang/CMakeLists.txt:6 (include)

-- Clang version: 17.0.0
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/lld/CMakeLists.txt:6 (include)

-- LLD version: 17.0.0
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/mlir/CMakeLists.txt:7 (include)

-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Adding LLVM external project mlir-iree-dialects -> C:/Programming/iree/llvm-external-projects/iree-dialects
-- Building iree-dialects project at C:/Programming/iree/llvm-external-projects/iree-dialects (into C:/Programming/iree-build/llvm-external-projects/mlir-iree-dialects)
-- Adding LLVM external project mlir-hlo -> C:/Programming/iree/third_party/mlir-hlo
-- Building MHLO as an external LLVM project
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Building StableHLO as part of another project
-- Adding LLVM external project torch-mlir-dialects -> C:/Programming/iree/third_party/torch-mlir-dialects
-- Building torch-mlir-dialects project at C:/Programming/iree/third_party/torch-mlir-dialects (into C:/Programming/iree-build/llvm-external-projects/torch-mlir-dialects)
-- git version: v1.7.1-4-gda652a74 normalized to 1.7.1.4
-- Version: 1.7.1.4
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_STEADY_CLOCK -- success
-- SPIRV-Cross: Finding Git version for SPIRV-Cross.
-- SPIRV-Cross: Git hash: 3550a54a
-- Configuring compiler plugins
-- Registering static linked compiler plugin 'hal_target_cuda' (iree::compiler::plugins::target::CUDA::CUDA)
-- Registering static linked compiler plugin 'example' (iree::samples::compiler_plugins::example::registration)
-- Registering static linked compiler plugin 'simple_io_sample' (iree::samples::compiler_plugins::simple_io_sample::registration)
-- IREE custom_dispatch/cpu/plugin standalone example ignored -- #12801 required to make MSVC work
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Programming/iree-build

[0/2] Re-checking globbed directories...
[153/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_sse2_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_sse2_x86-64_windows_msvc.asm
[154/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_sse41_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_sse41_x86-64_windows_msvc.asm
[155/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_avx2_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_avx2_x86-64_windows_msvc.asm
[156/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_avx512_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_avx512_x86-64_windows_msvc.asm
[4610/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\CAPI\CMakeFiles\obj.IREEDialectsCAPI.dir\Dialects.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4611/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Input\CMakeFiles\obj.IREEInputDialect.dir\InputDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4612/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Input\CMakeFiles\obj.IREEInputDialect.dir\InputOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4614/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\IR\CMakeFiles\obj.IREELinalgExtDialect.dir\LinalgExtDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4615/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\IR\CMakeFiles\obj.IREELinalgExtDialect.dir\LinalgExtInterfaces.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4616/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\IR\CMakeFiles\obj.IREELinalgExtDialect.dir\LinalgExtOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4617/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\ConvertConv2DToWinograd.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4618/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\ConvertToLoops.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4619/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\DecomposeSoftmax.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4620/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\MaterializeEncoding.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4621/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\PadContractionToBlockSize.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4622/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\Passes.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4623/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\SplitReduction.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4624/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\TileAndDecomposeAttention.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4625/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\TileAndDecomposeWinogradPass.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4626/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\Tiling.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4627/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Li...\TransformOps\CMakeFiles\obj.IREELinalgExtTransformOps.dir\LinalgExtTransformOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4628/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\ForeachThreadToAsync.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4629/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Li...ansforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\ForeachThreadToSequentialFor.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4630/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Fusion.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4631/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Tiling.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4632/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Transforms.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4633/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Utils.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4634/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Utils\CMakeFiles\obj.IREELinalgExtUtils.dir\Utils.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4639/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\LinalgTransformOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4640/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\ScopedTransform.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4641/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Li...sform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\StructuredTransformOpsExt.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4642/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Li...sform\Passes\CMakeFiles\obj.IREELinalgTransformDialectPasses.dir\ExpertExpansion.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4643/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Li...\Passes\CMakeFiles\obj.IREELinalgTransformDialectPasses.dir\TransformInterpreter.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4644/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Transforms\CMakeFiles\obj.IREEDialectsTransforms.dir\ListenerCSE.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4645/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Transforms\CMakeFiles\obj.IREEDialectsTransforms.dir\TransformMatchers.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4707/5867] Building CXX object llvm-external-projects\mlir-hlo\stablehlo\stablehlo\dialect\CMakeFiles\obj.StablehloBase.dir\Base.cpp.obj
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): note: while calling the constructor 'mlir::FailureOr<mlir::ShapedType>::FailureOr(T &&)'
        with
        [
            T=mlir::ShapedType
        ]
C:\Programming\iree\third_party\llvm-project\mlir\include\mlir/Support/LogicalResult.h(87): note: see declaration of 'mlir::FailureOr<mlir::ShapedType>::FailureOr'
[4741/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4742/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorInterfaces.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4743/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4744/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\ScalarLoopOpInterface.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[5713/5867] Generating arch/x86_64_msvc.obj
 Assembling: C:/Programming/iree/runtime/src/iree/hal/local/elf/arch/x86_64_msvc.asm
[5867/5867] Linking CXX executable tools\iree-compile.exe

Aaaaaand it passed. Only took 6-ish hours.

benvanik commented 1 year ago

Unless you really have only a single core you're going to want to not pass -j=1 to use only one core during building :) On 32 cores a full clean build of the compiler takes ~4mins for me. ccache and other such things can be used to speed that up but at 4mins only when I pull and there's also been a version bump of the llvm-project submodule I don't bother - others that do more frequent LLVM bumps have more involved setups.

absorensen commented 1 year ago

Running it again with no restriction on jobs and no changes to the CMake made it run faster, but it also passed. It seems using x64 Native Tools Command Prompt for VS 2022 in admin mode does the trick on its own when dealing with very limited RAM.

C:\Programming\iree>cmake -GNinja -B ../iree-build/ -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_HOST_TRIPLE=x86_64 -DIREE_ENABLE_ASSERTIONS=ON -DIREE_HAL_DRIVER_VULKAN=ON -DIREE_TARGET_BACKEND_LLVM_CPU=ON -DIREE_TARGET_BACKEND_VULKAN_SPIRV=ON
-- The ASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe
-- The C compiler identification is MSVC 19.35.32216.1
-- The CXX compiler identification is MSVC 19.35.32216.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM_MASM compiler identification is MSVC
-- Found assembler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/ml64.exe
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include (found version "11.8.89")
-- IREE HAL drivers:
--   - cuda
--   - local-sync
--   - local-task
--   - vulkan
-- IREE HAL local executable library loaders:
--   - embedded-elf
--   - system-library
--   - vmvx-module
-- IREE HAL local executable plugin mechanisms:
--   - embedded-elf
--   - system-library
-- IREE compiler input dialects:
--   - MHLO
--   - Torch MLIR
--   - TOSA
-- IREE compiler output formats:
--   - 'vm-c': textual C source module
--   - 'vm-bytecode': VM bytecode
--   - 'vm-asm': VM MLIR assembly
-- IREE_ENABLE_ASSERTIONS force disabled NDEBUG for CMAKE_CXX_FLAGS_RELWITHDEBINFO: '/Zi /O2 /Ob1 /DNDEBUG' -> '/Zi /O2 /Ob1 '
-- IREE_ENABLE_ASSERTIONS force disabled NDEBUG for CMAKE_C_FLAGS_RELWITHDEBINFO: '/Zi /O2 /Ob1 /DNDEBUG' -> '/Zi /O2 /Ob1 '
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Looking for dlopen
-- Looking for dlopen - not found
-- Performing Test IREE_SUPPORTS_VISIBILITY_DEFAULT
-- Performing Test IREE_SUPPORTS_VISIBILITY_DEFAULT - Failed
-- Found Python3: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter
-- Looking for PyYAML - not found (some features may not be available: install with 'python -m pip install PyYAML' or equiv for your system)
CMake Warning at CMakeLists.txt:601 (message):
  IREE's regression test suite requires PyYAML to run all tests.  It is not
  installed, so some tests will be disabled.

-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.32.0.windows.2")
-- Using found CUDA toolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8
-- Using CUDA libdevice: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/../nvvm/libdevice/libdevice.10.bc
-- Using CUDA INCLUDE_DIRS from found SDK: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include
-- Adding bundled LLVM source dependency
-- IREE compiler target backends:
--   - cuda
--   - llvm-cpu
--   - llvm-cpu (wasm)
--   - metal-spirv
--   - vulkan-spirv
--   - vmvx
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/llvm/CMakeLists.txt:6 (include)

-- bolt project is disabled
-- clang project is enabled
-- clang-tools-extra project is disabled
-- compiler-rt project is disabled
-- cross-project-tests project is disabled
-- libc project is disabled
-- libclc project is disabled
-- lld project is enabled
-- lldb project is disabled
-- mlir project is enabled
-- openmp project is disabled
-- polly project is disabled
-- pstl project is disabled
-- flang project is disabled
-- Found Python3: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found suitable version "3.10.6", minimum required is "3.0") found components: Interpreter
-- Looking for dlfcn.h
-- Looking for dlfcn.h - not found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for fcntl.h
-- Looking for fcntl.h - found
-- Looking for link.h
-- Looking for link.h - not found
-- Looking for malloc/malloc.h
-- Looking for malloc/malloc.h - not found
-- Looking for signal.h
-- Looking for signal.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - not found
-- Looking for sys/mman.h
-- Looking for sys/mman.h - not found
-- Looking for sys/param.h
-- Looking for sys/param.h - not found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - not found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for sysexits.h
-- Looking for sysexits.h - not found
-- Looking for termios.h
-- Looking for termios.h - not found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Looking for valgrind/valgrind.h
-- Looking for valgrind/valgrind.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for FE_ALL_EXCEPT
-- Looking for FE_ALL_EXCEPT - found
-- Looking for FE_INEXACT
-- Looking for FE_INEXACT - found
-- Looking for mach/mach.h
-- Looking for mach/mach.h - not found
-- Looking for CrashReporterClient.h
-- Looking for CrashReporterClient.h - not found
-- Looking for pfm_initialize in pfm
-- Looking for pfm_initialize in pfm - not found
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-- Looking for xar_open in xar
-- Looking for xar_open in xar - not found
-- Looking for arc4random
-- Looking for arc4random - not found
-- Looking for backtrace
-- Looking for backtrace - not found
-- Could NOT find Backtrace (missing: Backtrace_LIBRARY Backtrace_INCLUDE_DIR)
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW
-- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Failed
-- Looking for __register_frame
-- Looking for __register_frame - not found
-- Looking for __deregister_frame
-- Looking for __deregister_frame - not found
-- Looking for __unw_add_dynamic_fde
-- Looking for __unw_add_dynamic_fde - not found
-- Looking for _Unwind_Backtrace
-- Looking for _Unwind_Backtrace - not found
-- Looking for getpagesize
-- Looking for getpagesize - not found
-- Looking for sysconf
-- Looking for sysconf - not found
-- Looking for getrusage
-- Looking for getrusage - not found
-- Looking for setrlimit
-- Looking for setrlimit - not found
-- Looking for isatty
-- Looking for isatty - not found
-- Looking for futimens
-- Looking for futimens - not found
-- Looking for futimes
-- Looking for futimes - not found
-- Looking for sigaltstack
-- Looking for sigaltstack - not found
-- Looking for mallctl
-- Looking for mallctl - not found
-- Looking for mallinfo
-- Looking for mallinfo - not found
-- Looking for mallinfo2
-- Looking for mallinfo2 - not found
-- Looking for malloc_zone_statistics
-- Looking for malloc_zone_statistics - not found
-- Looking for getrlimit
-- Looking for getrlimit - not found
-- Looking for posix_spawn
-- Looking for posix_spawn - not found
-- Looking for pread
-- Looking for pread - not found
-- Looking for sbrk
-- Looking for sbrk - not found
-- Looking for strerror_r
-- Looking for strerror_r - not found
-- Looking for strerror_s
-- Looking for strerror_s - found
-- Looking for setenv
-- Looking for setenv - not found
-- Looking for _chsize_s
-- Looking for _chsize_s - found
-- Looking for _alloca
-- Looking for _alloca - not found
-- Looking for __alloca
-- Looking for __alloca - not found
-- Looking for __chkstk
-- Looking for __chkstk - found
-- Looking for __chkstk_ms
-- Looking for __chkstk_ms - not found
-- Looking for ___chkstk
-- Looking for ___chkstk - not found
-- Looking for ___chkstk_ms
-- Looking for ___chkstk_ms - not found
-- Looking for __ashldi3
-- Looking for __ashldi3 - not found
-- Looking for __ashrdi3
-- Looking for __ashrdi3 - not found
-- Looking for __divdi3
-- Looking for __divdi3 - not found
-- Looking for __fixdfdi
-- Looking for __fixdfdi - not found
-- Looking for __fixsfdi
-- Looking for __fixsfdi - not found
-- Looking for __floatdidf
-- Looking for __floatdidf - not found
-- Looking for __lshrdi3
-- Looking for __lshrdi3 - not found
-- Looking for __moddi3
-- Looking for __moddi3 - not found
-- Looking for __udivdi3
-- Looking for __udivdi3 - not found
-- Looking for __umoddi3
-- Looking for __umoddi3 - not found
-- Looking for __main
-- Looking for __main - not found
-- Looking for __cmpdi2
-- Looking for __cmpdi2 - not found
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC - Failed
-- Looking for __GLIBC__
-- Looking for __GLIBC__ - not found
-- Looking for proc_pid_rusage
-- Looking for proc_pid_rusage - not found
-- Performing Test LLVM_HAS_ATOMICS
-- Performing Test LLVM_HAS_ATOMICS - Success
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG
-- Performing Test SUPPORTS_VARIADIC_MACROS_FLAG - Failed
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG
-- Performing Test SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG - Failed
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Ninja version: 1.11.1
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
-- OCaml bindings disabled.
-- Could NOT find Python module pygments
-- Could NOT find Python module pygments.lexers.c_cpp
-- Could NOT find Python module yaml
-- LLVM host triple: x86_64
-- LLVM default target triple: x86_64
-- Looking for os_signpost_interval_begin
-- Looking for os_signpost_interval_begin - not found
-- Performing Test HAS_WERROR_GLOBAL_CTORS
-- Performing Test HAS_WERROR_GLOBAL_CTORS - Failed
-- Looking for _M_X64
-- Looking for _M_X64 - found
-- LLVMHello ignored -- Loadable modules not supported on this platform.
-- Targeting NVPTX
-- Targeting X86
-- Targeting ARM
-- Targeting AArch64
-- Targeting RISCV
-- Targeting WebAssembly
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/clang/CMakeLists.txt:6 (include)

-- Looking for sys/resource.h
-- Looking for sys/resource.h - not found
-- Clang version: 17.0.0
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/lld/CMakeLists.txt:6 (include)

-- LLD version: 17.0.0
CMake Deprecation Warning at third_party/llvm-project/cmake/Modules/CMakePolicy.cmake:6 (cmake_policy):
  The OLD behavior for policy CMP0091 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  third_party/llvm-project/mlir/CMakeLists.txt:7 (include)

-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION
-- Performing Test C_SUPPORTS_WERROR_IMPLICIT_FUNCTION_DECLARATION - Failed
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS
-- Performing Test C_SUPPORTS_WERROR_MISMATCHED_TAGS - Failed
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test C_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR
-- Performing Test CXX_SUPPORTS_WERROR_GLOBAL_CONSTRUCTOR - Failed
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES
-- Performing Test COMPILER_SUPPORTS_WARNING_WEAK_VTABLES - Failed
-- BugpointPasses ignored -- Loadable modules not supported on this platform.
-- Adding LLVM external project mlir-iree-dialects -> C:/Programming/iree/llvm-external-projects/iree-dialects
-- Building iree-dialects project at C:/Programming/iree/llvm-external-projects/iree-dialects (into C:/Programming/iree-build/llvm-external-projects/mlir-iree-dialects)
-- Adding LLVM external project mlir-hlo -> C:/Programming/iree/third_party/mlir-hlo
-- Building MHLO as an external LLVM project
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Building StableHLO as part of another project
-- Adding LLVM external project torch-mlir-dialects -> C:/Programming/iree/third_party/torch-mlir-dialects
-- Building torch-mlir-dialects project at C:/Programming/iree/third_party/torch-mlir-dialects (into C:/Programming/iree-build/llvm-external-projects/torch-mlir-dialects)
-- Found Python: C:/Users/Anders/AppData/Local/Programs/Python/Python310/python.exe (found version "3.10.6") found components: Interpreter
-- git version: v1.7.1-4-gda652a74 normalized to 1.7.1.4
-- Version: 1.7.1.4
-- Looking for shm_open in rt
-- Looking for shm_open in rt - not found
-- Compiling and running to test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Compiling and running to test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- failed to compile
-- Compiling and running to test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- SPIRV-Cross: Finding Git version for SPIRV-Cross.
-- SPIRV-Cross: Git hash: 3550a54a
-- Configuring compiler plugins
-- Registering static linked compiler plugin 'hal_target_cuda' (iree::compiler::plugins::target::CUDA::CUDA)
-- Registering static linked compiler plugin 'example' (iree::samples::compiler_plugins::example::registration)
-- Registering static linked compiler plugin 'simple_io_sample' (iree::samples::compiler_plugins::simple_io_sample::registration)
-- IREE custom_dispatch/cpu/plugin standalone example ignored -- #12801 required to make MSVC work
-- Looking for a CUDA compiler
-- Looking for a CUDA compiler - C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe
-- The CUDA compiler identification is NVIDIA 11.8.89
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Programming/iree-build

C:\Programming\iree>cmake --build ../iree-build --target iree-compile
[0/2] Re-checking globbed directories...
[146/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_sse2_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_sse2_x86-64_windows_msvc.asm
[147/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_sse41_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_sse41_x86-64_windows_msvc.asm
[148/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_avx2_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_avx2_x86-64_windows_msvc.asm
[149/5867] Building ASM_MASM object llvm-project\lib\Support\BLAKE3\CMakeFiles\LLVMSupportBlake3.dir\blake3_avx512_x86-64_windows_msvc.asm.obj
Microsoft (R) Macro Assembler (x64) Version 14.35.32216.1
Copyright (C) Microsoft Corporation.  All rights reserved.

 Assembling: C:\Programming\iree\third_party\llvm-project\llvm\lib\Support\BLAKE3\blake3_avx512_x86-64_windows_msvc.asm
[4622/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Input\CMakeFiles\obj.IREEInputDialect.dir\InputDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4638/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\Input\CMakeFiles\obj.IREEInputDialect.dir\InputOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4658/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\CAPI\CMakeFiles\obj.IREEDialectsCAPI.dir\Dialects.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4679/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\IR\CMakeFiles\obj.IREELinalgExtDialect.dir\LinalgExtInterfaces.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4683/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\IR\CMakeFiles\obj.IREELinalgExtDialect.dir\LinalgExtDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4684/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\ConvertToLoops.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4685/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\DecomposeSoftmax.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4686/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\ConvertConv2DToWinograd.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4687/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\MaterializeEncoding.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4688/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\PadContractionToBlockSize.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4689/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\IR\CMakeFiles\obj.IREELinalgExtDialect.dir\LinalgExtOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4690/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\Passes.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4691/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\SplitReduction.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4692/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\TileAndDecomposeAttention.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4693/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\TileAndDecomposeWinogradPass.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4694/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\ForeachThreadToAsync.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4695/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\ForeachThreadToSequentialFor.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4696/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Fusion.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4697/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Utils\CMakeFiles\obj.IREELinalgExtUtils.dir\Utils.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4698/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Tiling.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4699/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Passes\CMakeFiles\obj.IREELinalgExtPasses.dir\Tiling.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4700/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Utils.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4702/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\TransformOps\CMakeFiles\obj.IREELinalgExtTransformOps.dir\LinalgExtTransformOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4703/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgExt\Transforms\CMakeFiles\obj.IREELinalgExtTransforms.dir\Transforms.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4705/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Transforms\CMakeFiles\obj.IREEDialectsTransforms.dir\ListenerCSE.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4707/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\ScopedTransform.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4710/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\Passes\CMakeFiles\obj.IREELinalgTransformDialectPasses.dir\ExpertExpansion.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4711/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\LinalgTransformOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4713/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Transforms\CMakeFiles\obj.IREEDialectsTransforms.dir\TransformMatchers.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4716/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\Passes\CMakeFiles\obj.IREELinalgTransformDialectPasses.dir\TransformInterpreter.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4720/5867] Building CXX object llvm-external-projects\mlir-iree-dialects\lib\Dialect\LinalgTransform\IR\CMakeFiles\obj.IREELinalgTransformDialect.dir\StructuredTransformOpsExt.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4770/5867] Building CXX object llvm-external-projects\mlir-hlo\stablehlo\stablehlo\dialect\CMakeFiles\obj.StablehloBase.dir\Base.cpp.obj
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied
C:\Programming\iree\third_party\mlir-hlo\stablehlo\stablehlo\dialect\Base.cpp(384): note: while calling the constructor 'mlir::FailureOr<mlir::ShapedType>::FailureOr(T &&)'
        with
        [
            T=mlir::ShapedType
        ]
C:\Programming\iree\third_party\llvm-project\mlir\include\mlir/Support/LogicalResult.h(87): note: see declaration of 'mlir::FailureOr<mlir::ShapedType>::FailureOr'
[4786/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorInterfaces.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4789/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorDialect.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4794/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\ScalarLoopOpInterface.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[4844/5867] Building CXX object llvm-external-projects\torch-mlir-dialects\lib\Dialect\TMTensor\IR\CMakeFiles\obj.TorchMLIRTMTensorDialect.dir\TMTensorOps.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[5654/5867] Generating arch/x86_64_msvc.obj
 Assembling: C:/Programming/iree/runtime/src/iree/hal/local/elf/arch/x86_64_msvc.asm
[5867/5867] Linking CXX executable tools\iree-compile.exe

C:\Programming\iree>