CSCB09 Software

This course uses Linux and its C compiler all the time. The MathLab server runs Ubuntu version 22.04. MathLab is the only platform for resolving disputes over auto-testing; “my code passes test cases elsewhere” is not a sufficient condition to earn marks.

The MathLab server is remotely accessible by SSH.

MathLab blacklists an IP address whenever there are multiple failed logins; if this happens to you, you can seek help from me or the sysadmin, but you need to use this page to discover your IP address and report it to me or the sysadmin.

SSH-connect to MathLab

The standard command-line-in-terminal SSH software is known as OpenSSH Client and comes with Linux, macOS, and Windows (check Settings -> Apps -> Optional features; add if necessary).

In Windows Command Prompt, Windows Powershell, Windows Terminal, macOS Terminal, or Linux Terminal:

ssh utorid@mathlab.utsc.utoronto.ca

Replace utorid by your UTORid.

The first time you will be asked:

The authenticity of host 'mathlab.utsc.utoronto.ca (142.1.96.164)' can't be established.
ECDSA key fingerprint is SHA256:ZFiDGg3D4ntNWdGYybm7BDm0hXH/Ky19P1OfNDepbRg.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 

That fingerprint line could also be one of

ED25519 key fingerprint is SHA256:aewpvx941TRmv71s78jRHmR853du8vif66aW3G+xw2M.
RSA key fingerprint is SHA256:LGO3QK3/nF63C9Xd5O+AelO8NcVqoGaf3nqQ1L5eR5k.

It is safe to answer yes.

Then you will also get (unless you're on UofT network):

Autopushing login request to phone...

It refers to the UofT Duo two-factor authentication on your smartphone. So take out your smartphone and accept.

For file transfer, look into the commands sftp and scp (whichever one you like most).

There are GUI alternatives for Windows and macOS, especially nicer for file transfer. On Windows, past TAs and students liked MobaXterm (the home edition suffices). I am not familiar with macOS alternatives.

Optional Configuration

For further convenience, ssh settings can be set on your computer, in home directory (on Windows usually C:\Users\<account>; not “Documents”), in folder .ssh, filename config (no extension). Use a text editor to create/edit.

# This is how to write a comment.

# Start a group of settings applicable to mathlab.
Host mathlab.utsc.utoronto.ca
# Specify mathlab user name once and for all. You don't need to repeat "utorid@" again!
User utorid
# Reuse an existing connection whenever possible.
# Mathlab has a limit on co-existing connections per user.
# However, I can't get it to work on Windows.
ControlMaster auto
ControlPath %d/.ssh/socket-%C

Your Own Ubuntu Inside VirtualBox (x86-64 CPUs)

With VirtualBox, a virtual machine program, you can install your own copy of Ubuntu (and later remove) in a sandboxed way without disturbing your existing OS. A virtual machine is a sandboxed simulated computer.

Although MathLab is the auto-testing standard, the latest Ubuntu version is very likely to be compatible. Please still do one final test on MathLab just in case.

The Ubuntu website has a tutorial showing the whole process.

The installation process doesn't automatically install the C compiler and other packages used in this course. After you boot into the installed Ubuntu, you need to run this command by hand in a terminal to install them:

sudo apt install gcc libc6-dev make manpages-dev glibc-doc valgrind

Your Own Ubuntu Inside UTM (M1, M2, …)

With UTM, a virtual machine program, you can install your own copy of Ubuntu (and later remove) in a sandboxed way without disturbing your existing OS. You can safely choose either “Download on the App Store” (there is a small price) or “Download from GitHub” (free of charge).

Although MathLab is the auto-testing standard, the latest Ubuntu version is very likely to be compatible. Please still do one final test on MathLab just in case.

The UTM guide for installing Ubuntu has further instructions. You will need “Ubuntu Server for ARM”. In this context, “server” just means no GUI, only a text terminal; don't despair, the guide tells you how to install the GUI after the fact. You can just go with defaults for most settings, they can be changed later. This article shows more details on what to expect. (It says Ubuntu 20.04, but Ubuntu 24.04 works the same way.)

The installation process doesn't automatically install the C compiler and other packages used in this course. After you boot into the installed Ubuntu, you need to run this command by hand in a terminal to install them:

sudo apt install gcc libc6-dev make manpages-dev glibc-doc valgrind