@page build Build Dependencies

# Build Dependencies

**Status:** Tested and verified on Ubuntu/Debian Linux (2025-12-03)

## System Requirements

Before building the GUI applications, you need to install these system dependencies:

### Linux (Ubuntu/Debian)
```bash
sudo apt-get update
sudo apt-get install -y \
    libfontconfig1-dev \
    libfreetype6-dev \
    libexpat1-dev \
    pkg-config
```

### Linux (Fedora/RHEL)
```bash
sudo dnf install -y \
    fontconfig-devel \
    freetype-devel \
    expat-devel \
    pkg-config
```

### macOS
```bash
brew install fontconfig freetype pkg-config
```

### Windows
Dependencies are typically handled automatically by cargo, but you may need:
- Visual Studio Build Tools or MinGW

## Tauri Additional Requirements

### Linux (Ubuntu/Debian)
```bash
sudo apt-get install -y \
    libwebkit2gtk-4.1-dev \
    build-essential \
    curl \
    wget \
    file \
    libssl-dev \
    libgtk-3-dev \
    libayatana-appindicator3-dev \
    librsvg2-dev

# If webkit2gtk-4.1 is not available, try:
sudo apt-get install -y libwebkit2gtk-4.0-dev
```

### macOS
```bash
# Xcode Command Line Tools required
xcode-select --install
```

### Windows
- WebView2 runtime (usually pre-installed on Windows 10/11)

## After Installing Dependencies

### Build Web GUI
```bash
cargo build --bin web_gui --features plotting --release
```

### Build Tauri App
```bash
cd tauri-app
cargo tauri build
```

## Verification

### Test Web GUI Build
After installing dependencies, verify the build:
```bash
cargo build --bin web_gui --features plotting --release
./target/release/web_gui
# Should output: Serving web GUI on http://0.0.0.0:3000
```

### Verify Dependencies Installed
```bash
# Check fontconfig
pkg-config --exists fontconfig && echo "[OK] fontconfig found" || echo "✗ fontconfig missing"

# Check webkit (for Tauri)
pkg-config --exists webkit2gtk-4.1 && echo "[OK] webkit2gtk-4.1 found" || echo "✗ webkit2gtk-4.1 missing"
```

## Build Times (Reference)

Based on testing (Ubuntu/Debian, typical hardware):
- **Web GUI Release Build:** ~12 seconds
- **Tauri Development Build:** ~30-60 seconds (first build)
- **Tauri Release Build:** ~60-120 seconds (first build)

Subsequent builds are significantly faster due to caching.
