Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modular CLI]: Mac M1 homebrew installation fails with "The arm64 architecture is required for this software" #1078

Closed
1R053 opened this issue Oct 19, 2023 · 9 comments
Labels
modular-cli modular tool issues mojo-repo Tag all issues with this label

Comments

@1R053
Copy link

1R053 commented Oct 19, 2023

Issue description

I try to install the modular CLI as described in the blog:
https://www.modular.com/blog/mojo-is-now-available-on-mac

However, it fails with "The arm64 architecture is required for this software."

Steps to reproduce

after running

brew upgrade
curl https://get.modular.com | \
  MODULAR_AUTH=mut_mytokenhere \
  sh -

I get

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4069  100  4069    0     0  75351      0 --:--:-- --:--:-- --:--:-- 73981
Updating Homebrew
Already up-to-date.
Installing/upgrading Modular using Homebrew
modular: The arm64 architecture is required for this software.

Version Info

- Mac M1 Max
- MacOs Ventura 13.4.1
@1R053 1R053 added the modular-cli modular tool issues label Oct 19, 2023
@jackos
Copy link
Collaborator

jackos commented Oct 19, 2023

Hi @1R053 this is due to running your terminal with Rosetta which emulates x86, to fix:

On whatever terminal you're using, right click and press Get Info then untick Open using Rosetta:

image

@1R053
Copy link
Author

1R053 commented Oct 19, 2023

@jackos thanks for the hint. The interesting thing is that all my terminal apps (default and iterm) have this unchecked, but I still get the error, i.e.

~ % arch
arm64
~ % sysctl -n sysctl.proc_translated
0

my conda environment also has no X86 specific settings.
any ideas what else could be wrong?

@jackos jackos reopened this Oct 19, 2023
@inspiredlabs
Copy link

inspiredlabs commented Oct 19, 2023

My Terminal still throws this error, so I've updated this issue to reflect sysctl -n sysctl.proc_translated returns 0, and Open using Rosetta is already unticked.

@jackos
Copy link
Collaborator

jackos commented Oct 19, 2023

Thanks @inspiredlabs I'll keep this ticket open to track it, looks like it might be a common problem, could I please get yours and @1R053 output of:

uname -a

You can take out your personal details if you like, and also:

system_profiler SPHardwareDataType

Again can take out serial number and everything below that

@jackos
Copy link
Collaborator

jackos commented Oct 19, 2023

After seeing similar issue on Discord it looks like you may have installed intel homebrew version, can you try uninstalling homebrew:
https://github.com/homebrew/install#uninstall-homebrew

And then installing again from the same page

@1R053
Copy link
Author

1R053 commented Oct 19, 2023

yep, seems that's the case:

~ % which -a brew
/usr/local/bin/brew
 ~ % brew config
HOMEBREW_VERSION: 4.1.16
ORIGIN: https://github.com/Homebrew/brew
HEAD: c0c8a4dd4dd19ec16deb429abd50cdf82ea33b27
Last commit: 5 days ago
Core tap origin: https://github.com/Homebrew/homebrew-core
Core tap HEAD: f4b2ecbb81df1c992467d69847caf65f993e9cb2
Core tap last commit: 2 hours ago
Core tap branch: master
Core tap JSON: 19 Oct 18:32 UTC
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_CASK_OPTS: []
HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.JTknnxuwmv/org.xquartz:0
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 2.6.10 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: 10-core 64-bit westmere
Clang: 14.0.3 build 1403
Git: 2.33.0 => /usr/local/bin/git
Curl: 7.88.1 => /usr/bin/curl
macOS: 13.4.1-x86_64
CLT: N/A
Xcode: 14.3.1
Rosetta 2: true

@nickyoung-github
Copy link

I had the same issue today and uninstalling/re-installing homebrew did indeed fix it

@inspiredlabs
Copy link

inspiredlabs commented Oct 19, 2023

Mojo installation via Homebrew reinstallation:

  • check for Rosetta: brew config if that returns Rosetta 2: true, then:
  • Uninstall the translated version of brew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
  • cd /opt sudo mkdir homebrew sudo chown -R $(whoami) /opt/homebrew curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
  • update the path: echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc
  • restart the Terminal: source ~/.zshrc
  • authenticate user modular auth mut_<TOKEN>
  • then install Mojo: modular install mojo
  • Add the path: echo 'export MODULAR_HOME="/Users/user/.modular"' >> ~/.zshrc && echo 'export PATH="/Users/user/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc
  • restart the Terminal: source ~/.zshrc
  • run mojo

It works! 🔥

@1R053
Copy link
Author

1R053 commented Oct 19, 2023

not sure, when it is gonna hit me later... but I installed the arm brew version in addition to the intel one for now as I have quite a few things to migrate... which also worked

in case someone else wants to try

  • run the homebrew installer, it should get installed into /opt/homebrew
  • in my case the bin and sbin folders were not in the path so I added them via .zprofile
export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH

as long as the intel version is still installed and masking the arm version in the path you can call the arm brew version directly, and install modular

/opt/homebrew/bin/brew install modularml/packages/modular

that should then also land in the /opt/homebrew/bin folder, which is now in the path. You still need to authorize it with "modular auth yourtokenhere" as on your download page

then continue as in the docs, e.g.

modular install mojo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modular-cli modular tool issues mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

5 participants