Core C++ utilities for building high-performance robotics and AI applications on edge devices.
- Thread-Safe Wrappers:
Locked<T>
template for protecting non-atomic types from access contention with automatic mutex management - Cache Management:
CacheManager<T>
for managing cache implementations with automatic validity checking and reset - Type Traits: Advanced C++20 type manipulation utilities and compile-time type checking
- Reference Frames: Type-safe compile-time frame management with
StaticFrame<FrameId>
- 3D Transformations: Rigid body transforms, poses, and rotations with Eigen3 integration
- Geometric Primitives: Frame references, frame concepts, and geometric constants
- Type Safety: Template-based compile-time type validation with static assertions
- Memory-Mapped I/O: Efficient file-based logging using Boost.Iostreams
- Structured Data: Cap'n Proto serialization for high-performance binary logging
- Concurrent Access: Separate reader/writer interfaces for concurrent log processing
- Configurable Storage: Customizable file sizes and storage locations
- Log Replay: Built-in log reader for data analysis and replay
- Serialization Framework: Cap'n Proto-based message serialization
- Memory-Mapped Messages:
MMappedMessageReader
for efficient message deserialization - Base Message Types: Foundation classes for building custom message protocols
- Schema Support: IDL-based message schema definitions
- Modern C++20: Full C++20 standard support with
std::span
,std::ranges
, andstd::format
- Cross-Platform: Tested on Ubuntu 22.04+ with GNU and Clang compiler support
- CMake Integration: Advanced CMake utilities for library and executable exports
- Code Quality: Integrated clang-format and clang-tidy support
- Testing Framework: GoogleTest integration with CTest runner
The following instructions have been tested on Ubuntu 22.04 and Ubuntu 24.04. Read the docker/ubuntu.dockerfile for details.
Before getting started, define three paths and ensure you have read and write permission for each. These paths are referenced throughout the rest of this document using the following tokens. Substitute your actual paths wherever these tokens appear.
Path where you will clone the nioc project. This may be a temporary directory if you only plan to build once. Examples:
"${HOME}/sandbox/nioc"
"/tmp/nioc"
Path where you will create the build tree. This may also be temporary if you are not iterating on builds. Examples:
"${SOURCE_DIR}/build"
"/tmp/nioc-build"
"${HOME}/sandbox/nioc-build"
Path where installation artifacts will be placed. Keep this directory long-term; it will contain executables, libraries, and supporting files. Examples:
"${HOME}/usr"
"${HOME}/opt"
"/opt/nioc"
(requiressudo
during the build step)"/usr"
(requiressudo
during the build step)
NOTE: The build step of nioc (which is a super-build) triggers the
download, configure, build, and install steps of all the child libraries. Hence,
sudo
is needed during the build step when installing to a location that
requires superuser privileges to write to. As a general rule prefer to install
to locations that do not require extra privileges.
NOTE: You may export these paths as environment variables in your current terminal context if you prefer
export SOURCE_TREE=${HOME}/sandbox/nioc
export BUILD_TREE=${HOME}/sandbox/nioc/build
export INSTALL_TREE=${HOME}/opt/nioc
Clone the nioc
project using the following:
git clone [email protected]:ajakhotia/nioc.git ${SOURCE_TREE}
Install jq
so that we can extract the list of system dependencies from the
systemDependencies.json file.
sudo apt install -y --no-install-recommends jq
Install cmake
. You may skip this if your OS-default cmake version is > 3.27
sudo bash tools/installCMake.sh
Install basic build tools:
sudo apt install -y --no-install-recommends \
$(sh tools/apt/extractDependencies.sh Basics systemDependencies.json)
Set up apt-sources for the latest compilers / toolchains. Prefer to skip this if the default OS-provided compilers / toolchains are new enough. Note the following constraints:
- GNU compilers >= version 12
- LLVM compilers >= version 19
- Cuda toolkit >= version 13
You are responsible for installing the appropriate compilers / toolchains yourself if you are skipping the commands below.
sudo bash tools/apt/addGNUSources.sh -y
sudo bash tools/apt/addLLVMSources.sh -y
sudo bash tools/apt/addNvidiaSources.sh -y
sudo apt update && sudo apt install -y --no-install-recommends $(sh tools/apt/extractDependencies.sh Compilers systemDependencies.json)
nioc
depends on the following external libraries:
- Boost (headers + iostreams)
- Cap'n Proto
- Eigen3
- GoogleTest
- Nlohmann JSON
- Spdlog
It's recommended to use robotFarm to build these. Here is how it can be done using the quick start instructions:
export ROBOT_FARM_INSTALL_TREE=/opt/robotFarm
curl -fsSL \
https://raw.githubusercontent.com/ajakhotia/robotFarm/refs/heads/main/tools/quickBuild.sh | \
sudo bash -s -- \
--version v1.1.0 \
--prefix ${ROBOT_FARM_INSTALL_TREE} \
--build-list "BoostExternalProject;CapnprotoExternalProject;Eigen3ExternalProject;GoogleTestExternalProject;NlohmannJsonExternalProject;SpdLogExternalProject"
For more details, see the robotFarm README.
git clone [email protected]:ajakhotia/nioc.git <SOURCE_TREE>
Use CMake (with Ninja recommended):
cmake \
-G Ninja \
-S ${SOURCE_TREE} \
-B ${BUILD_TREE} \
-DCMAKE_BUILD_TYPE:STRING="Release" \
-DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_TREE} \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_PREFIX_PATH:PATH=${ROBOT_FARM_INSTALL_TREE}
Notes:
- Set
CMAKE_BUILD_TYPE
to"Debug"
for debug builds. - Set
BUILD_SHARED_LIBS=OFF
for static builds (requires static versions of dependencies).
cmake --build <BUILD_TREE>
cmake --install <BUILD_TREE>
We welcome contributions! Please follow the project conventions when submitting PRs.
- Member variables:
mCamelCase
- Compile-time constants:
kCamelCase
- Types:
PascalCase
- Everything else (including filenames):
camelCase
CMake automatically detects clang-format-14
and creates the target niocClangFormat
.
Run it to format all C/C++ code in the repository.
Generate .clang-tidy
with:
clang-tidy-12 -checks=android-*,bugprone-*,cert-*,cppcoreguidelines-*,hicpp-*,misc-*,modernize-*,openmp-*,performance-*,portability-*,readability-* --dump-config >> .clang-tidy
Enable clang-tidy in CMake with:
-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON
-DCMAKE_CXX_CLANG_TIDY:PATH=/path/to/clang-tidy-exe
MIT Β© 2025 Anurag Jakhotia with restrictions on commercial use.