docs/dev/build_linux.md
The software was validated on:
NOTE: To build on CentOS 7 (64-bit), refer to Building OpenVINO on CentOS 7 Guide
Clone OpenVINO repository and init submodules:
git clone https://github.com/openvinotoolkit/openvino.git
cd openvino
git submodule update --init --recursive
(Optional) For users in China, clone submodules via gitee mirrors
chmod +x scripts/submodule_update_with_gitee.sh
./scripts/submodule_update_with_gitee.sh
Install build dependencies using the install_build_dependencies.sh script in the
project root folder.
sudo ./install_build_dependencies.sh
Create a build folder:
mkdir build && cd build
NOTE: It is recommended to disable the oneAPI environment before compiling OpenVINO from source on Linux, as it may cause build failures.
build directory, run cmake to fetch project dependencies and create Unix makefiles, then run make to build the project:
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
nproc to find the number of available processing units. For example, to use 8 parallel jobs, run the following command:
cmake --build . --parallel 8
You can use the following additional build options:
For IA32 operation systems, use ia32.linux.toolchain.cmake CMake toolchain file:
cmake -DCMAKE_TOOLCHAIN_FILE=<openvino_repo>/cmake/toolchains/ia32.linux.toolchain.cmake ..
OpenVINO offers several CMake options that can be used to build a custom OpenVINO runtime, which can speed up compilation. These options allow you to skip compilation of other plugins and frontends by disabling/enabling them. You can find a list of available options here
To build the OpenVINO Runtime Python API:
-DENABLE_PYTHON=ON option in the CMake step above (Step 4). To specify an exact Python version, use the following options (requires cmake 3.16 and higher):
-DPython3_EXECUTABLE=/usr/bin/python3.9
-DENABLE_WHEEL=ON option in the CMake step above (Step 4), and install requirements:
pip install -r <openvino source tree>/src/bindings/python/wheel/requirements-dev.txt
export PYTHONPATH=<openvino_repo>/bin/intel64/Release/python:<openvino_repo>/tools/ovc:$PYTHONPATH
export LD_LIBRARY_PATH=<openvino_repo>/bin/intel64/Release:$LD_LIBRARY_PATH
export PATH=<openvino_repo>/tools/ovc/openvino/tools/ovc:$PATH
pip install <openvino_repo>/build/wheel/openvino-2022.2.0-000-cp37-cp37-manylinux_2_35_x86_64.whl