-
Notifications
You must be signed in to change notification settings - Fork 149
Building AVRDUDE for macOS
mcuee edited this page Dec 2, 2022
·
38 revisions
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
The following two build systems are supported.
To build AVRDUDE for macOS using MacPorts, run the following commands:
port install cmake hidapi libftdi1 libusb libelf
git clone https://github.com/avrdudes/avrdude
cd avrdude
./build.sh
...
To build AVRDUDE for macOS using Homebrew for macOS Intel or macOS Apple Silicon, run the following commands:
```console
brew install cmake hidapi libftdi libusb libelf
git clone https://github.com/avrdudes/avrdude
cd avrdude
./build.sh
macOS ships libedit which is a replacement of GNU Readline. As of Dec 2022, with the various fixes in place, libedit is considered as good enough for macOS for the purpose of avrdude, GNU Readline is not required.
In case you still prefer to use GNU Readline, you can follow the instructions below.
brew install cmake hidapi libftdi libusb libelf readline
git clone https://github.com/avrdudes/avrdude
cd avrdude
(for macOS Intel)
cmake -D CMAKE_C_FLAGS=-I/usr/local/include -D CMAKE_EXE_LINKER_FLAGS=-L/usr/local/Cellar -D HAVE_LIBREADLINE:FILEPATH=/usr/local/opt/readline/lib/libreadline.dylib -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_darwin
(for macOS Apple Silicon)
cmake -D CMAKE_C_FLAGS=-I/opt/homebrew/include -D CMAKE_EXE_LINKER_FLAGS=-L/opt/homebrew/Cellar -D HAVE_LIBREADLINE:FILEPATH=/opt/homebrew/opt/readline/lib/libreadline.dylib -D CMAKE_BUILD_TYPE=RelWithDebInfo -B build_darwin
cmake --build build_darwin
port install cmake hidapi libftdi1 libusb libelf readline
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_darwin
cmake --build build_darwin
To install a local build on your system for MacPorts, run the following commands:
sudo cmake --build build_darwin --target install