Linux Setup Script
The scripts/setup-linux.sh script provides an automated way to set up a complete development environment for OdbDesign on Linux systems.
⚠️ Security Warning
Running scripts from the internet can execute arbitrary code on your system! Always approach with caution and verify scripts are safe before running them on your own system. Since this script is open-source, you can view the entire contents at: https://github.com/nam20485/OdbDesign/blob/main/scripts/setup-linux.sh
We encourage you to review the script for yourself before running it to ensure it meets your security requirements.
Features
- Multi-Distribution Support: Automatically detects and supports Ubuntu/Debian, CentOS/RHEL/Fedora, Arch Linux, and openSUSE
- Dependency Management: Installs all required system dependencies (cmake, ninja, build tools, etc.)
- vcpkg Integration: Automatically installs and configures vcpkg package manager
- Environment Setup: Configures shell environment variables automatically
- Flexible Building: Supports Debug/Release builds with optional testing
- Docker Support: Optional Docker installation and configuration
Quick Start
# Clone the repository
git clone https://github.com/nam20485/OdbDesign.git
cd OdbDesign
# Run the setup script
./scripts/setup-linux.sh
That’s it! The script will handle everything automatically.
Usage Options
./scripts/setup-linux.sh [OPTIONS]
OPTIONS:
-h, --help Show help message
-d, --debug Build in Debug mode (default: Release)
-t, --tests Build and run tests
--no-docker Skip Docker installation
--skip-build Only install dependencies, skip building
--vcpkg-dir DIR Custom vcpkg installation directory (default: ~/vcpkg)
Examples
# Basic setup and build
./scripts/setup-linux.sh
# Debug build with tests
./scripts/setup-linux.sh --debug --tests
# Skip Docker installation
./scripts/setup-linux.sh --no-docker
# Only install dependencies, don't build
./scripts/setup-linux.sh --skip-build
# Use custom vcpkg directory
./scripts/setup-linux.sh --vcpkg-dir /opt/vcpkg
What the Script Does
- Detects your Linux distribution and selects appropriate package manager
- Installs system dependencies including:
- Build tools (gcc, g++, make)
- CMake and Ninja build system
- Git, curl, zip utilities
- pkg-config
- Docker (optional)
- Sets up vcpkg by cloning and bootstrapping the Microsoft vcpkg package manager
- Configures environment by adding VCPKG_ROOT to your shell profile
- Builds the project using the appropriate CMake preset
- Runs tests (if requested)
- Verifies installation to ensure everything is working correctly
Supported Distributions
- Ubuntu/Debian/Mint: Uses
aptpackage manager - Fedora: Uses
dnfpackage manager - CentOS/RHEL: Uses
yumpackage manager - Arch Linux/Manjaro: Uses
pacmanpackage manager - openSUSE/SLES: Uses
zypperpackage manager
Requirements
- Linux system with sudo access
- Internet connection for downloading dependencies
- Bash shell
Troubleshooting
If the script fails:
- Check the error message - the script provides detailed error information
- Verify internet connectivity - vcpkg needs to download packages
- Ensure you have sudo access - system packages require root privileges
- Check disk space - the build process requires several GB of space
Manual Alternative
If you prefer manual setup, see the BUILD.md documentation for step-by-step instructions.