Tools

Mac

Make sure you have the command-line developer tools installed: xcode-select --install. You probably also want to install Homebrew.

Use Homebrew to install the following:

  • cmake
  • clang-format

Valgrind

On Intel Macs, you can install Valgrind with brew install valgrind.

On M1 Macs, we can try installing Valgrind by building from source: 1) brew install autotools 2) Download the latest release and expand the archive 3) run ./autogen.sh 4) run ./configure 5) run make 6) run make install You may need to use sudo for some subset of the commands. (I haven't been able to try this on an M1 Mac. I did build successfully on my linux machine, so there aren't any extremely obscure dependencies.)

Looks like Valgrind doesn't build on M1 Macs. Check out the VSCode Remote Containers Extension for what is likely the quickest route to a nice setup.

Setting up clang-tidy

I found the following gist showing how to set up clang-tidy on OS X. (You can skip the clang-format symlink.)

Windows

If you have a linux VM set up from a previous course, see the Linux section below.

While it requires more setup, Windows Subsystem for Linux is probably more convenient to use than a VM. Instructions for setting up WSL are here. There's also a tutorial focused on setting up a development environment. There is also a VSCode tutorial for C++ on WSL.

Despite the name, the VSCode CMake Tools on Linux tutorial also applies to Windows once you download CMake.

Linux

You'll want to install the following packages if you don't have them already (these are the Ubuntu package names):

  • build-essential (g++, make, libc6-dev, etc)
  • cmake
  • clang-format
  • clang-tidy
  • valgrind

IDEs

You're welcome to use whatever IDE/text editors you like.

  • VSCode is free and cross-platform. It has nice WSL support.
  • CLion has a free student license (it's good for a year and can be renewed)
  • Visual Studio has a free communtity edition. Note: Windows-only. The Mac version does not have C++ support
  • XCode for OS X.