Setting up MacOS for CS 2810

Install Homebrew

Homebrew is a command line tool for MacOS for installing open source software. If you do not already have it, install it here:

Note: when it finishes it will give you some important instructions on how to add homebrew to your search path. If you ignore these instructions you will not be able to use the brew tool normally.

Install LLVM with RISC-V cross-compiler support

Now install the llvm suite of tools with these two commands:

brew install lld llvm
brew link --force llvm

Troubleshooting

If clang runs when you type make on an assignment but always fails to build assembly files, you may have missed a step when you installed Homebrew: it prints out some instructions that are easy to miss:

If this is happening, try running this command (this is what Homebrew told you to run but you may have missed):

echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> $HOME/.zprofile

Then close your terminal/shell window and re-open it and try running make again.