
Prerequistite:
Make sure you have homebrew installed on your Mac device.
⛏️ How to install Brew on M1/M2 Mac
The quickest way to get GCC on the M1/M2 ARM based Mac is using brew.
% brew search gcc
==> Formulae
aarch64-elf-gcc gcc@11 gcc@6 gcc@9 x86_64-elf-gcc scc
gcc gcc@4.9 gcc@7 i686-elf-gcc ghc tcc
gcc@10 gcc@5 gcc@8 libgccjit grc ncc
==> Casks
gcc-aarch64-embedded gcc-arm-embedded gcs icc
% brew install gcc
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/manifests/6.2.1_1
...
...
==> Installing dependencies for gcc: gmp, isl, mpfr, libmpc, lz4 and zstd
...
...
==> Installing gcc
==> Pouring gcc--12.2.0.arm64_monterey.bottle.1.tar.gz
🍺 /opt/homebrew/Cellar/gcc/12.2.0: 1,470 files, 358.9MB
==> Running `brew cleanup gcc`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
As you can see, the version installed is the ARM64 one!
% gcc -v
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin22.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
-
Have Questions? Post them here!
More Posts related to MacOS,
- How to Open Finder using Mac Terminal
- How to install maven in macOS using Terminal Command
- How to install iTerm2 Mac Terminal Alternative
- Find Mac version using terminal command
- Zsh Shell: Custom alias that you may find useful
- How to Uninstall Brew on Mac
- Go to Specific file path using Mac Finder
- How to open new tabs macOS Terminal
- fix macOS: The digital signature on the update is missing or invalid. Ventura
- ls: .: Operation not permitted - Mac Terminal ZSH Error
- Closest Alternate to Notepad on Mac
- How to Open Trash on Mac
- How to uninstall Microsoft Outlook on Mac
- [fix] macOS Ventura xcrun: error: invalid active developer path missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
- [Vi/Vim] How to move cursor to the start of a line
- macOS 13 Ventura - The New About this Mac Window
- Best Free Gif screen capture app now available for M1 Chip Mac - LICECap
- 30+ Zoom video communications application shortcuts for macOS
- How to create alias in macOS
- How to install Node using Brew on Mac
- How to start/boot macOS in safe mode - Big Sur 11.0, Catalina 10.15, or Mojave 10.14
- Cant find System Preferences... under macOS Ventura Apple Menu?
- Mac turn dark mode on or off using terminal command
- How to Close Safari in Mac using Keyboard shortcut
- How to Upgrade Mac from Monterey to macOS Ventura
More Posts:
- Syntax error, parameterized types are only available if source level is 1.5 or greater [Java] - Eclipse
- Android AlertDialog with Yes No and Cancel Button - Android
- Bash Hello World! Script Tutorial - Bash
- Fetch as Google Crawl Error or Redirected Status - Google
- SQLite Error: unknown command or invalid arguments: open. Enter .help for help - Android
- Java - PatternSyntaxException - Java
- [Eclipse] Syntax error, annotations are only available if source level is 1.5 or greater - Eclipse
- Add Buttons at the bottom of Android Layout xml file - Android