We were assured the systems would work so that ssh to portal would solve all our future needs. Reports from early labs suggest that is not the case. Hence, this lab is designed to make sure each of you have an alternative setup you could use.

You are encouraged to do this lab on your own at home, then just quickly check it off with a TA. Once you finish, there is no need to remain in lab.

To complete this lab, do both of the following:

  1. Show a TA you can use ssh and module load to follow the instructions in the section Show at least this below on portal.cs.virginia.edu.
  2. Show a TA you can use a virtual box or other system on your own computer to follow the instructions in the section Show at least this below on your own computer.

1 Show at least this

  1. Make and enter a directory named tools_test

  2. Create a file there1 named hello.c which contains the following C code.

    #include <stdio.h>
    int main() {
        puts("This file shows your C toolchain is working");
    }

    We will explain this code later, but want to make sure you have C working first.

  3. Run the following and show the output to a TA. Several of these commands will display things, and the last two (run and quit) will have a different-looking prompt than the others. Both ./a.out and run should have, as part of their output, This file shows your C toolchain is working.

    pwd
    clang hello.c
    ./a.out
    lldb a.out
    run
    quit

2 How-to on portal

You’ve seen how to ssh into portal.cs.virginia.edu before. Some things you should know for this:

You have to load modules

The CS servers hide most programs until you ask for them. You ask for them by running module load and then the module you want to access the programs inside of. The modules we’ll need in this class are

  • module load clang-llvm
  • module load nano (or module load emacs if you prefer emacs, or no module needed if you prefer vim)

Other than loading these modules after you ssh in to portal (each time you ssh into portal), you should be able to use the skills you learned in Lab 00 and Lab 01 to complete the Show at least this material.

3 How-to on your own

After you have portal working, you are welcome to try also doing it on your computer.

If you run a mostly POSIX-compliant operating system (Linux, FreeBSD, OpenBSD, AIX, Solaris, and almost all the others with one notable exceptions), you can probably get clang, git, and lldb to work with no extra effort.

As a special case, macOS is POSIX-compliant but by default does not include most of the tools we’ll need, has a slightly different take on some parts of C than normal, and often has commands hidden under non-standard names or the like. If you install clang and lldb through the macOS developer tools, you can probably use your macOS machine directly with no virtual machine. You are welcome to do this, but note that we may not be able to help if something goes wrong. Note that we know macOS will not be able to do Lab06 and HW06; everyone will have to use portal there.

If you run Windows, there’s a thing called the Windows Subsystem for Linux which can let you make windows (almost) act like a POSIX-compliant OS. You are welcome to do this, but note that we may not be able to help if something goes wrong.


  1. You learned how to do this in Lab 00 using one of Nano, Emacs, or VIM. If you did not, you needed too; please go back and do that part of Lab 00 now!↩︎