Back to Resources

On Your Own Machine

by Tamara Nelson-Fromm, Jenny Chen

This guide will help you get started setting up an environment on your personal computer to let you do most of the labs and MPs without going into the EWS computer labs in Siebel. Choose one of the following two methods to achieve this: 1) remotely connect to the EWS server, 2) working natively from your computer.

For those who are unfamiliar with these terms, here is a short explanation of what each method means and the pros and cons of each.

Working Remotely

Please Note: if you are on an off-campus network you will need to use a VPN before connecting remotely

Out of the following methods, we recommend connecting with SSH since an excessive amount of FastX sessions tends to become unstable on the EWS cluster, and FastX connections can have unexpected behavior.

Use FastX for GUI

You can run a full desktop GUI session in browser or with a client using FastX. Follow the link to learn how to use it.

Use SSH for a terminal/console session

SSH stands for secure shell. It allows you to connect to a remote server using terminal securely.

For first time shell users who don’t know how to edit files through terminal, try these common command line text editors: nano, vim, and emacs.

Working Natively

Follow the guide for your own operating system.

Windows

The Windows Subsystem for Linux (WSL) is a tool allowing Linux to run in Windows natively.

  1. Follow Microsoft’s instructions for installing WSL, choosing Ubuntu as the distribution.
  2. Continue following Microsoft’s instructions for initializing your Ubuntu distribution
  3. Download the packages used for C++ by running the following command to install the packages we will be using:
sudo apt-get update; sudo apt-get install clang-6.0 libc++abi-dev libc++-dev git gdb valgrind graphviz imagemagick gnuplot make
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-6.0 100
  1. If you’re using Ubuntu 20.04 and/or running into issues with standard library include statements:
    sudo apt-get install clang
    

Using your Windows Desktop in WSL/Ubuntu

When you start Ubuntu, your shell will begin in the Linux home directory. However, you will likely want to work with files that are inside of your Windows file system. By default, your C: drive is mounted at /mnt/c.

Some find it useful to create a shortcut to jump directly to your Windows Desktop:

  cd /mnt/c/Users/
  cd <Your-User-Name-on Windows>  // Use `ls` to find the available users in green
  cd Desktop
  ln -s `pwd` ~/desktop

Linux

You should make sure you have the following packages installed:

After installing the required packages, you should now be able to check out, build, and run assignments as described in their documentation.

Ubuntu >= 14.04

To get the packages you will need:

sudo apt-get update; sudo apt-get install clang-6.0 libc++abi-dev libc++-dev git gdb valgrind graphviz imagemagick gnuplot make
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-6.0 100
sudo update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-6.0 100

If you have a different version of clang installed, you might need to remove it first. Alternatively, if you don’t mind using a different version of clang, you can use the other version instead – just make sure to test your code on EWS.

Arch

To get the packages you will need:

sudo pacman -Sy base-devel clang gdb valgrind graphviz imagemagick git gnuplot make

You will also need to install libc++ and libc++-abi from the AUR.

MacOS

To install Homebrew: (You can skip this if you already have Homebrew installed)

In your terminal, (Applications->Utilities->Terminal) run:

xcode-select --install

to install the Xcode command line tools.

Next, we will install the Homebrew Package Manager for macOS using the following command:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

To install the necessary packages:

We need to install some tooling packages for future assignments. Run:

brew install ghostscript
brew install imagemagick
brew install graphviz

As you run each of these commands, it is recommended to follow Homebrew’s instructions for updating your PATH and compiler variables.

LLDB

LLDB is the default debugger for Xcode, so you should already have it installed by now. It is very similar to the GNU debugger, GDB. Here is a LLDB cheatsheet

Valgrind

Homebrew can also be used to install Valgrind.

To do so, run:

brew edit valgrind

This will open your default code editor. In the opened file, change the URL in the head section from https://sourceware.org/git/valgrind.git to git://sourceware.org/git/valgrind.git and run the following:

brew update
brew install --HEAD valgrind