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 other languages and ecosystems: symbolic math packages, compiled simulation kernels, FMUs, or Modelica source at any pipeline stage. 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
sympydaesymbolicSymPy model classes
jaxdaesymbolicJAX functions
casadi-sx / casadi-mxdaesymbolicCasADi expressions
julia-mtkdaesymbolicModelingToolkit.jl
symforcedaesymbolicSymForce, with native AD support
onnxdaesymbolicONNX graph
rust-solve / c-solve / embedded-csolvecompiledSelf-contained simulation kernels
cuda-c / cuda-nvrtc-solve-jitsolvecompiled/JITGPU kernels
cranelift-solve-jit / mlirsolveJIT/compiledIn-process execution backends
fmi2 / fmi3solvepackagedFMU export
modelica / flat-modelica / dae-modelica / base-modelicaast/flat/daesource-transformModelica source at each stage

The rumoca targets table also reports a readiness level (0 = experimental … 2 = validated) and per-feature support columns (scalarization, matmul, linear solve, 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 sympy \
  --output /tmp/sympy_decay

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

Codegen Scenarios

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

  • examples/codegen/rum.ball_jax.toml — built-in JAX target
  • examples/codegen/rum.sympy_decay_sympy.toml — built-in SymPy target
  • examples/codegen/rum.sympy_decay_standalone_web.toml — custom web target
  • examples/codegen/rum.sympy_decay_custom_casadi.toml — raw 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.