Elixir: Illegal hardware instruction

Created on 28 Jun 2020  路  8Comments  路  Source: elixir-lang/elixir

Environment

  • Elixir & Erlang/OTP versions (elixir --version): Latest (just installed 15 minutes before creating this issue)
  • Operating system:
    MacBook Pro Late 2008 running MacOS Catalina

Current behavior

~ % mix local.hex
zsh: illegal hardware instruction  mix local.hex
~ % elixir --version
zsh: illegal hardware instruction  elixir --version

Expected behavior

--

What are the minimum hardware requirements to run Elixir?

Most helpful comment

Here is a thread on stack overflow: https://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10

Either the shell or Erlang were compiled with the assumption of more recent hardware. I suggest to try running erl as @wojtekmach suggested. If it fails, then you need to make sure you pass the proper flags when compiling Erlang. If you are using Homebrew or similar, make sure you are compiling locally instead of downloading a precompiled Erlang. If erl succeeds, then the issue may be with how the bash itself was compiled, and that is most likely a trickier one to fix.

I will close this meanwhile as it doesn't really seem to be an Elixir issue. Thanks!

All 8 comments

What are the minimum hardware requirements to run Elixir?

what are you hardware specs?

Hi @vshah23! Can you please try using another shell? Such as bash?

Elixir executable is simply a shell script, so it is impossible for it to emit invalid hardware instructions unless the shell itself was compiled improperly. Given that 2008 models are not officially supported by Catalina, that may be the root cause. Searching for this particular message online showed similar cases in other projects.

Hi @vshah23! Can you please try using another shell? Such as bash?

Elixir executable is simply a shell script, so it is impossible for it to emit invalid hardware instructions unless the shell itself was compiled improperly. Given that 2008 models are not officially supported by Catalina, that may be the root cause. Searching for this particular message online showed similar cases in other projects.

what are you hardware specs?

2.4GHz Core 2 Duo (P8600)
8 GB 1067 MHz DDR3
NVIDIA GeForce 9600M GT 256 MB
120GB Samsung SSD
250GB HDD

Hi @vshah23! Can you please try using another shell? Such as bash?

~ % bash

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.

bash-3.2$ bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)
Copyright (C) 2007 Free Software Foundation, Inc.

bash-3.2$ elixir --version
Illegal instruction: 4

what are you hardware specs?

2.4GHz Core 2 Duo (P8600)
8 GB 1067 MHz DDR3
NVIDIA GeForce 9600M GT 256 MB
120GB Samsung SSD
250GB HDD

definitely not due to hardware being not powerful enough. I would be more inclined on what Jos茅 mentioned.

Does erl work for you? If not, then there isn't anything we can do on the Elixir side.

Here is a thread on stack overflow: https://stackoverflow.com/questions/14268887/what-is-the-illegal-instruction-4-error-and-why-does-mmacosx-version-min-10

Either the shell or Erlang were compiled with the assumption of more recent hardware. I suggest to try running erl as @wojtekmach suggested. If it fails, then you need to make sure you pass the proper flags when compiling Erlang. If you are using Homebrew or similar, make sure you are compiling locally instead of downloading a precompiled Erlang. If erl succeeds, then the issue may be with how the bash itself was compiled, and that is most likely a trickier one to fix.

I will close this meanwhile as it doesn't really seem to be an Elixir issue. Thanks!

Was this page helpful?
0 / 5 - 0 ratings