Skip to content

Tech Stack and Build

MasterLaplace edited this page Jul 14, 2026 · 5 revisions

Tech Stack & Build

Languages & Tools

Language / Tool Usage
C++23 Full engine β€” all 20 static-library modules (-fno-rtti, -fno-exceptions; lpl-bci re-enables -fexceptions)
C17 Linux kernel module (lpl_kmod.c), network protocol
Vulkan Vulkan rendering backend, ImGui integration (optional, --renderer)
CUDA GPU physics kernels (PhysicsKernel.cu) β€” optional (--cuda), automatic CPU fallback
xmake Build system β€” orchestrates all modules as static libraries

Prerequisites

  • Linux with kernel headers (for the kernel module)
  • xmake β‰₯ 2.9.0
  • GCC 13+ or Clang 17+ (C++23 support)
  • Vulkan SDK (vulkan-headers, vulkan-loader, vulkan-hpp)
  • ImGui (auto-fetched by xmake with GLFW + Vulkan backends)
  • NVIDIA CUDA Toolkit (optional β€” automatic CPU fallback)
  • BCI dependencies (eigen, liblsl, brainflow) are auto-fetched by xmake from the official xmake-repo; brainflow is optional

Repository Layout

LplPlugin/
β”œβ”€β”€ xmake.lua             # Root orchestrator (project settings, module includes)
β”œβ”€β”€ core/                 # Platform abstraction, types, assertions
β”‚   β”œβ”€β”€ include/lpl/core/ # Public headers
β”‚   β”œβ”€β”€ src/              # Implementation
β”‚   └── xmake.lua         # Module build config (lpl-core)
β”œβ”€β”€ math/                 # Vec3, Quat, Fixed32, CORDIC, BoundaryBox
β”œβ”€β”€ memory/               # PinnedAllocator, pool allocators
β”œβ”€β”€ container/            # FlatAtomicsHashMap, Morton encoding
β”œβ”€β”€ concurrency/          # ThreadPool, SpinLock
β”œβ”€β”€ gpu/                  # CUDA lifecycle, physics kernels (inline stubs w/o nvcc)
β”œβ”€β”€ ecs/                  # EntityRegistry, Partition (SoA chunks)
β”œβ”€β”€ physics/              # WorldPartition, collision, octree
β”œβ”€β”€ net/                  # transport (kernel / socket), protocol, session, netcode
β”œβ”€β”€ input/                # InputManager (keys, axes, neural)
β”œβ”€β”€ platform/             # HW backends (clock/display/gpu-memory/input)
β”œβ”€β”€ render/               # software + Vulkan renderer, ImGui (optional)
β”œβ”€β”€ shaders/              # shader sources
β”œβ”€β”€ image/                # 2D software imaging (Surface, Painter, Codec)
β”œβ”€β”€ scene/                # scene graph (Scene, Transform2D)
β”œβ”€β”€ audio/                # Spatial audio (stub)
β”œβ”€β”€ haptic/               # Haptic feedback (stub)
β”œβ”€β”€ bci/                  # OpenBCI driver, FFT, SignalMetrics, Riemannian, calibration
β”‚   β”œβ”€β”€ include/lpl/bci/
β”‚   β”œβ”€β”€ src/
β”‚   └── tests/
β”œβ”€β”€ serial/               # state serialization & deterministic replay
β”œβ”€β”€ bench/                # benchmark harness (Harness, SystemInfo)
β”œβ”€β”€ engine/               # Top-level facade (depends on ALL modules)
β”œβ”€β”€ kernel/               # Linux kernel module (lpl_kmod.c)
β”œβ”€β”€ apps/                 # Executables
β”‚   β”œβ”€β”€ server/           # lpl-server (headless, authoritative)
β”‚   β”œβ”€β”€ client/           # lpl-client (desktop / VR)
β”‚   └── benchmark/        # lpl-benchmark (micro-benchmark suite)
└── samples/              # example code

Each module follows the pattern: <module>/include/lpl/<module>/ for public headers, <module>/src/ for implementations, with .inl files for inline function bodies.

Build Targets

Target Command Description
All xmake build -j$(nproc) Build all 20 modules + 3 executables
Server xmake build lpl-server Headless authoritative server
Client xmake build lpl-client Vulkan desktop client
Benchmark xmake build lpl-benchmark CPU benchmark (ECS, physics, containers)
Clean xmake clean Remove all build artifacts
Reconfigure xmake f -c Clean configuration and cache

Build Modes

xmake f -m debug      # Debug symbols, no optimization, LPL_DEBUG
xmake f -m release    # -O fastest, stripped, NDEBUG
xmake f -m profile    # Debug symbols + -O fastest, LPL_PROFILE

Build Options

Option Description
--renderer=y/n Enable/disable Vulkan renderer (useful for headless server)
--cuda=y/n Enable/disable CUDA GPU physics kernels

Kernel Module Targets

xmake kmod-build      # Build the lpl_kmod.ko module
xmake kmod-install    # Load the module (insmod) and set /dev/lpl0 permissions
xmake kmod-uninstall  # Unload the module (rmmod)
xmake kmod-logs       # Show recent kernel logs
xmake kmod-clean      # Clean kernel build artifacts

Running

xmake run lpl-server
xmake run lpl-client
xmake run lpl-benchmark

Compiler Flags

Flag Rationale
-fno-rtti No runtime type information β€” smaller binary, faster dispatch
-fno-exceptions No C++ exceptions β€” deterministic control flow, zero overhead
VULKAN_HPP_NO_EXCEPTIONS Vulkan C++ bindings without exceptions
-std=c++23 Concepts, std::expected, consteval, structured bindings
-Werror -Wall -Wextra Zero-tolerance for warnings

← Architecture | Next: Modules β†’

πŸ“– LplPlugin Wiki

🏠 Home


πŸ“ Project Overview

πŸ”§ Technical Reference

πŸ“Š Status & Results

πŸ—ΊοΈ Planning

πŸŽ“ Research

Clone this wiki locally