Skip to content

Getting Started

nick_tsaizer edited this page Apr 25, 2026 · 3 revisions

This page gets Tensor Planner built, tested, and packaged.

Requirements

Core native build:

  • CMake 3.20+
  • C++20 compiler

Optional binding checks:

  • .NET SDK for C# smoke tests and wrapper builds
  • Unity 2019.4+ for the Unity package
  • Jai compiler for the Jai module checks
  • x86_64-w64-mingw32-g++ for Windows cross-builds from Linux

Clone

git clone https://github.com/NickTsaizer/tensor_planner.git
cd tensor_planner

Build native library and tests

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
ctest --test-dir build --output-on-failure

The build creates the shared library and smoke-test executables:

  • tensor_planner
  • tensor_planner_solver_smoke
  • tensor_planner_logistics_smoke
  • tensor_planner_crafting_smoke
  • tensor_planner_cpp_fluent_smoke

Run C# smoke test

dotnet run --project csharp/TensorPlanner.Smoke/TensorPlanner.Smoke.csproj -c Release

The C# wrapper uses DllImport("tensor_planner"), so the native library must be discoverable by the runtime when used outside the repository's normal build/test setup.

Run Jai wrapper check

The Jai check expects native libraries in module-local locations.

cmake -S . -B build/Release-linux -DCMAKE_BUILD_TYPE=Release
cmake --build build/Release-linux --parallel
cp build/Release-linux/libtensor_planner.so modules/Tensor_Planner/generated/libtensor_planner.so
cp build/Release-linux/libtensor_planner.so modules/Tensor_Planner/libtensor_planner.so
jai modules/Tensor_Planner/tests/crafting.jai
modules/Tensor_Planner/tests/crafting

Expected behavior: the check compiles, runs, and logs a solved plan.

Build distribution artifacts

Use the POSIX package script on Linux/macOS or shells that provide sh:

sh ./build.sh -release -target unity cpp sharp jai -o ./dist

Use the PowerShell package script on Windows:

pwsh ./build.ps1 -release -os windows -target unity cpp sharp jai -o ./dist

Defaults:

  • -release is the default if neither -release nor -debug is passed.
  • target OS defaults to the host OS.
  • build-process files are cleaned after packaging unless -no-clean is passed.

Useful variants:

sh ./build.sh -target unity cpp -os linux windows -o ./dist
sh ./build.sh -debug -target cpp sharp -o ./dist -no-clean
pwsh ./build.ps1 -target unity cpp -os windows -o ./dist
pwsh ./build.ps1 -debug -target cpp sharp -o ./dist -no-clean

Output layout

Depending on selected targets, dist/ can contain:

dist/
├── cpp/       headers, native library, optional CMake config
├── sharp/     TensorPlanner.dll plus native runtime assets
├── unity/     dev.nick.tensor-planner Unity package
└── jai/       Tensor_Planner module staging

Continue to Core Concepts for the planning model.

Clone this wiki locally