Build & Installation
Guide complet pour compiler et installer le Guido Racing SDK.
Prérequis
Avant de commencer, assurez-vous d'avoir :
Outils de Build
- CMake version 3.20 ou supérieure
- Compilateur C++20 compatible :
- GCC 10+ (Linux)
- Clang 10+ (macOS/Linux)
- MSVC 2019+ (Windows)
- Git pour cloner le repository
Bibliothèques Optionnelles
Selon vos besoins :
- OpenCV (pour vision par ordinateur)
- Eigen (pour calculs mathématiques)
- Boost (pour utilitaires)
Installation Rapide
1. Cloner le Repository
git clone https://github.com/guido-stack/racing-sdk.git
cd racing-sdk
2. Build du SDK
mkdir build && cd build
cmake ..
cmake --build .
3. Tester l'Installation
./bin/simple_example
Si vous voyez la sortie suivante, l'installation est réussie :
Guido Racing SDK - Simple Example
SDK Version: 1.0.0
✓ SDK initialized successfully!
Options de Build
Configuration Standard
cmake ..
Options Disponibles
| Option | Défaut | Description |
|---|---|---|
BUILD_SHARED_LIBS | ON | Compiler en bibliothèque partagée |
BUILD_EXAMPLES | ON | Compiler les exemples |
BUILD_TESTS | ON | Compiler les tests unitaires |
CMAKE_BUILD_TYPE | Release | Type de build (Debug/Release) |
Build Personnalisé
cmake \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_EXAMPLES=ON \
-DBUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \
..
Types de Build
Build Debug
Pour le développement avec symboles de debug :
mkdir build-debug && cd build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
cmake --build .
Build Release
Pour la production avec optimisations :
mkdir build-release && cd build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
Build RelWithDebInfo
Release avec informations de debug :
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
Installation Système
Installation Standard
cd build
cmake --build . --target install
Installe par défaut dans /usr/local (Linux/macOS) ou C:\Program Files (Windows).
Installation Personnalisée
cmake -DCMAKE_INSTALL_PREFIX=/custom/path ..
cmake --build . --target install
Vérifier l'Installation
# Linux/macOS
ls /usr/local/include/guido_racing
ls /usr/local/lib/libguido_racing*
# Ou chemin personnalisé
ls /custom/path/include/guido_racing
Utiliser le SDK dans Votre Projet
Avec CMake
Créez un CMakeLists.txt :
cmake_minimum_required(VERSION 3.20)
project(MyRacingApp)
# Trouver le SDK
find_package(GuidoRacingSDK REQUIRED)
# Créer votre exécutable
add_executable(my_app main.cpp)
# Lier le SDK
target_link_libraries(my_app PRIVATE GuidoRacing::guido_racing_sdk)
# C++20 requis
set_target_properties(my_app PROPERTIES CXX_STANDARD 20)
Compiler Votre Application
mkdir build && cd build
cmake ..
cmake --build .
./my_app
Build Multi-Plateformes
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 .
Résolution de Problèmes
CMake ne trouve pas le compilateur
# Spécifier explicitement
cmake -DCMAKE_CXX_COMPILER=g++-10 ..
Erreur de version C++
Assurez-vous d'utiliser un compilateur compatible C++20 :
# Vérifier la version
g++ --version # GCC 10+
clang++ --version # Clang 10+
Problèmes de linkage
En cas d'erreur de linkage, essayez un build statique :
cmake -DBUILD_SHARED_LIBS=OFF ..
Clean Build
Si vous rencontrez des problèmes, nettoyez et recommencez :
rm -rf build
mkdir build && cd build
cmake ..
cmake --build .
Développement
Compiler avec Warnings Stricts
cmake -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" ..
Build avec Sanitizers
Pour détecter les bugs mémoire :
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize=undefined" \
..
Génération de Documentation
cmake -DBUILD_DOCS=ON ..
cmake --build . --target docs
Prochaines Étapes
- Quick Start - Créer votre premier programme
- Introduction SDK - Retour à la vue d'ensemble