mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
Merge 331264445e into 83397ebde2
This commit is contained in:
commit
24da721944
2 changed files with 48 additions and 0 deletions
|
|
@ -18,6 +18,12 @@
|
|||
|
||||
---
|
||||
|
||||
### System Requirements
|
||||
|
||||
**CPU Requirements:**
|
||||
|
||||
- **x64 Linux**: CPU with SSE3 or SSSE3 instruction set support (approximately 2008 or newer)
|
||||
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
|
|
|
|||
42
install
42
install
|
|
@ -159,6 +159,48 @@ 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
|
||||
cpu_flags_line=$(grep "^flags" /proc/cpuinfo | head -n 1 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$cpu_flags_line" ]; then
|
||||
cpu_flags=$(echo "$cpu_flags_line" | cut -d: -f2- 2>/dev/null || echo "")
|
||||
|
||||
if [ -n "$cpu_flags" ]; 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
|
||||
*ssse3*|*sse3*) ;;
|
||||
*) missing_flags=" sse3/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
|
||||
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue