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
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to MacOS,
- How to show line numbers in Nano on Mac
- How to install Jupyter Notebook on macOS Sonoma
- How to Disable Remote Management using Mac Terminal
- Test internet speed using macOS Terminal command
- Docker Desktop needs privileged access macOS
- Google Search Hot Trends Screensaver for Mac OS X
- How to do calculations in Mac Terminal
- How to make TextEdit the default text Editor on Mac
- How to Show Full Website Address on Safari for Mac (Ventura/Sonoma)
- The Zsh Shell - Mac Tutorial
- Opening mac Terminal
- How to change the name of your Mac running on macOS Ventura 13
- How to find the Battery Cycle Count on macOS Ventura
- How to set an emoji as Zsh terminal prompt in macOS
- How to access Trash Folder using Mac Terminal Command
- macOS Ventura XCode Command Line Tools Installation
- Hide Bluetooth icon on Mac Menu Bar macOS Ventura 13
- How to run .sh file in Mac Terminal
- Terminal Command to get the list of available shells in macOS
- How to see Storage Information on macOS Ventura
- How to Go To /usr/local/bin on Mac Terminal?
- How to do screen recording on Mac
- How to Find File and Directory Size in Mac Terminal
- Open .bash_profile File in TextEdit using Terminal
- Remove Now Playing icon from macOS Big Sur Menu Bar
More Posts:
- How to create alias in macOS - MacOS
- Sharepoint Server 2016 installation Prerequisites with download links - SharePoint
- Multiple ways to Convert tabs with spaces in Notepad++ - NotepadPlusPlus
- How to Auto Fill Down in Excel for Mac - MacOS
- Save webpage as pdf in Google Chrome for Mac OS X - Mac-OS-X
- Nano Undo/Redo Keyboard Shortcuts - Linux
- How to Save Jupyter Notebook as PDF - Python
- Mac: How to Open Android Studio from Terminal - MacOS