C++ software setup: Mac edition
As described in this week's lessons, in CS70 we use the Clang compiler.
There are other C++ compilers out there, but we'll stick with Clang here to be consistent with what's on the server.
But, you're free to look into other options on your own time!
On Mac OS, both the Clang compiler and Git can be installed at the same time as part of the XCode Command Line Tools package.
To begin, open the Terminal app (which can usually be found under Applications > Utilities > Terminal). Then, in the terminal, run the following command:
xcode-select --install
This will open a system prompt asking you to confirm the installation. Then it will download and install XCode Command Line Tools (which includes Clang and Git), and close automatically when finished.
If you already had the full XCode app installed for a previous class, internship, summer research, or other project, it already comes with XCode Command Line Tools, so you can skip all the above steps!
Finally, to confirm that Clang is working, run the following command in the terminal:
clang++ --help
This should print a massive chunk of documentation for the Clang compiler, which should start with something like the following:
OVERVIEW: clang LLVM compiler
USAGE: clang [options] file...
OPTIONS:
Likewise, test that Git is working, run the following:
git --help
This should print a help summary which starts with something like the following:
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
[-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
[--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
[--config-env=<name>=<envvar>] <command> [<args>]
(When logged in, completion status appears here.)