Build & Installation
Complete guide to building and installing the Guido Racing SDK.
Prerequisites
Before getting started, make sure you have:
Build Tools
- CMake version 3.20 or higher
- C++20 compatible compiler:
- GCC 10+ (Linux)
- Clang 10+ (macOS/Linux)
- MSVC 2019+ (Windows)
- Git to clone the repository
Optional Libraries
Depending on your needs:
- OpenCV (for computer vision)
- Eigen (for mathematical computations)
- Boost (for utilities)
Quick Install
1. Clone the Repository
git clone https://github.com/guido-stack/racing-sdk.git
cd racing-sdk
2. Build the SDK
mkdir build && cd build
cmake ..
cmake --build .
3. Test the Installation
./bin/simple_example
If you see the following output, the installation was successful:
Guido Racing SDK - Simple Example
SDK Version: 1.0.0
✓ SDK initialized successfully!
Build Options
Standard Configuration
cmake ..
Available Options
| Option | Default | Description |
|---|---|---|
BUILD_SHARED_LIBS | ON | Build shared libraries |
BUILD_EXAMPLES | ON | Build example programs |
BUILD_TESTS | ON | Build unit tests |
CMAKE_BUILD_TYPE | Release | Build type (Debug/Release) |
Custom Build
cmake \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
..
Build Types
Debug Build
For development with debug symbols:
mkdir build-debug && cd build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
Release Build
For production with optimizations:
mkdir build-release && cd build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
RelWithDebInfo Build
Release with debug information:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
System Installation
Standard Installation
cd build
cmake --build . --target install
Installs by default to /usr/local (Linux/macOS) or C:\Program Files (Windows).
Custom Installation
cmake -DCMAKE_INSTALL_PREFIX=/custom/path ..
cmake --build . --target install
Verify Installation
# Linux/macOS
ls /usr/local/include/guido_racing
ls /usr/local/lib/libguido_racing*
# Or custom path
ls /custom/path/include/guido_racing
Using the SDK in Your Project
With CMake
Create a CMakeLists.txt:
cmake_minimum_required(VERSION 3.20)
project(MyRacingApp)
# Find the SDK
find_package(GuidoRacingSDK REQUIRED)
# Create your executable
add_executable(my_app main.cpp)
# Link the SDK
target_link_libraries(my_app PRIVATE GuidoRacing::guido_racing_sdk)
# C++20 required
set_target_properties(my_app PROPERTIES CXX_STANDARD 20)
Build Your Application
mkdir build && cd build
cmake ..
cmake --build .
./my_app
Cross-Platform Build
Linux
mkdir build && cd build
cmake ..
make -j$(nproc)
macOS
mkdir build && cd build
cmake ..
make -j$(sysctl -n hw.ncpu)
Windows (Visual Studio)
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build . --config Release
Windows (MinGW)
mkdir build && cd build
cmake .. -G "MinGW Makefiles"
cmake --build .
Troubleshooting
CMake can't find the compiler
# Specify explicitly
cmake -DCMAKE_CXX_COMPILER=g++-10 ..
C++ version error
Make sure you're using a C++20 compatible compiler:
# Check version
g++ --version # GCC 10+
clang++ --version # Clang 10+
Linkage issues
In case of linkage errors, try a static build:
cmake -DBUILD_SHARED_LIBS=OFF ..
Clean Build
If you encounter issues, clean and start over:
rm -rf build
mkdir build && cd build
cmake ..
cmake --build .
Development
Build with Strict Warnings
cmake -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" ..
Build with Sanitizers
To detect memory bugs:
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=undefined" \
..
Documentation Generation
cmake -DBUILD_DOCS=ON ..
cmake --build . --target docs
Next Steps
- Quick Start - Create your first program
- SDK Introduction - Back to SDK overview