Skip to content

Commit

Permalink
Linux build documents update
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed May 19, 2023
1 parent 0b48fc7 commit 6c7be06
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 37 deletions.
3 changes: 1 addition & 2 deletions docs/dev/build_android.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build OpenVINO™ Runtime for Android systems

This article describes how to build Inference Engine for Android operating systems.
This article describes how to build OpenVINO Runtime for Android operating systems.

## Software requirements

Expand Down Expand Up @@ -32,7 +32,6 @@ This article describes how to build Inference Engine for Android operating syste
-DANDROID_ABI=x86_64 \
-DANDROID_PLATFORM=21 \
-DANDROID_STL=c++_shared \
-DENABLE_OPENCV=OFF

make --jobs=$(nproc --all)
```
Expand Down
23 changes: 10 additions & 13 deletions docs/dev/build_linux.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Build OpenVINO™ Runtime for Linux systems

The software was validated on:
- Ubuntu 18.04 (64-bit) with default GCC 7.5.0
- Ubuntu 20.04 (64-bit) with default GCC 9.3.0
- Red Hat Enterprise Linux 8.2 (64-bit) with default GCC 8.5.0
- Ubuntu 18.04 (x86_64, arm64) with default GCC 7.5.0
- Ubuntu 20.04 (x86_64, arm64) with default GCC 9.3.0
- Ubuntu 22.04 (x86_64, arm64) with default GCC 11.3.0
- Red Hat Enterprise Linux 8.2 (x8_64, 64-bit) with default GCC 8.5.0

> **NOTE**: To build on CentOS 7 (64-bit), refer to [Building OpenVINO on CentOS 7 Guide](https://github.com/openvinotoolkit/openvino/wiki/Building-OpenVINO-on-CentOS-7-Guide)
Expand All @@ -20,7 +21,7 @@ The software was validated on:
```sh
git clone https://github.com/openvinotoolkit/openvino.git
cd openvino
git submodule update --init --recursive
git submodule update --init
```
(Optional) For users in China, clone submodules via gitee mirrors
```sh
Expand All @@ -32,11 +33,8 @@ The software was validated on:
project root folder.
```sh
chmod +x install_build_dependencies.sh
sudo -E ./install_build_dependencies.sh
```
```sh
sudo ./install_build_dependencies.sh
```
> **NOTE**: By default, the build enables the OpenVINO Runtime GPU plugin to infer models on your Intel® Processor Graphics. This requires you to [Install Intel® Graphics Compute Runtime for OpenCL™ Driver package 19.41.14441](https://github.com/intel/compute-runtime/releases/tag/19.41.14441) 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 Compute Runtime for OpenCL™ Driver.

3. Create a build folder:
```sh
Expand All @@ -60,9 +58,9 @@ You can use the following additional build options:
```

- To build the OpenVINO Runtime Python API:
1. Install all additional packages (e.g., cython and opencv) listed in the `/src/bindings/python/src/compatibility/openvino/requirements-dev.txt` file:
1. Install all additional packages (e.g., cython and opencv) listed in the `<openvino source>/src/bindings/python/src/compatibility/openvino/requirements-dev.txt` file:
```sh
pip install -r requirements-dev.txt
pip install -r <openvino source>/src/bindings/python/src/compatibility/openvino/requirements-dev.txt
```
2. Enable the `-DENABLE_PYTHON=ON` option in the CMake step above (Step 4). To specify an exact Python version, use the following options:
```
Expand All @@ -73,8 +71,8 @@ You can use the following additional build options:
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:
```
export PYTHONPATH=PYTHONPATH:<openvino_repo>/bin/intel64/Release/python_api/python3.7
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:<openvino_repo>/bin/intel64/Release
export PYTHONPATH=PYTHONPATH:<openvino_repo>/bin/<intel64 | aarch64>/Release/python_api/python3.7
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:<openvino_repo>/bin/<intel64 | aarch64>/Release
```
or install the wheel with pip:
```
Expand All @@ -87,4 +85,3 @@ You can use the following additional build options:
* [OpenVINO Developer Documentation](index.md)
* [OpenVINO Get Started](./get_started.md)
* [How to build OpenVINO](build.md)

62 changes: 40 additions & 22 deletions docs/dev/build_raspbian.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,70 @@
# Build OpenVINO™ Runtime for Raspbian Stretch OS

> **NOTE**: [ARM CPU plugin](https://github.com/openvinotoolkit/openvino_contrib/tree/master/modules/arm_plugin) are supported. The detailed instruction how to build ARM plugin is available in [OpenVINO contrib wiki](https://github.com/openvinotoolkit/openvino_contrib/wiki/How-to-build-ARM-CPU-plugin).
## Hardware Requirements
* Raspberry Pi 2 or 3 with Raspbian Stretch OS (32 or 64-bit).

> **NOTE**: Despite the Raspberry Pi CPU is ARMv8, 32-bit OS detects ARMv7 CPU instruction set. The default `gcc` compiler applies ARMv6 architecture flag for compatibility with lower versions of boards. For more information, run the `gcc -Q --help=target` command and refer to the description of the `-march=` option.
You can compile the OpenVINO Runtime for Raspberry Pi in one of the two ways:
* [Cross Compilation](#cross-compilation), which is the recommended way
* [Native Compilation](#native-compilation), which is the simplest way, but time-consuming
* [Cross Compilation Using Docker](#cross-compilation-using-docker), which is the recommended way

## Native Compilation
Native compilation of the OpenVINO Runtime is the most straightforward solution. However, it might take at least one hour to complete on Raspberry Pi 3.
## Cross Compilation

To cross-compile OpenVINO Runtime for Raspberry Pi, you have to install build dependencies, which are local to build machine, while some product dependencies should be compiled for target architecture.

1. Install dependencies:
```bash
sudo apt-get update
sudo apt-get install -y git cmake scons build-essential
sudo apt-get install -y git cmake scons crossbuild-essential-arm64 ninja-build
```
2. Clone the repositories:
```
git clone --recurse-submodules --single-branch --branch=master https://github.com/openvinotoolkit/openvino.git
git clone --recurse-submodules --single-branch --branch=master https://github.com/openvinotoolkit/openvino_contrib.git
git clone https://github.com/openvinotoolkit/openvino.git
git submodule update --init
```
3. Go to the cloned `openvino` repository:

3. Create a build folder:
```bash
cd openvino/
mkdir build && cd build/
```
4. Create a build folder:

4. Build the OpenVINO Runtime:
```bash
mkdir build && cd build/
cmake -G Ninja -DCMAKE_TOOLCHAIN_FIlE=../cmake/arm64.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
```
5. Build the OpenVINO Runtime:
* for MYRIAD support only:
5. Install OpenVINO Compile binaries toa desired folder:
```bash
cmake -DCMAKE_BUILD_TYPE=Release \
-DOPENVINO_EXTRA_MODULES=<OPENVINO_CONTRIB_PATH>/openvino_contrib/modules/arm_plugin \
-DARM_COMPUTE_SCONS_JOBS=$(nproc --all) \
.. && cmake --build . --parallel
cmake -DCMAKE_INSTALL_PREFIX=<install folder> -P cmake_install.cmake
```

## Cross Compilation Using Docker
## Native Compilation
Native compilation of the OpenVINO Runtime is the most straightforward solution. However, it might take at least one hour to complete on Raspberry Pi 3.

To cross-compile ARM CPU plugins using pre-configured `Dockerfile` you can use the following instruction: [Build OpenCV, OpenVINO™ and the plugin using pre-configured Dockerfile](https://github.com/openvinotoolkit/openvino_contrib/wiki/How-to-build-ARM-CPU-plugin#approach-1-build-opencv-openvino-and-the-plugin-using-pre-configured-dockerfile-cross-compiling-the-preferred-way).
1. Clone the repositories:
```
git clone https://github.com/openvinotoolkit/openvino.git
git submodule update --init
```
2. Install dependencies:
```bash
chmod +x install_build_dependencies.sh
sudo -E ./install_build_dependencies.sh
```
3. Create a build folder:
```bash
cd openvino/
mkdir build && cd build/
```
4. Build the OpenVINO Runtime:
```bash
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --parallel
```
5. Install compiled OpenVINO Runtime to a desired folder:
```bash
cmake -DCMAKE_INSTALL_PREFIX=<install folder> -P cmake_install.cmake
```

## Additional Build Options

Expand All @@ -65,4 +84,3 @@ To cross-compile ARM CPU plugins using pre-configured `Dockerfile` you can use t
* [OpenVINO Developer Documentation](index.md)
* [OpenVINO Get Started](./get_started.md)
* [How to build OpenVINO](build.md)

0 comments on commit 6c7be06

Please sign in to comment.