Skip to content

BuildingForWindows

Ilya Lavrenov edited this page Dec 26, 2022 · 22 revisions

Build OpenVINO™ Runtime for Windows systems

Supported configurations:

  • Windows 10 or higher (64-bit) with Visual Studio 2019 or higher

Table of content:

Software Requirements

  • CMake* 3.13 or higher
  • Microsoft* Visual Studio 2019 or higher, version 16.3 or later
  • (Optional) Intel® Graphics Driver for Windows* (30.0) driver package.
  • Python 3.7 or higher for OpenVINO Runtime Python API
  • Git for Windows*

Build Steps

  1. Clone submodules:
    git clone https://github.com/openvinotoolkit/openvino.git
    cd openvino
    git submodule update --init --recursive
  2. Create build directory:
    mkdir build && cd 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=OFF CMake build option and skip the installation of the Intel® Graphics Driver.

  1. In the build directory, run cmake to fetch project dependencies and generate a Visual Studio solution.

    For Microsoft* Visual Studio 2019 x64 architecture:

    cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=Release ..

    For Microsoft* Visual Studio 2019 ARM architecture:

    cmake -G "Visual Studio 16 2019" -A ARM -DCMAKE_BUILD_TYPE=Release ..

    For Microsoft* Visual Studio 2019 ARM64 architecture:

    cmake -G "Visual Studio 16 2019" -A ARM64 -DCMAKE_BUILD_TYPE=Release ..
  2. Build generated solution in Visual Studio or run cmake --build . --config Release --verbose -j8 to build from the command line. Note that this process may take some time.

  3. 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 <openvino_repo>/temp/tbb/bin folder.

Build with Python API

  1. First, install all additional packages (e.g., cython and opencv) listed in the src\bindings\python\src\compatibility\openvino\requirements-dev.txt file:
    pip install -r requirements-dev.txt
  2. Second, enable the -DENABLE_PYTHON=ON in the CMake (Step #4) option above. To specify an exact Python version, use the following options:
    -DPYTHON_EXECUTABLE="C:\Program Files\Python37\python.exe" ^
    -DPYTHON_LIBRARY="C:\Program Files\Python37\libs\python37.lib" ^
    -DPYTHON_INCLUDE_DIR="C:\Program Files\Python37\include"
  3. To build a wheel package (.whl), enable the -DENABLE_WHEEL=ON option in the CMake step above (Step 4):
  4. After the build process finishes, export the newly built Python libraries to the user environment variables:
    set PYTHONPATH=<openvino_repo>/bin/intel64/Release/python_api/python3.7;%PYTHONPATH%
    set OPENVINO_LIB_PATH=<openvino_repo>/bin/intel64/Release;%OPENVINO_LIB_PATH%
    
    or install the wheel with pip:
    pip install <openvino_repo>/build/wheel/openvino-2022.2.0-000-cp37-cp37-win_amd64.whl
    

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 . --config Release
Clone this wiki locally