This repository contains running examples for all the code snippets presented in the lecture slides of COMP35112 part 1.
Here we describe several ways to set up an environment to do these exercises. These environments can also be used to work on the lab exercises.
There are 3 ways to run the examples:
- Using Linux natively or in a VM
- Using VSCode and Docker on Windows or Mac
- Using GitHub Codespaces in your browser with any OS
We will use for marking the lab exercise Ubuntu 22.04, so you should use it too. You'll need to install a few Debian packages with the following commands:
sudo apt-get update && sudo apt-get install -y build-essential gdb valgrind \
manpages-dev openjdk-21-jdk openjdk-21-jre
If you are browsing the slides online, simply click on the snippet name, which
is the blue link at the bottom right of the snippet (in the example below it is
03-shared-memory-programming/src/pthread.c
).
That should launch the download of the file, you can them compile and run as seen in the course.
- Install VSCode and get the Dev Containers extension
- Install Docker
- Make sure Docker is running, Launch VSCode and bring up the command palette with the following command:
- On Windows, ctrl + shift + p
- On Mac, shift + command + p
- Choose the command
Dev Containers: Clone Repository in Container Volume
and type the repo URL on GitHub:olivierpierre/comp35112-devcontainer
The container image will take a bit of time to be fetched during the first launch. It is based on Ubuntu 22.04.
This is a volatile enviroment and all your modifications to the container's filesystem will be lost when you exit this VSCode window, hence it is not a good environment for working on summative (or complex formative) exercises.
Codespaces is normally a paid feature but you can get access to it for free with a student account.
Go to the repository page on GitHub, and click on Use this template
then
Open in a codespace
.
Files created in the codespace will persist until the codespace is deleted (this can be done through the this interface: https://github.com/codespaces).