2021-07-09 22:53:28 +00:00
# Setting up a development environment on macOS
# Prerequisites
2022-01-07 12:04:05 +00:00
This installation guide assumes that you have [Homebrew ](https://brew.sh ) and Xcode installed. You need to open Xcode at least once for it to install the required tools.
2021-12-27 18:06:00 +00:00
Before you build, you must set your command line tools to Xcode's tools instead of the ones installed via Homebrew:
```console
sudo xcode-select --switch /Applications/Xcode.app
```
2021-07-09 22:53:28 +00:00
Make sure you also have all the following dependencies installed:
```console
# core
2022-11-02 16:46:37 +00:00
brew install coreutils e2fsprogs qemu bash gcc@12 imagemagick ninja cmake ccache rsync zstd
2021-07-09 22:53:28 +00:00
# (option 1) fuse + ext2
2021-07-29 12:05:25 +00:00
brew install m4 autoconf automake libtool
2022-01-18 01:24:07 +00:00
brew install --cask macfuse
2021-07-09 22:53:28 +00:00
Toolchain/BuildFuseExt2.sh
# (option 2) genext2fs
brew install genext2fs
```
2022-02-15 21:32:21 +00:00
If you're building on M1 Mac and have Homebrew installed in both Rosetta and native environments,
you have to make sure that required packages are installed only in one of the environments. Otherwise,
these installations can conflict during the build process, which is manifested in hard to diagnose issues.
Building on M1 natively without Rosetta is recommended, as the build process should be faster without Rosetta
overhead.
2021-07-09 22:53:28 +00:00
Notes:
2022-01-18 01:24:07 +00:00
- Installing macfuse for the first time requires enabling its system extension in System Preferences and then restarting
your machine. The output from installing macfuse with brew says this, but it's easy to miss.
2022-06-29 06:38:28 +00:00
- It's important to make sure that Xcode is not only installed but also accordingly updated, otherwise CMake will run into incompatibilities with GCC.