Department of Computer Science | Institute of Theoretical Computer Science

CADMO - Center for Algorithms, Discrete Mathematics and Optimization

Algorithms Lab - Virtual Box

Algorithms Lab Technical Instructions & Frequently Asked Questions (FAQ)


General Information

For the Algolab, we use

This page is here to help you to get these technical details out of the way as quickly and painlessly as possible.


Algolab in the Computer Labs

The computer rooms CAB H56/H57 and HG E26.1 are equipped with the necessary software and are reserved for Algolab during the problem-of-the-week timeslot on Monday.

We recommend that you use the Fedora operating system on these machines. On those C++, BGL and CGAL should run fine and with recent versions.


Native setup on your own Machine

Linux

Just download the most recent g++, boost and cgal packages from your favorite package manager. On Ubuntu for instance, just run

sudo apt-get install build-essential libboost-all-dev libcgal-dev cmake cmake-data

Mac OS X / macOS

First install Xcode (via the App Store) which includes a recent version of the LLVM C++ compiler. To install Boost and CGAL, we recommend either Mac Ports or homebrew which offer packages for both of them.

Windows

Getting everything to run with cygwin can be a pain. We recommend that you use our VirtualBox image, see below.


Algolab Virtualbox Instance

You can download a VirtualBox image with the libraries preinstalled here!

Preface

The goal of this virtual machine is to provide you with a hassle-free way to get started with the BGL and CGAL libraries for the Algorithms Lab.

We use Ubuntu as the operating system. A program called VirtualBox allows you to use it within your existing operating system. This guide is mostly for users of Windows and OS X. If you are using Linux, it's probably easier to just install the necessary packages for Algolab directly on your machine. But if you don't want to fill your machine with CGAL and Boost packages that you only need for the course, then this virtual machine (VM) might also be useful for you.

Important warning: Updating Ubuntu within the VM might lead to instabilities with VirtualBox. We recommend to just use the VM as it is.

Installation of VirtualBox

  1. Download the VirtualBox client for your operating system (called host operating system) and install it. (If you run into trouble, see the troubleshooting section below.)
    For the installation just follow the instructions of the assistant and consult the documentation on the download page if necessary.
  2. Download the file algolab64.ova (~3 GB) and save it to your hard disk. Make sure that the file ending .ova is kept.
  3. In the next step, you have to import this file in the VirtualBox client. Fire up your VirtualBox client and choose "File -> Import Appliance..." in the menu. In the dialog, pick the location of algolab64.ova. Press "Continue" to get to this screen:

    Import Dialog

    We recommend to keep everything as it is, but if you want to use less or more working memory (RAM) for the guest system, you can change it here. The recommended requirement for system memory is at least 2 GB. We recommend to stick with the default of 4096 MB or only to increase/decrease it if your machine allows/does not allow it.
    Then press "Import" and be patient until everything is copied.
    Comment: You can delete the file algolab64.ova after the import.
  4. If the import was successful, then you should see the following:

    Shared Folder

    Before you start Ubuntu, we would like to setup a shared folder between the guest and the host operating system. This will allow you to easily share files between the two systems. First, create a new folder on your host operating system for this purpose, for instance on your desktop. You can name it however you like, for instance algolab.
    Now go back to VirtualBox. Pick the entry AlgoLab on the left, right click, select "Settings" and then "Shared folders". You should see the following screen:

    Where to Press

    Press the "Add Shared Folder" Symbol (green cross). This screen appears:

    Precise Name

    As "Folder Path" pick the folder that you just created on your machine (in our example algolab). As "Folder Name" you must absolutely have vb_shared, regardless of what you called the directory on your hard disk. Then press "OK" twice.
    As soon as you start Ubuntu this directory of your host system should be linked with the folder vb_shared on the desktop of Ubuntu.
  5. Now we are good to go! You can start your virtual machine.

    Credentials

    Username and password of the only account in the machine are both algolab. However, the system should log in automatically so you should only need it if you want to install additional software within the virtual machine.

Frequently Asked Questions (FAQ) / Troubleshooting

Quick Links

VirtualBox Installation

Importing the Virtual Machine into VirtualBox

If you get an error when importing the appliance which says that the "compressed image is corrupted", then something probably failed when downloading the file algolab64.ova. In that case it should help if you just download algolab64.ova again. If that does not help, try another browser or do it while connected at ETH.

Code Expert

Where can I submit?

Just click on the name of the problem on the exercise overview page on Code Expert.

Run errors only on the judge

If you access a vector outside of its bounds, i.e. at V[V.size()], then many different things can happen. On your local machine, e.g. if it is running macOS, it might seem to run fine, your program reads a zero value and continues. On Code Expert however, your program most likely crashes and gets the verdict "RUN ERROR". Luckily, there is an easy way to locally check whether you run out of the bounds of any standard library container: Just compile with the g++ flag -D_GLIBCXX_DEBUG. If you are using clang++ (default on macOS), then use -D_LIBCPP_DEBUG=0 instead.

Boost Graph Library (BGL)

No support for bundled properties

Bundled Properties could be nice to cleanup the template code in our graph definitions. Unfortunately, there is no obvious way on how to make them work with the flow algorithms that we need for the course, so we currently recommend that you do not use them.

Exam

Can I bring my own keyboard (or any other custom hardware)?

No.

What material is available during the exam?

Everything on the course documentation page (lecture slides, code templates, library manuals) is available during the exam. The moodle and your past submissions are NOT available. If you would like to propose some helpful scripts to all the students to be added here, please post it in the Moodle forum "Exam Tools".

Other

I cannot access the documentation on algoab.inf.

The course documentation is only available from within the ETH network. If you get an Error 403, please use ETH VPN.

Further Help

If you still run into weird errors or you have any other questions, do not hesitate and ask in the Moodle forum. We are happy to help.