View on GitHub

OdbDesign ODB++ Parser

REST API and C++ library for parsing ODB++ Design archives

Build Instructions

Building from Source

Documentation for the currently-released version of the source code is available here.

Build Dependencies

If you are building on Windows and have a modern version of Visual Studio installed then all of the dependencies listed below are already installed on your system (except for maybe Docker). You can skip to the next section.

If you are building on a Linux system then the dependencies listed below can be installed using your package manager. For example on Ubuntu you can install them (except for vcpkg and Docker) using the following command:

$ sudo apt install git cmake ninja-build build-essential

git, CMake, and ninja can all be installed via the sudo apt install command listed above. vcpkg can be installed by following the instructions below. Docker is optional but can be installed via the following command:

$ sudo apt install docker.io docker-compose-v2

vcpkg

$ git clone https://github.com/microsoft/vcpkg
$ .\vcpkg\bootstrap-vcpkg.bat

Then add the following line to your shell profile (e.g. ~/.bashrc, ~/.zshrc, etc.):

export VCPKG_ROOT=/path/to/vcpkg

Make sure to restart your shell or source the profile after adding the line.

source ~/.bashrc

Automated Setup (Linux Only)

For Linux users, you can use the automated setup script that handles all dependencies and configuration:

⚠️ Security Warning: Running scripts from the internet can execute arbitrary code on your system! Always verify scripts are safe before running them. Since this script is open-source, you can view the entire contents at: https://github.com/nam20485/OdbDesign/blob/main/setup-linux.sh

$ ./setup-linux.sh

This script will:

See ./setup-linux.sh --help for all available options.

Source Code

Get the source code by cloning the GitHub repository:

$ git clone https://github.com/nam20485/OdbDesign.git

Build

Open your favorite terminal and change to the directory where you cloned the source code. This should be something similar to one of the below depending on your platform and where you cloned the source code:

Then run the commands from one or more of the sections below, based on what you would like to build…

CMake C++ Project

Visual Studio
Command-Line CMake
Windows
$ cmake --preset x64-release
$ cmake --build --preset x64-release
Linux
$ cmake --preset linux-dynamic-release
$ cmake --build --preset linux-dynamic-release

This uses the linux-dynamic-release preset, which links vcpkg dependencies (protobuf, gRPC, …) as shared libraries. Linking them statically (linux-release preset) loads two copies of protobuf at runtime and crashes. See linux-dynamic-release-plan.md.

This builds the C++ shared library and the REST API server executable. See the Running the C++ Application section for more details.

The build output can be found in the following directory:

The x64-release directory will be different if you selected a different configuration preset (x64-release vs. x64-debug or linux-dynamic-release vs. linux-debug). The x64-release directory will contain the shared library and the server executable. Make sure to copy the dependencies (.dll files on Windows, .so files on Linux, .dylib files on MacOS) to the same directory as the executable if you want to copy it somewhere else. On Linux, the linux-dynamic-release build additionally depends on the vcpkg shared libraries in out/vcpkg_installed/x64-linux-dynamic/lib — copy them too (or set LD_LIBRARY_PATH to that directory).

Docker Image for REST API Server

From the root of the source directory…

$ docker compose up