master repository for XO: cooperating set of C++ libraries for deterministic simulation
  • C++ 87.3%
  • C 6.2%
  • CMake 3.6%
  • Nix 1%
  • Objective-C++ 0.6%
  • Other 1.2%
Find a file
Roland Conybeare dbf8bb38a2 git subrepo clone (merge) git@github.com:Rconybea/xo-reader2.git xo-reader2
subrepo:
  subdir:   "xo-reader2"
  merged:   "70943b8e"
upstream:
  origin:   "git@github.com:Rconybea/xo-reader2.git"
  branch:   "main"
  commit:   "70943b8e"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:24:57 -04:00
.forgejo/workflows .forgejo workflow: + xo-imgui [CI] cmake macro refresh [PKG] 2026-06-06 20:14:50 -04:00
.github/workflows github: + libbsd-dev dep 2025-09-04 00:09:28 -04:00
.xo-pydistribution xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyexpression xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyjit xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pykalmanfilter xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyprintjson xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyprocess xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyreactor xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyreflect xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pysimulator xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyunit xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pyutil xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pywebsock xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-pywebutil xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-reader2 xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-simulator xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-statistics xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-testutil xo-testutil -> .xo-testutil (prep subrepo) 2026-06-06 21:45:30 -04:00
.xo-tokenizer xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-tokenizer2 xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-type xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-websock xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
.xo-webutil xo-XXX -> .xo-XXX (prep subrepo) 2026-06-06 22:00:54 -04:00
_static/img xo-umbrella: + docs support files 2025-06-22 16:19:21 -05:00
cmake xo-cmake: generate .build/reconfigure.sh script to rerun cmake 2026-01-11 14:05:05 -05:00
docs docs: typo! 2026-05-25 22:57:09 -04:00
etc etc/hostubuntu: update nvidia driver symlinks for 580.126.09 2026-02-18 12:18:42 -05:00
patches refactor nix: consolidate xo deps 2026-05-25 12:11:36 -04:00
pkgs nix build: + xo-imgui (!) [NIX] 2026-06-06 20:00:15 -04:00
xo-alloc git subrepo clone git@github.com:Rconybea/xo-alloc.git xo-alloc 2026-06-06 22:03:21 -04:00
xo-alloc2 xo-alloc2: cmake macros [PKG] 2026-06-06 22:01:19 -04:00
xo-allocutil git subrepo clone git@github.com:Rconybea/xo-allocutil.git xo-allocutil 2026-06-06 22:05:03 -04:00
xo-arena git subrepo push xo-arena 2026-06-06 21:39:59 -04:00
xo-callback xo-callback subrepo tidy [GIT] 2026-06-06 22:07:24 -04:00
xo-cmake git subrepo push xo-cmake 2026-06-06 21:37:42 -04:00
xo-distribution xo-distribution subrepo tidy [GIT] 2026-06-06 22:08:13 -04:00
xo-equable2 git subrepo clone git@github.com:Rconybea/xo-equable2.git xo-equable2 2026-06-06 22:08:31 -04:00
xo-expression xo-expression: + cmake macros 2026-06-06 22:09:45 -04:00
xo-expression2 xo-expression2: cmake macros [PKG] 2026-06-06 22:10:06 -04:00
xo-facet xo-facet: bootstrap macros 2026-06-06 21:42:22 -04:00
xo-flatstring git subrepo clone (merge) git@github.com:Rconybea/xo-flatstring xo-flatstring 2026-06-06 21:34:32 -04:00
xo-gc xo-gc: subrepo tidy [GIT] 2026-06-06 22:10:35 -04:00
xo-hashable2 git subrepo clone git@github.com:Rconybea/xo-hashable2.git xo-hashable2 2026-06-06 22:11:11 -04:00
xo-imgui xo-imgui: + cmake macros [PKG] 2026-06-06 22:12:27 -04:00
xo-indentlog git subrepo clone git@github.com:Rconybea/xo-indentlog.git xo-indentlog 2026-06-06 21:30:17 -04:00
xo-interpreter git subrepo clone git@github.com:Rconybea/xo-interpreter.git xo-interpreter 2026-06-06 22:12:50 -04:00
xo-interpreter2 xo-interpreter2: + cmake macros 2026-06-06 22:13:11 -04:00
xo-jit git subrepo clone git@github.com:Rconybea/xo-jit.git xo-jit 2026-06-06 22:13:26 -04:00
xo-kalmanfilter xo-kalmanfilter: cmake macros [PKG] 2026-06-06 22:13:45 -04:00
xo-numeric git subrepo clone git@github.com:Rconybea/xo-numeric.git xo-numeric 2026-06-06 22:14:02 -04:00
xo-object xo-object changes via git subrepo [GIT] 2026-06-06 22:15:16 -04:00
xo-object2 xo-object2: cmake macros [PKG] 2026-06-06 22:16:14 -04:00
xo-ordinaltree git subrepo clone git@github.com:Rconybea/xo-ordinaltree.git xo-ordinaltree 2026-06-06 22:16:36 -04:00
xo-printable2 git subrepo clone (merge) git@github.com:Rconybea/xo-printable2.git xo-printable2 2026-06-06 21:44:20 -04:00
xo-printjson xo-printjson: + cmake macros [PKG] 2026-06-06 22:16:53 -04:00
xo-procedure2 git subrepo clone git@github.com:Rconybea/xo-procedure2.git xo-procedure2 2026-06-06 22:17:11 -04:00
xo-process xo-process: next_eps() carveout 2026-06-06 22:17:48 -04:00
xo-randomgen git subrepo clone (merge) git@github.com:Rconybea/xo-randomgen.git xo-randomgen 2026-06-06 21:32:39 -04:00
xo-ratio git subrepo clone git@github.com:Rconybea/xo-ratio.git xo-ratio 2026-06-06 22:23:12 -04:00
xo-reactor xo-reactor: + cmake bootstrap [PKG] 2026-06-06 22:24:24 -04:00
xo-reader xo-reader: + cmake macros [PKG] 2026-06-06 22:24:01 -04:00
xo-reader2 git subrepo clone (merge) git@github.com:Rconybea/xo-reader2.git xo-reader2 2026-06-06 22:24:57 -04:00
xo-refcnt xo-refcnt: + cmake macros [PKG] 2026-06-06 22:18:50 -04:00
xo-reflect xo-reflecct: + cmake bootstrap [PKG] 2026-06-06 22:20:12 -04:00
xo-reflectutil git subrepo push xo-reflectutil 2026-06-06 21:38:07 -04:00
xo-stringtable2 git subrepo clone git@github.com:Rconybea/xo-stringtable2.git xo-stringtable2 2026-06-06 22:22:29 -04:00
xo-subsys git subrepo clone (merge) git@github.com:Rconybea/xo-subsys.git xo-subsys 2026-06-06 21:27:17 -04:00
xo-symboltable xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-testutil xo-testutil: cmake macros 2026-06-06 21:50:45 -04:00
xo-unit git subrepo clone git@github.com:Rconybea/xo-unit.git xo-unit 2026-06-06 22:22:52 -04:00
.clangd cosmetic: + BACKLOG.md + .clangd change 2026-03-24 22:22:20 -04:00
.gitignore .gitignore: + .projectile 2026-06-06 22:12:02 -04:00
BACKLOG.md xo-interpreter2: virtual root for VSM itself 2026-03-25 20:06:40 -04:00
ci-nxfs.nix nix build: + ci-nxfs.nix + overlay.nix [NIX] 2026-06-06 17:45:56 -04:00
ci.nix nix build: + xo-imgui (!) [NIX] 2026-06-06 20:00:15 -04:00
CMakeLists.txt nix build: + xo-expression2 2026-05-30 14:04:51 -04:00
conf.py xo-alloc2: ++ documentation + threshold size for THP feature 2025-12-23 21:06:38 -05:00
default.nix nix build: + ci-nxfs.nix + overlay.nix [NIX] 2026-06-06 17:45:56 -04:00
Doxyfile.in xo-umbrella: + docs support files 2025-06-22 16:19:21 -05:00
FAQ-DEV.md xo-objectd2 xo-printable xo-facet: pp working for List(Integer) 2026-01-09 17:48:54 -05:00
imgui.ini gitignore: + compile_commands.json (symlink) 2026-05-19 08:28:25 -04:00
index.rst xo-gc: docs build [WIP] + misc fixes + works w/ nix 2026-02-26 14:27:02 +11:00
LICENSE + docs in xo-alloc2/ + misc improvements 2025-12-11 22:18:09 -05:00
overlays.nix nix build: + xo-imgui (!) [NIX] 2026-06-06 20:00:15 -04:00
README.md docs: expand build/install instructions 2026-05-25 22:56:45 -04:00
shells.nix shells.nix: + git-subrepo 2026-06-06 21:13:17 -04:00
xo.nix nix build: + xo-imgui (!) [NIX] 2026-06-06 20:00:15 -04:00

Introduction

Local nix build for xo libraries. Intended for local development work, with source in immediate subdirectories.

Features

  • native c++
  • deterministic simulation
  • reflection
  • python bindings

Getting Started

(Alternatively, see xo-umbrella2/docs/install.rst for similar content)

Nix shell (reproducible development environment)

If nix is available, can get several reproducible build environments.

Pick one for a session:

$ cd xo-umbrella2
$ nix-shell -A shell0  # just nix stdenv: make,gcc,bash etc.
$ nix-shell -A shell1  # stable environment
$ nix-shell -A shell2  # stable environment + emacs + lsp
$ nix-shell -A shell3  # stable environment + emacs + lsp + xorg/opengl/vulkan/imgui stack (wsl2-only)
$ nix-shell -A shell4-osx  # stable environment + emacs + lsp + imgui stack (osx-only)
$ nix-shell -A shell4  # wsl2-specific. like shell3, vkcube works (at least on WSL)
$ nix-shell -A shell5  # wsl2-specific. uses dxg driver for "hardware acceleration"
$ nix-shell -A shell   # (deprecated) bleeding edge environment

Run emacs (for example) from within chosen seesion. We need this ordering because nix-shell determines vital details like location of shared libraries, including libraries used by running IDE.

$ emacs

Can use nix-shell to get reproducible environment for cmake build, see Cmake Build. Alternatively can use full nix build, see Nix Build

Cmake build

If nix is available, you probably prefer the nix build, unless working on XO itself. Otherwise continue reading..

$ PREFIX=/path/to/say/home/local
$ cd xo-umbrella2
$ (cd xo-cmake && cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -B .build -S . && cmake --install .build)
$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DXO_ENABLE_EXAMPLES=1 -DXO_ENABLE_DOCS=1 -DCMAKE_BUILD_TYPE=debug
$ cmake --build .build --verbose
$ cmake --install .build

or with Vulkan examples

$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DXO_ENABLE_EXAMPLES=1 -DXO_ENABLE_VULKAN=1

Re-run cmake

$ cd xo
$ .build/reconfigure -n
cmake -B /home/roland/proj/xo-umbrella2-claude1/.build -S /home/roland/proj/xo-umbrella2-claude1 \
    -DCMAKE_BUILD_TYPE=debug \
    -DCMAKE_INSTALL_PREFIX=/home/roland/local \
    -DCMAKE_INSTALL_DOCDIR=share/doc/xo-umbrella \
    -DCMAKE_MODULE_PATH=/home/roland/proj/xo-umbrella2/xo-cmake/cmake \
    -DCMAKE_PREFIX_PATH= \
    -DCMAKE_CXX_STANDARD=20 \
    -DXO_CMAKE_CONFIG_EXECUTABLE=/home/roland/local/bin/xo-cmake-config \
    -DENABLE_TESTING=1 \
    -DXO_ENABLE_DOCS=1 \
    -DXO_ENABLE_ASM=1 \
    -DXO_ENABLE_EXAMPLES=1 \
    -DXO_ENABLE_VULKAN=1 \
    -DXO_ENABLE_OPENGL=ON
$ .build/reconfigure  # to rerun cmake

Cmake build documentation

Documentation relies on doxygen, sphinx and breathe.

# phase 2
$ cd xo-umbrella2
$ cmake -B .build -S . -DXO_ENABLE_DOCS=1
$ cmake --build .build -- docs

Create Html docs in .build/sphinx/html/index.html

Cmake build with coverage

Prepare build

# phase 2
$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_BUILD_TYPE=coverage -DENABLE_TESTING=1
$ cmake --build .build --

Run coverage-enabled unit tests

$ (cd .build && ctest)

Generate coverage report

$ .build/gen-ccov
# or:
$ cmake --build .build --target ccov

Html report left in .build/ccov/html/index.html

Nix Build

Nix build uses toplevel default.nix, along with top-level pkgs/xo-foo.nix for each subproject foo. It doesn't interact with toplevel CMakeLists.txt.

$ nix-build -A xo-userenv

This builds all xo subprojects, assembles sandbox under ./result.

$ tree -L 1 ./result
./result
├── bin
│   ├── xo-build
│   ├── xo-cmake-config
│   └── xo-cmake-lcov-harness
└── share
    ├── cmake
    │   └── xo_macros
    │       ├── code-coverage.cmake
    │       ├── xo-project-macros.cmake
    │       └── xo_cxx.cmake
    ├── etc
    │   └── xo
    │       └── subsystem-list
    └── xo-macros
        ├── Doxyfile.in
        ├── gen-ccov.in
        └── xo-bootstrap-macros.cmake

For completeness' sake: can also use

$ nix-build -A xo-userenv-slow

Same result as $nix-build -A xo-userenv, but builds each package serially using xo-build.

Finally, can also individual XO packages:

$ nix-build -A xo.cmake
$ nix-build -A xo.indentlog
...

Nix + SDL2 + Vulkan + ImGui

Currently (Nov 2025) only affects xo-umbrella2/xo-imgui.

For OSX, imgui works with assistance from motlenvk. Build xo-imgui with

$ cd xo-umbrella2
$ nix-shell -A shell4-osx   # see xo-umrbella2/default.nix for impl

For linux and/or wsl build need extra care:

  1. must use host OS for gpu drivers. nixpkgs has drivers, but they're setup to work from nixos.
  2. want to use nixpkgs for the GPU-independent portion of graphics stack.

Complication because host gpu drivers in a "big swimming pool" such as /usr/lib/x86_64-linux-gnu/ that contains both libraries that must come from host OS (e.g. libGLX_nvidia) and libraries that must come from nixpkgs (e.g. libc)

Finesse by introducing a directory-of-symlinks, see xo-umbrella2/etc/{hostegl, hostubuntu}. These currently setup by hand, so likely to need manual attention on another host.

An ordinary cmake build may cheerfully use the host-provided graphics stack, in return for higher risk of DLL hell.

To build for ubuntu with nvidia gpu:

$ cd xo-umbrella2
$ nix-shell -A shell4-nvidia
# then regular cmake:
$ cmake -B .build -S . -DXO_ENABLE_VULKAN=1 -DXO_ENABLE_EXAMPLES=1 -DCMAKE_INSTALL_PREFIX=$PREFIX

To build for wsl:

$ cd xo-umbrella2
$ nix-shell -A shell4-wsl
# then regular cmake:
$ cmake -B .build -S . -DXO_ENABLE_VULKAN=1 -DXO_ENABLE_EXAMPLES=1 -DCMAKE_INSTALL_PREFIX=$PREFIX

Currently not supporting a nix sandbox build for xo-imgui

Directory Layout

(not in alphabetical order)

xo-umbrella2/
|
+- CMakeLists.txt                 top-level cmake config
+- cmake
|  \- xo-bootstrap-macros.cmake   configure xo cmake support for build
+- compile_commands.json          symlink to path/to/build/compile_commands.json for LSP
|
+- conf.py                        sphinx config for project documentation
+- index.rst                      root of xo-umbrella2 doc tree
+- Doxyfile.in                    doxygen config template; cmake will prepare Doxyfile in build dir
+- _static/                       static inputs to sphinx
|
+- etc
|  +- hostegl/                    sample video driver symlinks for WSL2
|  \- hostubuntu/                 sample video driver symlinks for ubuntu
|
+- default.nix                    top-level nix build (works w/ stock nixpkgs 25.05)
+- pkgs/                          per-satellite nix builds. see xo-umbrella2/default.nix
|  +- xo-callback.nix             nix build for xo-umbrella2/xo-callback
|  ..etc..
|  \- xo-webutil.nix
|
+- xo-alloc/                      xo-alloc subproject. independent git repo, using git subtree
+- xo-alloc2/                     xo-alloc2 subproject.
..etc..
\- xo-webutil/

Build/Install

See also docs/install.rst

cmake build

$ git clone https://github.com/rconybea/xo-umbrella2
$ cd xo-umbrella2
$ PREFIX=${HOME}/local  # or /usr/local or ...

# phase1 install helper scripts
$ cmake -B xo-cmake/.build -S xo-cmake -DCMAKE_INSTALL_PREFIX=$PREFIX
$ cmake --install xo-cmake/.build

# phase 2 -- configure & build XO, using helpers installed in phase 1.
# -DENABLE_TESTING=1 : builds unit tests
# -DXO_ENABLE_DOCS=1 : builds documentation; or 0 to skip
# -DXO_ENABLE_EXAMPLES=1 : builds examples; or 0 to skip
# -DXO_ENABLE_OPENGL=1 : builds opengl examples; or 0 to skip
# -DXO_ENABLE_VULKAN=1 : builds vulkan-dependent graphics pipeline for imgui; or 0 to skip
$ cmake -B .build -S . -DCMAKE_INSTALL_PREFIX=$PREFIX -DXO_ENABLE_DOCS=1 -DXO_ENABLE_EXAMPLES=1 -DXO_ENABLE_VULKAN=1
$ cmake --build .build -j

# optionally build docs
$ cmake --build .build -- docs

# install
$ cmake --install .build

nix build

$ nix-build -A xo-userenv

output now in ./result

To view docs locally

find local IP address

wsl:

$ hostname -I

linux

$ /usr/sbin/ifconfig -a

run nix build

$ nix-build -A xo-userenv

serve docs from some available port

$ (cd result && python3 -m http.server 3000)

browse to ":3000/share/doc/xo-flatstring/html"

To add a new satellite repo / missing satellite remote

  1. check clone in clean state (all local changes committed or unwound)

  2. add satellite as remote

$ xo-build -n --add-umbrella-remote xo-foo
git remote add xo-cmake git@github.com:Rconybea/xo-cmake.git
$ xo-build --add-umbrella-remote xo-foo
  1. fetch (for hygiene)
$ git fetch xo-foo main
  1. add subtree to local sandbox
$ git subtree add --prefix=xo-foo xo-foo main

To push changes to satellite repos

We use an explicit branch for each satellite

$ git branch --show-current
main

$ xo-build -n --push-umbrella-remote xo-foo
git subtree split --rejoin --prefix=xo-foo -b _demux/xo-foo
git push xo-foo _demux/xo-foo:main

$ xo-build --push-umbrella-remote xo-foo

To pull changes from satellite repos

$ xo-build -n --pull-umbrella-remote xo-foo
git subtree pull xo-foo main --rejoin
$ xo-build --pull-umbrella-remote xo-foo