Skip to content

Building AVRDUDE for macOS

mcuee edited this page Nov 21, 2022 · 38 revisions

Prerequisites

On macOS, you can normally install AVRDUDE through MacPorts (port install avrdude) or Homebrew (brew install avrdude).

The following things are needed to build AVRDUDE on MacOS:

  • A C compiler; either full XCode, or the XCode Command Line tools
  • cmake, hidapi, libftdi1, libusb, libelf

Note: GNU Readline was required after the merge of PR #1132 due to a bug with macOS bundled libedit. However it is no longer necessary after the merge of PR #1185 which provides the workaround.

They can be installed from

Homebrew:

brew install cmake hidapi libftdi libusb libelf

MacPorts:

port install cmake hidapi libftdi1 libusb libelf

Build Instructions

To build AVRDUDE for macOS using MacPorts, run the following commands:

git clone https://github.com/avrdudes/avrdude
cd avrdude
cmake -D CMAKE_C_FLAGS=-I/opt/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/local/lib -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_macos
cmake --build build_macos

To build AVRDUDE for macOS using Homebrew for macOS Intel, run the following commands:

git clone https://github.com/avrdudes/avrdude
cd avrdude
cmake -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_macos
cmake --build build_macos

To build AVRDUDE for macOS using Homebrew for macOS Apple Silicon, run the following commands for macOS Intel:

git clone https://github.com/avrdudes/avrdude
cd avrdude
cmake -D CMAKE_C_FLAGS=-I/opt/homebrew/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_macos
cmake --build build_macos

Installation

To install a local build on your system for MacPorts, run the following commands:

sudo cmake --build build_macos --target install