From b58bb33a845ef6a0917dc371188b6d2705170158 Mon Sep 17 00:00:00 2001 From: Josh Rogers <2706960+jrogers512@users.noreply.github.com> Date: Sat, 13 Dec 2025 14:12:57 -0600 Subject: [PATCH 1/3] add CPU flag checks to install script --- README.md | 6 ++++++ install | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/README.md b/README.md index eb0295c9c..d0d65faad 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,12 @@ --- +### System Requirements + +**CPU Requirements:** + +- **x64 Linux**: CPU with SSE3 and SSSE3 instruction set support (approximately 2008 or newer) + ### Installation ```bash diff --git a/install b/install index c6f209734..3fbbb5ed4 100755 --- a/install +++ b/install @@ -159,6 +159,56 @@ unbuffered_sed() { fi } +# Check CPU capabilities before proceeding (Linux x64 only) +if [ "$arch" = "x64" ] && [ "$os" = "linux" ]; then + cpu_check_failed=false + if [ -f /proc/cpuinfo ]; then + # Use compatible grep method (works on older systems) + cpu_flags_line=$(grep "^flags" /proc/cpuinfo | head -n 1 2>/dev/null || echo "") + + if [ -n "$cpu_flags_line" ]; then + # Extract flags after colon (compatible method) + cpu_flags=$(echo "$cpu_flags_line" | cut -d: -f2- 2>/dev/null || echo "") + + if [ -n "$cpu_flags" ]; then + # Locale-independent case conversion + cpu_flags=$(LC_ALL=C echo "$cpu_flags" | tr '[:upper:]' '[:lower:]') + + # Check for required instruction sets + missing_flags="" + case "$cpu_flags" in + *sse3*) ;; + *) missing_flags=" sse3" ;; + esac + case "$cpu_flags" in + *ssse3*) ;; + *) missing_flags="$missing_flags ssse3" ;; + esac + + if [ -n "$missing_flags" ]; then + print_message error "CPU not supported" + print_message error "Missing required instruction sets:$missing_flags" + exit 1 + fi + else + print_message warning "Could not parse CPU flags from /proc/cpuinfo. Proceeding with installation..." + cpu_check_failed=true + fi + else + print_message warning "No CPU flags found in /proc/cpuinfo. Proceeding with installation..." + cpu_check_failed=true + fi + else + print_message warning "Could not read /proc/cpuinfo. Proceeding with installation..." + cpu_check_failed=true + fi + + # Warning if we couldn't check CPU capabilities + if [ "$cpu_check_failed" = true ]; then + print_message warning "Note: This may result in compatibility issues on older CPUs" + fi +fi + print_progress() { local bytes="$1" local length="$2" From d7546df51d4a7c53e104afec809d77606f9b6ad8 Mon Sep 17 00:00:00 2001 From: jrogers512 Date: Sat, 13 Dec 2025 14:19:04 -0600 Subject: [PATCH 2/3] cpu flag checks in install script Found that opencode installs on an old system that does not have required cpu flags to run. This patch adds a check in the install check to prevent installation just to find a `Illegal instruction` error message --- install | 5 ----- 1 file changed, 5 deletions(-) diff --git a/install b/install index 3fbbb5ed4..4875cd0a7 100755 --- a/install +++ b/install @@ -163,18 +163,14 @@ unbuffered_sed() { if [ "$arch" = "x64" ] && [ "$os" = "linux" ]; then cpu_check_failed=false if [ -f /proc/cpuinfo ]; then - # Use compatible grep method (works on older systems) cpu_flags_line=$(grep "^flags" /proc/cpuinfo | head -n 1 2>/dev/null || echo "") if [ -n "$cpu_flags_line" ]; then - # Extract flags after colon (compatible method) cpu_flags=$(echo "$cpu_flags_line" | cut -d: -f2- 2>/dev/null || echo "") if [ -n "$cpu_flags" ]; then - # Locale-independent case conversion cpu_flags=$(LC_ALL=C echo "$cpu_flags" | tr '[:upper:]' '[:lower:]') - # Check for required instruction sets missing_flags="" case "$cpu_flags" in *sse3*) ;; @@ -203,7 +199,6 @@ if [ "$arch" = "x64" ] && [ "$os" = "linux" ]; then cpu_check_failed=true fi - # Warning if we couldn't check CPU capabilities if [ "$cpu_check_failed" = true ]; then print_message warning "Note: This may result in compatibility issues on older CPUs" fi From 331264445e1245dacf38f5af800c358947837469 Mon Sep 17 00:00:00 2001 From: jrogers512 Date: Sun, 14 Dec 2025 13:22:43 -0600 Subject: [PATCH 3/3] SSE3 or SSSE3, not and. #thanks Nindaleth --- README.md | 2 +- install | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d0d65faad..9522e4da7 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ **CPU Requirements:** -- **x64 Linux**: CPU with SSE3 and SSSE3 instruction set support (approximately 2008 or newer) +- **x64 Linux**: CPU with SSE3 or SSSE3 instruction set support (approximately 2008 or newer) ### Installation diff --git a/install b/install index 4875cd0a7..827ebdb54 100755 --- a/install +++ b/install @@ -172,13 +172,10 @@ if [ "$arch" = "x64" ] && [ "$os" = "linux" ]; then cpu_flags=$(LC_ALL=C echo "$cpu_flags" | tr '[:upper:]' '[:lower:]') missing_flags="" + # Check for SSSE3 (includes SSE3) or SSE3 case "$cpu_flags" in - *sse3*) ;; - *) missing_flags=" sse3" ;; - esac - case "$cpu_flags" in - *ssse3*) ;; - *) missing_flags="$missing_flags ssse3" ;; + *ssse3*|*sse3*) ;; + *) missing_flags=" sse3/ssse3" ;; esac if [ -n "$missing_flags" ]; then