Many of the practical problems will require access to a Unix shell and common Unix tools. This page describes how to do so on your own machines.
If you run Linux, then everything you need will be easily available in your distribution's package manager, or it may even be installed already. Congratulations!
Here is a conservative list of the software you'll need for this course:
apt-get
is the general package manager for your Debian/Ubuntu. You can use it to install the following packages.- GCC and
Binutils. On
Debian/Ubuntu you get these with the
build-essential
package. On Arch Linux/Antergos this is called base-devel. - GDB. In most package managers
this is called
gdb
. You can also use LLDB if you wish. make
. The build tool. You also get this with thebuild-essential
package.
Further, the following tools are recommended:
- Valgrind for detecting memory errors
in C programs. Available as
valgrind
in most package managers.
You will need to use the Windows Subsystem for Linux. Click here for Microsoft's own instructions.
After this, follow the Linux instruction given above.
macOS is a Unix system, but the necessary tools are not quite as accessible as on Linux.
Homebrew is a package manager (similar to apt
on Linux) that contain
ports of many Unix programs. When you get a new Mac, this should be
the first program to install, as it is the most useful.
- Install Homebrew (http://brew.sh/)
You can install most things you need through Homebrew.
GDB (a C debugger) is tricky to get working on macOS. Instead, you
should use LLDB (lldb
), which has equivalent functionality for our
purposes, and almost the same commands. See this GDB to LLDB command
map, and note that you likely
need only a small fraction of these commands for HPPS.
The valgrind
tool unfortunately does not work on macOS. Instead, you
can use address sanitizer: pass -fsanitize=address
to the C
compiler. This also works on Linux.