#!/bin/bash set -e # Check for cmake if ! command -v cmake &> /dev/null; then echo "Error: cmake is not installed. Please install cmake." >&2 exit 1 fi # Check for g++ if ! command -v g++ &> /dev/null; then echo "Error: g++ is not installed. Please install g++." >&2 exit 1 fi # Check for OpenSSL if ! pkg-config --exists openssl; then echo "Error: OpenSSL development libraries not found. Please install libssl-dev." >&2 exit 1 fi BUILD_DIR=build mkdir -p "$BUILD_DIR" cd "$BUILD_DIR" cmake .. make -j$(nproc) if [ -f runner ]; then echo "Build successful. Run ./build/runner" else echo "Build failed. Check the output above for errors." exit 1 fi