Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Targets and Templates

Rumoca can render a compiled model into symbolic frameworks, compiled simulation kernels, eFMI artifacts, or Modelica source. Code generation is target-directory based: a target is a target.toml manifest plus Jinja templates, and each target declares which compiler IR stage it consumes.

Listing Targets

rumoca targets

Built-in targets include:

TargetIRModeOutput
casadi-odesolvesymbolicDifferentiable CasADi explicit RHS
jax-odesolvesymbolicJIT/AD-capable JAX explicit RHS
rust-fixed-odesolvecompiledFixed-size, allocation-free Rust explicit-ODE derivative kernel
rust-ode / c-odesolvecompiledChecked explicit-ODE derivative kernels
cuda-odesolvecompiledBatched CUDA explicit-ODE derivative kernel
wgsl-odesolveJITExperimental WebGPU explicit-ODE kernels for browser execution
mlirsolvesourceInspectible MLIR solve-kernel source with affine tensor loops
flat-modelica / base-modelicaflatsource-transformFlattened Modelica-family interchange artifacts
dae-modelicadaesource-transformModelica representation of the checked DAE
fmi2 / fmi3fmistandards containerSource-code Model Exchange and Co-Simulation FMUs
fmi-ls-wasmfmicompiled componentExperimental FMI-LS WebAssembly component crate
galec / galec-productionalgorithm-codeeFMIAlgorithm Code and Production Code eFMU containers
embedded-c-galecalgorithm-codecompiledGALEC-derived embedded C without an eFMI container

Targets without a complete checked artifact and executable or independent validation evidence are intentionally absent. Rumoca does not expose aliases for removed target names or route those names through a weaker IR.

The rumoca targets table also reports a readiness level (0 = experimental … 2 = validated) and per-feature support columns (scalarization, tensor features such as matmul/linear solve/elementwise/stencil kernels, events, AD, …) for each target. Treat the table — not this page — as the current source of truth.

Rendering a Target

rumoca compile examples/models/SympyDecay.mo \
  --model SympyDecay \
  --target c-ode \
  --output /tmp/decay_c_ode

--output may be a file or directory depending on what the target renders.

Codegen Scenarios

Like simulations, generation jobs worth repeating belong in a rumoca-scenario.toml with task = "codegen". Runnable examples live under examples/codegen/ and write into examples/codegen/gen/ (git-ignored):

  • examples/codegen/rumoca-scenario.sympy_decay_jax_ode.toml — checked ODE RHS JAX target
  • examples/codegen/rumoca-scenario.sympy_decay_c_ode.toml — checked ODE RHS C target
  • examples/codegen/rumoca-scenario.sympy_decay_checked_dae_report.toml — custom checked-DAE report target
  • examples/codegen/rumoca-scenario.sympy_decay_custom_checked_variables.toml — raw checked-DAE Jinja template

IR Dumps vs Targets

If what you want is to see a compiler stage rather than generate project code, use --emit instead of a target — see Inspecting and Debugging Models.