[BUG] illegal hardware instruction, please compile without the AVX2 requirement
Environment
- Platform (select one):
- [X] Anthropic API
- Claude CLI version:
1.0.81 - Operating System: mac 12.7.6
- Terminal: iterm2
Bug Description
Claude native install has CPU hardware instruction problem:
claude --version
[1] 36152 illegal hardware instruction
Macbook is Retina 15 early 2013, cpu is Intel (3635QM) This CPU does NOT have AVX2 / BMI2 / FMA support
Steps to Reproduce
- Use older intel macbook without AVX2 instructions
- Install claude code via npm
- Do native install, try to run, and hit error
Expected Behavior
It should not crash on unknown cpu instruction
Actual Behavior
Crashes due to unknown instruction
Additional Context
Claude code native build is not that CPU intensive, so I don't see why it would need to be compiled with AVX2 requirement. In Rust, please compile with target RUSTFLAGS="-C target-cpu=x86-64" and this should fix it by going back to the normal baseline x86-64 instructions
@diwu-sf can you see if this repros in version 1.0.69 ?
(base) ➜ Projects claude install 1.0.69
✔ Claude Code successfully installed!
Version: 1.0.69
Location: ~/.local/bin/claude
Next: Run claude --help to get started
(base) ➜ Projects ~/.local/bin/claude --version
[1] 87076 illegal hardware instruction ~/.local/bin/claude --version
similar problem, is the build machine running with target-cpu=native?
This should be working better in upcoming release 1.0.84 - likely rolling out Monday
@ant-kurt this is still happening with 1.0.84. For reference the NPM version works fine, even the ripgrep binary from the npm install works fine.
Hmm - can you try running v1.0.84 with env var USE_BUILTIN_RIPGREP=0 to see if that isolates the problem?
oo, same thing happening with me Apple M1 Pro Sonoma 14.7.6(23H626)
i got this illegal instruction when installing with native
curl -fsSL https://claude.ai/install.sh | bash
Setting up Claude Code...
bash: line 142: 1399 Illegal instruction: 4 "$binary_path" install ${TARGET:+"$TARGET"}
then i went to brew cask, and installment passed but i couldn't boot it after installment... here is the log
brew install --cask claude-code
==> Downloading https://formulae.brew.sh/api/cask.jws.json
==> Caveats
Claude Code's auto-updater installs updates to `~/.local/bin/claude` and
not to Homebrew's location. It is recommended to disable the auto-updater
with either `DISABLE_AUTOUPDATER=1` or
`claude config set -g autoUpdates false` and use
`brew upgrade --cask claude-code`.
==> Downloading https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-release
Already downloaded:
==> Installing Cask claude-code
==> Linking Binary 'claude' to '/usr/local/bin/claude'
🍺 claude-code was successfully installed!
==> No outdated dependents to upgrade!
claude
Job 1, 'claude' terminated by signal SIGILL (Illegal instruction)
npm version worked fine with me before too.
@ant-kurt version 1.0.86 native still has trouble on that intel macbook without the avx2
Env var USE_BUILTIN_RIPGREP=0 does not help
I have the same issue with native install script - Mac Mini 4,1 - Linux Mint 22.2 Zara Tried setting USE_BUILTIN_RIPGREP=0, with no impact npm install succeeds, and claude code works properly
same issue on mac pro m1
illegal hardware instruction claude
Not exactly the same issue as the original post but I am getting Illegal instruction: 4 when I run the claude command after installing via Homebrew. I tried installing via curl and got bash: line 142: 2857 Illegal instruction: 4 "$binary_path" install ${TARGET:+"$TARGET"}. I am on a 2021 Macbook Pro with Apple M1 Max chip and Sonoma 14.6.1.
Update:
Somehow I was running an intel shell on my M1 mac. To fix this I ran chsh -s /bin/zsh. Then I reinstalled homebrew, ensuring it was the ARM version installed in /opt/homebrew. Then I reinstalled Claude and deleted the old Claude at /usr/local/bin/claude. This is not a bug with Claude, I'm just leaving this here in case someone else has a similar issue.
arch -arm64 brew install --cask claude-code
My problem has been solved
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.