Skip to main content
Version: Next

Setup & Dependencies

Prerequisites

Verify Prerequisite Installations

Paste this in your terminal
git --version
docker --version
Docker Dev Environment

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

Paste this in your terminal
git clone --recursive https://github.com/Ryan-Millard/Img2Num.git
cd Img2Num/

Docker

Start Docker

Paste this in your terminal
./img2num sh
About the img2num script

It 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:

Paste this in your terminal
./img2num help
Warning: Environment assumptions

In future docs, assume that the commands are to be run in the Docker terminal.

More about the img2num script

  • ./img2num pnpm <args> is a proxy to pnpm inside the Docker container's shell.

    bash title="Fuzzy find scripts local to the root project" ./img2num pnpm run help

  • ./img2num sh, ./img2num shell, and ./img2num bash all open the Docker container's interactive terminal.

    Open the Docker terminal
    ./img2num sh
  • The rest of the arguments that can be passed to the script (e.g., stop, restart, down, purge, destroy, and logs) manage the container itself.

Set up the C++ Library

All CMake commands should be run from the root of the project.

Compilation & Installation

Compilation

Compile Release build
cmake -B build-release/ .
cmake --build build-release/

Installation

The library must be compiled before you can run this command.

Install the library
cmake --install build

WebAssembly (WASM) Compilation

JavaScript Prerequisite

Excluding the documentation and CLI scripts, compiling the library to WASM is required before using the JavaScript library.

The 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.

Compile Release build
emcmake cmake -B build-wasm-release/ .
cmake --build build-wasm-release/

JavaScript

Install JavaScript dependencies

These are required for running the documentation, packages, and some example apps.

From inside the Docker terminal
pnpm install

Running a project

pnpm -F react-example dev