|
| 1 | +# Building Convoy |
| 2 | + |
| 3 | +> Complete build instructions for the Convoy project. |
| 4 | +
|
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +1. [System Requirements](#system-requirements) |
| 8 | +2. [Dependencies](#dependencies) |
| 9 | +3. [Build Steps](#build-steps) |
| 10 | +4. [Troubleshooting](#troubleshooting) |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## System Requirements |
| 15 | + |
| 16 | +- **OS**: Linux (x86-64) |
| 17 | +- **C++ Standard**: C++17 or later |
| 18 | +- **Compiler**: g++ 11+ or clang++ 13+ |
| 19 | +- **CMake**: Version 3.18 to 3.28 (versions 4.x have issues with this project) |
| 20 | +- **RAM**: Minimum 4GB (for linking) |
| 21 | + |
| 22 | +--- |
| 23 | + |
| 24 | +## Dependencies |
| 25 | + |
| 26 | +### Required System Packages |
| 27 | + |
| 28 | +```bash |
| 29 | +sudo apt-get install -y \ |
| 30 | + build-essential \ |
| 31 | + cmake \ |
| 32 | + libglfw3-dev \ |
| 33 | + libgl1-mesa-dev \ |
| 34 | + libxrandr-dev \ |
| 35 | + libxinerama-dev \ |
| 36 | + libxcursor-dev \ |
| 37 | + libxi-dev |
| 38 | +``` |
| 39 | + |
| 40 | +### Included Dependencies (via Conan or Git Submodules) |
| 41 | + |
| 42 | +- **GLFW3** - Window and input management |
| 43 | +- **OpenGL** - 3D graphics API (via GLAD loader) |
| 44 | +- **ImGui** - Immediate mode UI framework |
| 45 | +- **GoogleTest** - Testing framework |
| 46 | +- **GLAD** - OpenGL function loader |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Build Steps |
| 51 | + |
| 52 | +### 1. Clone the Repository |
| 53 | + |
| 54 | +```bash |
| 55 | +git clone https://github.com/your-org/Convoy.git |
| 56 | +cd Convoy |
| 57 | +``` |
| 58 | + |
| 59 | +### 2. Create Build Directory |
| 60 | + |
| 61 | +```bash |
| 62 | +mkdir -p build |
| 63 | +cd build |
| 64 | +``` |
| 65 | + |
| 66 | +### 3. Configure with CMake |
| 67 | + |
| 68 | +```bash |
| 69 | +cmake .. -DCMAKE_BUILD_TYPE=Release |
| 70 | +``` |
| 71 | + |
| 72 | +**Options:** |
| 73 | +- `-DCMAKE_BUILD_TYPE=Debug` - Debug build with symbols |
| 74 | +- `-DCMAKE_BUILD_TYPE=Release` - Optimized release build |
| 75 | +- `-DCMAKE_BUILD_TYPE=RelWithDebInfo` - Release with debug symbols |
| 76 | + |
| 77 | +### 4. Build the Project |
| 78 | + |
| 79 | +```bash |
| 80 | +cmake --build . --config Release --parallel 4 |
| 81 | +``` |
| 82 | + |
| 83 | +**Or using make directly:** |
| 84 | + |
| 85 | +```bash |
| 86 | +make -j4 |
| 87 | +``` |
| 88 | + |
| 89 | +**Expected output:** |
| 90 | +``` |
| 91 | +[ 2%] Built target convoy_glad |
| 92 | +[ 34%] Built target convoy_core |
| 93 | +[ 67%] Built target mod_architect |
| 94 | +[ 78%] Built target mod_walker |
| 95 | +[ 89%] Built target mod_forge |
| 96 | +[100%] Built target convoy |
| 97 | +``` |
| 98 | + |
| 99 | +### 5. Verify Build Success |
| 100 | + |
| 101 | +```bash |
| 102 | +ls -lh ./convoy |
| 103 | +file ./convoy |
| 104 | +ldd ./convoy |
| 105 | +``` |
| 106 | + |
| 107 | +**Expected:** |
| 108 | +- Binary size: ~1.7MB |
| 109 | +- Type: ELF 64-bit LSB pie executable |
| 110 | +- All dependencies resolved (libglfw.so.3, libOpenGL.so.0, libc.so.6, etc.) |
| 111 | + |
| 112 | +--- |
| 113 | + |
| 114 | +## Running the Application |
| 115 | + |
| 116 | +### Execute the Binary |
| 117 | + |
| 118 | +```bash |
| 119 | +./convoy |
| 120 | +``` |
| 121 | + |
| 122 | +**Expected output:** |
| 123 | +``` |
| 124 | +[INFO] WindowManager initialized 1600x900 |
| 125 | +``` |
| 126 | + |
| 127 | +The window should open and display the ImGui interface. |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Build Artifacts |
| 132 | + |
| 133 | +After successful build: |
| 134 | + |
| 135 | +``` |
| 136 | +Convoy/build/ |
| 137 | +├── convoy # Main executable (1.7MB) |
| 138 | +├── libconvoy_core.a # Core library |
| 139 | +├── libmod_architect.a # Architect module |
| 140 | +├── libmod_walker.a # Walker module |
| 141 | +├── libmod_forge.a # Forge module |
| 142 | +├── libmod_sequencer.a # Sequencer module |
| 143 | +├── libconvoy_glad.a # OpenGL loader |
| 144 | +└── CMakeFiles/ # Build configuration |
| 145 | +``` |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +## Development Build |
| 150 | + |
| 151 | +For faster iteration during development: |
| 152 | + |
| 153 | +```bash |
| 154 | +cd build |
| 155 | +cmake .. -DCMAKE_BUILD_TYPE=Debug |
| 156 | +cmake --build . --config Debug --parallel 4 |
| 157 | +``` |
| 158 | + |
| 159 | +Then run with debugger: |
| 160 | + |
| 161 | +```bash |
| 162 | +gdb ./convoy |
| 163 | +(gdb) run |
| 164 | +``` |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +## Clean Build |
| 169 | + |
| 170 | +To remove all build artifacts and start fresh: |
| 171 | + |
| 172 | +```bash |
| 173 | +cd Convoy |
| 174 | +rm -rf build |
| 175 | +mkdir build |
| 176 | +cd build |
| 177 | +cmake .. -DCMAKE_BUILD_TYPE=Release |
| 178 | +cmake --build . |
| 179 | +``` |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +## Build on macOS |
| 184 | + |
| 185 | +macOS build has different dependency paths. Install via Homebrew: |
| 186 | + |
| 187 | +```bash |
| 188 | +brew install cmake glfw3 glad |
| 189 | +``` |
| 190 | + |
| 191 | +Then follow the standard build steps above. Note: OpenGL version may differ (use `-DGLFW_INCLUDE_NONE`). |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +## Build on Windows |
| 196 | + |
| 197 | +For Windows (experimental): |
| 198 | + |
| 199 | +1. Install Visual Studio 2019 or newer |
| 200 | +2. Install CMake 3.18+ |
| 201 | +3. Install GLFW3 and dependencies via vcpkg: |
| 202 | + ```bash |
| 203 | + vcpkg install glfw3 glad imgui |
| 204 | + ``` |
| 205 | +4. Configure with Visual Studio generator: |
| 206 | + ```bash |
| 207 | + cmake .. -G "Visual Studio 17 2022" |
| 208 | + cmake --build . --config Release |
| 209 | + ``` |
| 210 | + |
| 211 | +--- |
| 212 | + |
| 213 | +## Troubleshooting |
| 214 | + |
| 215 | +### CMake Configuration Fails |
| 216 | + |
| 217 | +**Error:** `CMake Error at CMakeLists.txt:1 (cmake_minimum_required): CMake 3.28 or higher is required.` |
| 218 | + |
| 219 | +**Solution:** Update CMake or explicitly use supported version: |
| 220 | +```bash |
| 221 | +cmake .. -DCMAKE_BUILD_TYPE=Release # Version 3.18-3.28 only |
| 222 | +``` |
| 223 | + |
| 224 | +### OpenGL/GLAD Initialization Error |
| 225 | + |
| 226 | +**Error:** `error: OpenGL header already included` |
| 227 | + |
| 228 | +**Solution:** Ensure `#define GLFW_INCLUDE_NONE` comes BEFORE `#include <GLFW/glfw3.h>` in all .cpp files. |
| 229 | + |
| 230 | +See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) for more issues. |
| 231 | + |
| 232 | +--- |
| 233 | + |
| 234 | +## Next Steps |
| 235 | + |
| 236 | +- **Run the application**: `./convoy` |
| 237 | +- **Read development guide**: See [DEVELOPMENT.md](DEVELOPMENT.md) |
| 238 | +- **Understand architecture**: See [ARCHITECTURE.md](ARCHITECTURE.md) |
| 239 | +- **Get started coding**: See [QUICK_START.md](QUICK_START.md) |
0 commit comments