How to avoid installing Rosetta on an Apple Silicon Mac

To get the Arduino IDE working on Apple Silicon, you have to provide a replacement compiler and uploader built for Apple Silicon, and then create a local configuration file that tells the Arduino IDE to use those updated versions.

I started by following the instructions here: Apple Silicon functional toolchain

The gist of this is to replace avr-gcc, ctags, and avrdude with apple silicon native versions, then to point the IDE preferences file to use the correct versions.

Step 1: Install avr-gcc

  1. Install Xcode Command Line Tools
    Before installing avr-gcc, make sure you have Xcode command line tools installed. Open your Terminal and run:

    xcode-select --install
    
  2. Install avr-gcc via Homebrew
    If you haven’t installed Homebrew yet, follow the instructions on brew.sh. Once it's set up, run the following commands to install avr-gcc:

    brew tap osx-cross/avr
    brew install avr-gcc
    

    At the time of this writing, avr-gcc version 9.4.0_1 is the latest. You can find the installed files under:

    /opt/homebrew/Cellar/avr-gcc@9/9.4.0_1/bin/
    
  3. Copy avr-gcc to Arduino Library
    To integrate the new compiler with Arduino, copy the entire version folder into the Arduino package directory:

    cp -r /opt/homebrew/Cellar/avr-gcc@9/9.4.0_1/ ~/Library/Arduino15/packages/arduino/tools/avr-gcc/
    

Step 2: Install ctags

  1. Clone the ctags Repository
    If you don’t have the GitHub CLI installed, you can install it with:

    brew install gh
    

    Then, clone the ctags repository:

    gh repo clone arduino/ctags
    
  2. Edit the Source Code
    Navigate to the cloned folder and edit the general.h file to fix a bug. Find the line:

    # define __unused__  __attribute__((unused))
    

    And replace it with:

    //# define __unused__  __attribute__((unused))
    # define __unused__
    
  3. Build and Install ctags
    Next, configure and make the build:

    cd ctags  # Navigate to the cloned ctags directory
    ./configure
    make
    

    Before replacing the existing ctags, back it up first:

    mv ~/Library/Arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags ~/Library/Arduino15/packages/builtin/tools/ctags/5.8-arduino11/ctags.bak
    

    Then, copy the newly built ctags to the Arduino package directory:

    cp ctags ~/Library/Arduino15/packages/builtin/tools/ctags/5.8-arduino11/
    

Step 3: Install avrdude

  1. Install avrdude Using Homebrew
    Just like before, install avrdude using:

    brew install avrdude
    

    After installation, copy the entire avrdude folder into the Arduino tools directory:

    cp -r /opt/homebrew/Cellar/avrdude/8.0 ~/Library/Arduino15/packages/arduino/tools/avrdude
    
  2. Locate and Copy the avrdude.conf File
    The necessary configuration file may be located at:

    /opt/homebrew/etc/avrdude.conf
    

    Create a directory for the configuration file within the Arduino tools structure:

    mkdir ~/Library/Arduino15/packages/arduino/tools/avrdude/8.0/etc
    cp /opt/homebrew/etc/avrdude.conf ~/Library/Arduino15/packages/arduino/tools/avrdude/8.0/etc/avrdude.conf
    

Step 4: Update Arduino IDE Configuration

  1. Quit Arduino IDE
    Make sure to exit the Arduino IDE completely.

  2. Edit platform.local.txt
    Open your favorite text editor and create a new file. Add the following lines to configure the IDE to use the new tools:

    compiler.path={runtime.tools.avr-gcc-9.4.0_1.path}/bin/
    tools.avrdude.cmd.path={runtime.tools.avrdude-8.0.path}/bin/avrdude
    tools.avrdude.config.path={runtime.tools.avrdude-8.0.path}/etc/avrdude.conf
    

    Make sure to save the file to:

    ~/Library/Arduino15/packages/arduino/hardware/avr/1.8.6/platform.local.txt
    

    (Remember, the Library folder is hidden by default; press Command + Shift + . to make it visible.)

Final Step: Restart the Arduino IDE

What? I just downloaded the Apple Silicon version, works fine. MacAir M3.

Have you enabled Rosetta for some other program? This is only if you don't want to have things run through Rosetta. Unless an update came out in the two weeks since I cobbled this together.

Surely a "clone" is more than you need? (although perhaps it's easier to do from the cli.)

avr-gcc version 9.4.0_1 is the latest.

The "latest avr-gcc" has added new chips via a "packs" mechanism. Arduino has instead added them to the avr distribution itself. If you want to use, say, a Nano Every (with ATmega4809), you'll probably need to move some files around.

Locate and Copy the avrdude.conf File

Why? I'd think the existing arduino avrdude.conf would work fine with the newer avrdude, and it might have additions not in the standard release (that are still compatible with avrdude itself.)

@westkf Maybe these optimizations would be better, but…not sure! I just wanted the IDE to work natively on Apple Silicon, and it hasn't seemed to be done in the four years these CPUs have been around, so this worked for me.

I didn't have Rosetta until 5 days ago and I have had this Mac with Arduino for about a year.

Thanks for sharing this information @jpurnell!


In case it will be useful to others who are interested in this subject, I'll add a couple releated links:

The Arduino developers are tracking the request for distribution of native Apple Silicon builds of Ctags here:

And for the AVR toolchain here:

If you have a GitHub account, you can subscribe to that thread to get notifications of any new developments related to this subject:


:exclamation: Please only comment on the GitHub issue thread if you have new technical information that will assist with the resolution. General discussion and support requests are always welcome here on the Arduino Forum.


1 Like