Labs Setup
This page contains instructions on how to set up your computer such that you can:
- program your assignments,
- share them with your teammate via a version control system,
- submit your labs for grading, and
- use our black-box testing system.
Step 1) Installing and Configuring Eclipse
You are by no means required to use an IDE. If you wish to do so, we recommend that you use Eclipse with the Scala plug-in. Skip this step if you are not going to use Eclipse.
We suggest that you download directly the Scala IDE package that contains Eclipse already. Make sure you get the version for Scala 2.11.
All labs will be done in pairs. We have set up a version control system around Git, which you will use to share your project code with your partner, but also to submit your labs.
Step 2) Creating a Public/Private SSH Key Pair
Authentication to the git repository works by using a SSH key. If you do not already have a private/public key combination for your computer, follow these instructions. Note that you typically generate one key pair per computer that you use.
From the Command Line
- Type
ssh-keygen -t rsa -b 2048
. - Type enter to save it in the default location.
- Choose a passphrase, or type enter to ignore it.
- Your public key is now stored in a file (typically, in ~/.ssh/id_rsa.pub). You will need to copy-paste the content of this file into our webservice.
Step 3) Project Web Interface
The web interface for your project will be directly linked to your git repository. It will allow you to run tests, submit deliverables, receive feedback, etc..
The web interface is located at http://larasrv09.epfl.ch:9000/clp15 (Tequila authentication required.)
As mentionned earlier, all labs will be done in pairs. Try to form groups of two as much as possible (despite what the interface may say, you are not allow to create larger groups). You will have the choice of either creating a new group or joining an existing group.
- Go to http://larasrv09.epfl.ch:9000/clp15 and authenticate yourself
- The first time you go there, you can either create a group or wait until somebody created a group with you.
- Once you are within a group, go to the YourName > SSH Keys tab, and register the Public SSH key you just generated. Make sure you copy your entire key, including the `ssh-rsa` prefix and the key identifier at the end.
Step 4) Setting up Your Project
You should start by installing Git and sbt for your platform.
From the Command Line
The first step is to clone the git repository:
$ git clone git@larasrv09.epfl.ch:clp2015-group??
(Exact URI is provided in the web interface under Repository)
Then, use sbt 0.13 (http://www.scala-sbt.org/) to compile your project:
$ cd clp2015-group?? $ sbt > compile > ... > run programs/Pi.tool
Create an Eclipse Project
To create an Eclipse project corresponding to your sbt project, install and run sbt, then:
$ sbt > eclipse
Note: if you encounter dependencies error related to sbteclipse, make sure you are running sbt 0.13!
You can then import this project from Eclipse, under File → Import… → General > Existing projects into Workspace
To run your project, you need to add a new Run Configuration based on Scala Application, use toolc.Main as Main class, and pass e.g. programs/Pi.tool as argument.
Troubleshooting
Dependency for sbt-eclipse not found
Make sure you are running sbt 0.13!
The Git repository is asking you for a password
No password will ever work. This simply means that the ssh key-pair is not properly installed.
Make sure the public key can be accessed under ~/.ssh/id_rsa.pub
and that you copied the entire key to the web interface:
ssh-rsa AASDFFOOBAR… foo@bar.com