If you use Cloud 9 exclusively on the course, all the programming will happen in an editor in your browser, and there is no need for you to install anything locally. When interacting with teachers – to get help and to demonstrate achievements – you will need to use Cloud 9. However, if you want to install things locally on your machine and use your own favourite editor, feel free to.
For those who do not want to tinker with their own machines, we suggest installing Vagrant to run a small virtualized Linux machine inside your computer to compile, debug, profile, etc. This will make it easier to remove any IOOPM-related file after the course, but also provides a dead-simple way to get a machine with all the necessary software. You can still install e.g., Emacs natively and edit your files through a graphical program, but compile and run in the virtual machine. Typically macOS users will suffer from tools like Valgrind reporting ghost errors (because Valgrind isn’t up to date with the latest macOS release yet), etc. Running inside a faux Linux machine fixes these problems.
Vagrant has pretty decent documentation, that is way more comprehensive than below.
- As a prerequisite, download and install Virtualbox (on macOS with homebrew:
brew cask install virtualbox
) - Download Vagrant and run the downloaded file (Windows) or install it with your package manager (Linux), (on macOS with homebrew:
brew cask install vagrant
) - Open a terminal, navigate to your IOOPM GitHub repository
- Create a directory for Vagrant with
mkdir vagrant
- Tell
git
to ignore this directory withgit-ignore vagrant
(see below if you have problems with this) - Go into that directory with
cd vagrant
- Download this Vagrantfile into the
vagrant
directory and rename itVagrantfile
without any.txt
ending (e.g.,curl http://wrigstad.com/ioopm18/misc/Vagrantfile.txt -o Vagrantfile
) - Run the command
vagrant up
– this will (only the first time, unless you destroy your virtual machine) download the vitual machine according to the specification inVagrantfile
and install the necessary packages
- Open a terminal, navigate to your IOOPM GitHub repository
- Run
vagrant ssh
to move inside the running virtual machine – now all commands you type run on the virtual machine instead - To find the files in your repo, navigate to
cd /ioopm
– typing e.g.clang -c assignment1/hash_table.c
will compile the file in the virtual machine - To disconnect from the virtual machine, simply use key:C-d
- To pause the virtual machine (e.g., to reserve battery power and memory), do
vagrant suspend
- To shutdown the virtual machine (e.g., to reserve battery power and memory, and some hard drive space), do
vagrant halt
- To resume a paused (suspended) vagrant box, do
vagrant resume
beforevagrant ssh
- To restart a stopped (halted) vagrant box, do
vagrant up
beforevagrant ssh
The following is installed (with the exception of to-be-added):
- C compilers: gcc, clang
- C debuggers: gdb, lldb
- Java: openjdk 8
- Editors: Emacs 25, Vim 8 (note: both are text-only – no graphical components)
valgrind
for debugging memory errors, finding memory leaks, and more!gcov
andgcovr
for code coveragegprof
andperf
for profiling etc.cproto
extract function prototypes from C code- GNU
global
andcscope
code navigation tools git
andtig
version controlcunit
andjunit
unit testing frameworks for C and Javamake
andcmake
build managementdoxygen
generate documentation extracted from comments in source filesssh
andtmux
love tmux!curl
get files, interact with web APIs etc.astyle
,indent
automatic code formattinghtop
check the processes running on the machinegnuplot
andgraphviz
to draw diagrams – used by doxygen (and you?)- terminal emulators: bash, zsh
- convenience: oh-my-zsh, zip, unzip
- to-be-added: tag, some aliases
Feel free to look up all of these programs and learn about them.
$ sudo apt-get install -y gcc clang libclang-dev lldb emacs25 vim tree make \ tmux curl astyle zsh linux-tools-common valgrind git libcunit1-dev doxygen \ xclip global zip unzip openjdk-8-jdk linux-tools-generic \ cscope cproto gcovr tig htop junit gnuplot graphviz cmake indent
where \
is a line break in the terminal and completely optional – used here for formatting.
- Open https://brew.sh/ in a browser, and copy-and-paste the installation command into a terminal and execute it
- Install the individual components in the list of software above, e.g., through
brew install gcc
, etc. – use this search index for finding brew packages
If not installed, install homebrew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Using homebrew, you can install the above thus:
brew install astyle cmake cproto cscope cunit curl doxygen gcovr git \ global gnuplot graphviz htop make tig tmux tree unzip valgrind \ vim xclip zip zsh
where \
is a line break in the terminal and completely optional – used here for formatting.
Install from https://emacsformacosx.com or use homebrew!
Install Xcode.app via App Store or run gcc
in the terminal. If not installed, a dialogue will appear – follow it.
Download and install from http://www.oracle.com/technetwork/java/javase/downloads/index.html
- Official installation guide: https://junit.org/junit5/docs/current/user-guide
- Stackoverflow installation guide, probably easier: https://stackoverflow.com/a/26977630/1283083