To compile OpenCV.js, we need to install Emscripten. Emscripten requires the following:
- Python 2.7
- Node.js
- cmake
- Java runtime
We can install these dependencies following the next instructions:
# Install Python sudo apt-get install python2.7 # Install node.js sudo apt-get install nodejs # Install CMake (optional, only needed for tests and building Binaryen) sudo apt-get install cmake # Install Java (optional, only needed for Closure Compiler minification) sudo apt-get install default-jre
Now, we have to download Emscripten from the GitHub repository:
# Get the emsdk repo git clone https://github.com/juj/emsdk.git # Enter that directory cd emsdk
Now, we only have to update and install the environment variables required by Emscripten and we can do that following the next steps in the command line:
# Download and install the latest SDK tools. ./emsdk install...