Setup & Dependencies
See the Quickstart for the condensed, just-driven
workflow. This page covers the full manual toolchain in detail.
Prerequisites
- Git
- Docker Desktop (recommended) or Docker Engine
Verify Prerequisite Installations
git --version
docker --version
We recommend using the Docker dev environment. Setting up the environment locally adds unnecessary complexity and is not officially supported.
If you choose to develop locally, you are responsible for configuring and maintaining your own environment.
Clone the repository
git clone --recursive https://github.com/Ryan-Millard/Img2Num.git
cd Img2Num/
If you cloned without --recursive, required dependencies will be missing.
--recursive, required dependencies will be missing.- All (optional)
- STB (required)
- Dawn (optional)
This clones all submodules:
stb(required)dawn(optional, required for local native builds)
git submodule update --init third_party
stb is always required.
git submodule update --init third_party/stb
Only needed for local native builds. The img2num-dev Docker image already has it built.
git submodule update --init third_party/dawn
Docker
Start Docker
- Linux / macOS
- Windows CMD
- PowerShell
./img2num sh
.\img2num.bat sh
.\img2num.ps1 sh
img2num scriptIt is a thin wrapper around Docker and pnpm that allows you to conveniently run scripts inside the Docker environment.
See img2num, img2num.ps1, and img2num.bat.
Using the Docker wrapper script
You can view the list of available commands by running the below in your terminal:
- Linux / macOS
- Windows CMD
- PowerShell
./img2num help
.\img2num.bat help
.\img2num.ps1 help
Elsewhere in this documentation (specifically the Internal Documentation), we assume that all commands are to be run in the Docker terminal.
Set up the C++ Library
All CMake commands should be run from the root of the project (and inside the Docker container as mentioned above).
Compilation & Installation
Compilation
- Release Build
- Debug Build
cmake -B build-release/ .
cmake --build build-release/
cmake -B build/ . -DCMAKE_BUILD_TYPE=Debug
cmake --build build/
Installation
The library must be compiled before you can run this command.
cmake --install build
WebAssembly (WASM) Compilation
Excluding the documentation and CLI scripts, compiling the library to WASM is required before using the JavaScript library.
The JavaScript example apps depend on the library, so they will also fail if you have not compiled the WASM.
This compiles the core C++ image processing library to WebAssembly using Emscripten.
- Release Build
- Debug Build
emcmake cmake -B build-wasm-release/ .
cmake --build build-wasm-release/
emcmake cmake -B build-wasm/ . -DCMAKE_BUILD_TYPE=Debug
cmake --build build-wasm/
JavaScript
Install JavaScript dependencies
These are required for running the documentation, packages, and some example apps.
pnpm install
Running a project
pnpm -F react-example dev