master repository for XO: cooperating set of C++ libraries for deterministic simulation
  • C++ 87.5%
  • C 6.2%
  • CMake 3.4%
  • Nix 1%
  • Objective-C++ 0.6%
  • Other 1.2%
Find a file
2026-03-03 16:45:54 +11:00
.github/workflows github: + libbsd-dev dep 2025-09-04 00:09:28 -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 xo-alloc2 xo-object: bugfix + refactor -> IGCObject_DList builds 2025-12-14 13:52:29 -05:00
etc etc/hostubuntu: update nvidia driver symlinks for 580.126.09 2026-02-18 12:18:42 -05:00
pkgs nix-build: + xo-object2 builds 2026-02-27 13:04:46 +11:00
xo-alloc xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-alloc2 xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-allocutil xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-arena xo-reader2 stack: + #q token + QuoteSsm [WIP - not functional] 2026-03-01 13:06:57 +11:00
xo-callback xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-cmake xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-distribution xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-expression xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-expression2 Merge branch 'main' into claude1 2026-02-27 22:07:46 +11:00
xo-facet Merge branch 'main' into claude1 2026-02-27 22:07:46 +11:00
xo-flatstring xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-gc xo-gc: build nit: missing #include in X1Collector.hpp 2026-02-28 13:22:21 +11:00
xo-imgui xo-imgui: compiler nit (gcc 14.3, linux, debug build) 2026-01-11 12:58:00 -05:00
xo-indentlog xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-interpreter xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-interpreter2 xo-interpreter2 stack: + dict.make() + Dictionary impl 2026-03-03 16:45:54 +11:00
xo-jit xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-kalmanfilter xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-numeric xo-numeric: + less than dispatch (also in schematika parser) 2026-02-27 22:55:14 +11:00
xo-object xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-object2 xo-interpreter2 stack: + dict.make() + Dictionary impl 2026-03-03 16:45:54 +11:00
xo-ordinaltree xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-printable2 build: + install target for idl .json5 files 2026-02-27 19:42:06 +11:00
xo-printjson xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-procedure2 xo-procedure2: + DPrimitive_gco_0 (primitive with 0 arguments) 2026-02-28 13:27:34 +11:00
xo-process xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pydistribution xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyexpression xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyjit xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pykalmanfilter xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyprintjson xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyprocess xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyreactor xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyreflect xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyrprintjson xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pysimulator xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyunit xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pyutil xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pywebsock xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-pywebutil xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-randomgen xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-ratio xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-reactor xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-reader xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-reader2 xo-interpreter2 stack: + literal array parsing 2026-03-03 12:12:09 +11:00
xo-refcnt xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-reflect xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-reflectutil xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-simulator xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-statistics xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-subsys xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-symboltable xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-tokenizer xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-tokenizer2 xo-interpreter2 stack: + literal array parsing 2026-03-03 12:12:09 +11:00
xo-unit xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-websock xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
xo-webutil xo-cmake: setup to make share target available via cmake install 2026-02-27 19:38:53 +11:00
.gitignore + .gitignore 2025-05-10 12:17:19 -05:00
CMakeLists.txt Merge branch 'main' into claude1 2026-02-27 22:07:46 +11:00
conf.py xo-alloc2: ++ documentation + threshold size for THP feature 2025-12-23 21:06:38 -05:00
default.nix nix nit: reset TMPDIR/TMP in shell4-osx for long-running emacs 2026-02-28 13:28:08 +11: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
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
README.md nix-build: shell4-osx uses clang18 2026-02-27 21:38:02 +11: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

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 + 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/

To view docs from WSL

  1. find wsl IP address
$ hostname -I
  1. run nix build
$ nix-build -A xo-userenv
  1. serve docs from some available port
$ (cd result && python3 -m http.server 3000)
  1. browse to ":3000/share/doc/xo-flatstring/html" from windows

To add a new satellite repo

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

  2. add satellite as remote

$ git remote add xo-foo git@github.com:Rconybea/xo-foo.git
$ git fetch xo-foo main
  1. checkout satellite repo
$ git subtree add --prefix=xo-foo xo-foo main