* Fix command for Building with Ninja Removing current directory from the command. * Update docs/dev/build_windows.md --------- Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
4.9 KiB
Build OpenVINO™ Runtime for Windows systems
OpenVINO can be compiled for different architectures on Windows: X64 or ARM64. In order to build for ARM64 architecture, the machine with Windows on ARM is required as only native compilation is supported (see similar documents for details).
Supported configurations:
- Windows 10 x86 64-bit or higher with Visual Studio 2019 or higher build for X64 architecture.
- Windows on ARM (shortly WoA) to build for ARM64 architecture. OpenVINO was validated on Windows DevKit 2023
Software requirements
- CMake 3.13 or higher
- Microsoft Visual Studio 2019 or higher, version 16.3 or later
Note
: Native Microsoft Visual Studio for WoA is available since 2022.
- Python 3.8 - 3.11 for OpenVINO Runtime Python API
Note
: Python for ARM64 is available since 3.11 version.
- [Git for Windows*]
- (Windows on ARM only) LLVM for Windows on ARM (WoA)
Note
: After installation, make sure
clang-clcompiler is available fromPATH.
How to build
Note
: By default, the build enables the OpenVINO Runtime GPU plugin to infer models on your Intel® Processor Graphics. This requires you to download and install the Intel® Graphics Driver for Windows (26.20) driver package before running the build. If you don't want to use the GPU plugin, use the
-DENABLE_INTEL_GPU=OFFCMake build option and skip the installation of the Intel® Graphics Driver.
-
Clone submodules:
git clone https://github.com/openvinotoolkit/openvino.git cd openvino git submodule update --init -
Create build directory:
mkdir build && cd build -
In the
builddirectory, runcmaketo fetch project dependencies and generate a Visual Studio solution:cmake -G "Visual Studio 17 2022" <path/to/openvino>HINT: Generating PDB Files and Debugging Your Build
If you intend to generate PDB files and debug your build, it is essential to set the CMake build type appropriately. You should utilize one of the following CMake build type options:-DCMAKE_BUILD_TYPE=RelWithDebInfo: This option generates PDB files with release information, making it suitable for debugging optimized builds.-DCMAKE_BUILD_TYPE=Debug: This option generates PDB files optimized for debugging, providing comprehensive debugging information.
-
Build generated solution in Visual Studio or run
cmake --build . --config Release --verbose -j8to build from the command line. Be aware that this process may take some time. -
Before running the samples, add paths to the Threading Building Blocks (TBB) binaries used for the build to the
%PATH%environment variable. By default, TBB binaries are downloaded by the CMake-based script to the<path/to/openvino>/temp/tbb/binfolder.
Additional Build Options
- To build the OpenVINO Runtime Python API:
- First, install all additional packages (e.g., cython) listed in the file:
pip install -r <path\to\openvino>\src\bindings\python\src\compatibility\openvino\requirements-dev.txt - Second, enable the
-DENABLE_PYTHON=ONin the CMake (Step #4) option above. To specify an exact Python version, use the following options (requires cmake 3.16 and higher):-DPython3_EXECUTABLE="C:\Program Files\Python11\python.exe" - To build a wheel package (.whl), enable the
-DENABLE_WHEEL=ONoption in the CMake step above (Step 4), and install requirements:pip install -r <openvino source tree>\src\bindings\python\wheel\requirements-dev.txt - After the build process finishes, export the newly built Python libraries to the user environment variables:
or install the wheel with pip:
set PYTHONPATH=<openvino_repo>/bin/<arch>/Release/python;%PYTHONPATH% set OPENVINO_LIB_PATHS=<openvino_repo>/bin/<arch>/Release;%OPENVINO_LIB_PATH%pip install build/wheel/openvino-2023.0.0-9612-cp11-cp11-win_arm64.whl
- First, install all additional packages (e.g., cython) listed in the file:
Building OpenVINO with Ninja* Build System
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
cmake -G Ninja -Wno-dev -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel