docs/building/windows-instructions.md
You can build ML.NET either via the command line or by using Visual Studio.
We have successfully verified the below build instructions for Visual Studio version 16.4 and higher.
The following are the minimum requirements:
The following are the minimum requirements:
If you want to cross compile for arm you will also need from the 'Individual components' section:
In order to fetch dependencies which come through Git submodules the following command needs to be run before building: git submodule update --init.
First, set up the required tools, from a (non-admin) Command Prompt window:
build.cmd - sets up tools and builds the assembliesAfter successfully running the command, the project can be built directly from the Visual Studio IDE. Tests can be executed from the VS Test Explorer or command line.
You can use the Developer Command Prompt, Powershell or work in any regular cmd. The Developer Command Prompt will have a name like "Developer Command Prompt for VS 2019" or similar in your start menu.
From a (non-admin) Command Prompt window:
build.cmd - builds the assembliesbuild.cmd -test -integrationTest - builds the assemblies and runs all tests, including integration tests.build.cmd -pack builds the assemblies and generates the corresponding NuGet packages with the assemblies in artifacts\packages"Note: Before working on individual projects or test projects you must run build.cmd from the root once before beginning that work. It is also a good idea to run build.cmd whenever you pull a large set of unknown changes into your branch.
You can use the Developer Command Prompt, Powershell or work in any regular cmd. The Developer Command Prompt will have a name like "Developer Command Prompt for VS 2019" or similar in your start menu.
From a (non-admin) Command Prompt window based on what you want to target:
build.cmd /p:TargetArchitecture=armbuild.cmd /p:TargetArchitecture=arm64You can then pack them into nugets, pick the same target architecture you built with:
build.cmd /p:TargetArchitecture=arm -packbuild.cmd /p:TargetArchitecture=arm64 -packAfter successfully building, run tests through the Visual Studio Test Explorer window.
Before running tests on Visual Studio, make sure you have selected the correct processor architecture (x64, x86) for running unit tests that your machine supports and that you have built ML.NET on. To check, click on the settings image in the Test Explorer window, then on "Process Architecture for AnyCPU Projects", and then on the correct architecture type, as demonstrated in the image below:
From root, run build.cmd -test -integrationTest.
For more details, or to test an individual project, you can navigate to the test project directory and then use dotnet test.
For more information on running ML.NET benchmarks, please visit the benchmarking instructions.
CMake 3.14 or higher is required for Visual Studio 2019.
You need to run build from the root of the repo first prior to opening the solution file and building in Visual Studio.