Skip to content

BuildingForWebAssembly

Ilya Lavrenov edited this page Feb 16, 2023 · 5 revisions

Build for WebAssembly

This guide shows how to build OpenVINO for WebAssembly using Emscripten SDK. Emscripten SDK can be directly downloaded and used, but it is more easier to use the emscripten/emsdk docker image.

The approach is validated on Linux, Windows and macOS operation systems.

Table of content

Software Requirements

Build Steps

  1. (Get sources) Clone submodules:
$ git clone https://github.com/openvinotoolkit/openvino.git
$ cd openvino
$ git submodule update --init
  1. Run docker image and mount a volume with OpenVINO source code:
$  docker run -it --rm -v `pwd`:/openvino emscripten/emsdk
  1. (CMake configure) Run cmake configure step using helper emscripten command:
$ mkdir build && cd build
$ emcmake cmake -DCMAKE_BUILD_TYPE=Release /openvino
  1. (CMake build) Build OpenVINO project:
$ emmake make $(nproc)

openvino.wasm and openvino.js files are located in:

  • <openvino_source_dir>/bin/ia32/Release/ on host machine file system.
  • /openvino/bin/ia32/Release in docker environment. These files can be used in browser applications.
Clone this wiki locally