CSCI-1411-Lab-Setup

CSE Grid: User directories, Uploading files, and Compiling Programs

This guide illustrates how to setup a basic directory structure for this course, how to upload a C++ program file, and finally compile the uploaded C++ program. The lab computers have all of the required software so it does not need to be installed; however, to work from any location other than the UCD network (or in the lab) this software will have to be downloaded and installed. PuTTY and WinSCP are required for terminal access and file transferring. Download them from the links provided below:

This guide includes the following topics:

HorizontalLine

Note: Click on any of the images in this guide to see a larger version (for reading the terminal commands).

HorizontalLine

Logging Into the VPN from a Remote Computer

In order to use PuTTY and WinSCP you must first connect to the UC Denver VPN (which can be downloaded from the link below). Once you are connected to the VPN you can use PuTTY and WinSCP just as you would in the lab.

Step 1: Download and install the VPN for your operating system (Windows 8 versions may not be as stable as those designed for previous versions of Windows). Once you install the VPN and run it: Start->All Programs->Cisco Systems VPN Client->VPN Client

Cisco UCD VPN Client

Cisco UCD VPN Client

Step 2: Click on the UCD-Downtown Campus choise under Connection Entries. Then press the Connect button in the upper-left corner. This will connect you to the VPN and prompt you for a username and password. Use your UCD username and password (just like in the lab).

VPN Username/Password

VPN Username/Password

VPN Connected, Press Continue

VPN Connected, Press Continue

Step 3: At this point you can use PuTTY and WinSCP just as you would in the lab. When you are done with your work, disconnect from the VPN (make sure you disconnect when your done with school related work): Goto Start->All Programs->Cisco Systems VPN Client->VPN Client and then press the Disconnect button in the upper-left corner (it replaces the connect button).

HorizontalLine

Accessing the CSE grid with PuTTY

To use the CSE Unix grid we have to send commands via a terminal. PuTTY allows us to access the CSE Unix grid terminal from any computer (note: more on the CU VPN will be discussed later). Logging into PuTTY will connect you to the CSE Unix grid and allow you to send commands to setup the directories (folders) required for storing lab work. Click any of the images below to see a larger version.

Step 1: Enter csegrid.ucdenver.pvt into the PuTTY Host Name text field
Step 2: Enter CSEGrid into the PuTTY Saved Sessions text field
Step 3: Press Save (To save the CSEGrid session)

Default PuTTY Settings

Default PuTTY Settings

PuTTY with the appropriate settings

PuTTY with the appropriate settings

Step 4: When presented with the “login as:” prompt, enter your UCD username.

PuTTY Username Prompt

PuTTY Username Prompt

Step 5: When presented with the “Password:” prompt, enter your UCD password (Note! As you type the letters will not show so make sure you enter your password correctly).

PuTTY Password Prompt

PuTTY Password Prompt

Step 6: The following image shows the PuTTY terminal once you have successfully logged in. This is where you can now enter Unix commands (cd, mkdir, etc)

PuTTY Unix Console

PuTTY Unix Console

Step 7: Enter ls to list the contents of the current directory (when you first start there shouldn’t be any files).
Step 8: Enter pwd to print the current working directory.
Step 9: Enter mkdir csci1411 to create a new csci1411 directory (folder).

PuTTY Basic Commands

PuTTY Basic Commands

Step 10: Enter cd csci1411 to change to the newly created csci1411 directory (if you want to go ‘up’ a directory level from where you currently are use the cd .. command)
Step 11: Enter mkdir lab1 to create a new lab1 directory. This is where you will upload your Lab-1 files. Change to this directory using cd lab1. If you enter the command pwd at this time you should have the following: export/homes/yourname/csci1411/lab1/ shown in your PuTTY terminal.

Correct csci/lab1/ directory structure

Correct csci/lab1/ directory structure

Step 12: Use the command exit to disconnect and exit PuTTY

HorizontalLine

Uploading Files with WinSCP

To manage the files on the CSE Unix grid, WinSCP must be used. This application will allow you to easily upload and download files from your lab directories.

Step 1: Enter csegrid.ucdenver.pvt into the WinSCP Host name text field.
Step 2: Enter your UCD username into the User name text field.

WinSCP Default Settings

WinSCP Default Settings

WinSCP Modified Settings

WinSCP Modified Settings

Step 3: When prompted to save the session, save it.

WinSCP Save Session Settings

WinSCP Save Session Settings

Step 4: After the settings have been saved click the Login button at the bottom of the WinSCP window.

WinSCP Default Window

WinSCP Default Window

Step 5: When prompted, enter your UCD password. A Warning will appear: “The server’s host key was not found…”. Ignore this and select Yes. Click Continue when the UCD banner is shown.

WinSCP Password Prompt

WinSCP Password Prompt

Step 6: WinSCP will now show your documents on the left side window and the contents of your directory on the CSE Unix grid. As an example download the Hello World program: main.cpp and copy it to C:\Users\yourname\Documents. Then in WinSCP copy main.cpp from your documents directory to the csci1411 directory by clicking and dragging main.cpp into the right window of WinSCP. You can move through the directories on both your local computer and the CSE grid by double clicking the directory names in the WinSCP split-view window.

WinSCP Main Window

WinSCP Main Window

Step 7: In WinSCP goto the main menu: Commands->Quit to properly exit WinSCP.

WinSCP Quit Command

WinSCP Quit Command

HorizontalLine

Uploading Files with a Windows Mounted Folder

This method can be used instead of using WinSCP.
Windows allows you to create a networked folder on your computer (one that you can treat as a normal folder) that will connect with your account on the CSE grid server. You can upload and down load files just by moving them into (or out of) the networked folder. Note: You must be connected to the UCD VPN to do this remotely. Tested on Windows 7 (images from windows 7). If at any point your asked for your username and password, provide your UCD username and password (untested).

Step 1: Open Start->Computer and right click in the empty region below the list of drives. There should be an option to Add a network location. Select this option and it will open an Add Network Location Wizard.

Add Networked Drive

Add Networked Drive

Add Network Location Wizard

Add Network Location Wizard

Step 2: Follow the instructions through the wizard: Choose a custom network location and then enter the following address into the Internet or network address text field: \\csenas.ucdenver.pvt\yourusername\

Choose a custom network location

Choose a custom network location

Enter the network address with your own username

Enter the network address with your own username

Step 3: Once the wizard is complete you can now open the network folder. You can treat this folder like any folder (meaning cut, copy, paste, create files, etc).

Windows Networked Folder

Windows Networked Folder

HorizontalLine

Compiling and Running C++ Programs on the CSE Grid

C++ source code can be uploaded to the CSE grid to be compiled and executed. Once a source file has been uploaded to the CSE grid in your directory, it can then be compiled and executed. This section describes how to compile an uploaded source file (*.cpp) and execute it (run the program).

Step 1: Login to PuTTY (the same as shown at the top of this page).
Step 2: Navigate to the directory where you uploaded the main.cpp file. (For example if you uploaded it to csci1411\lab1\ then you would use: cd csci1411 then cd lab1). Once you are where main.cpp is use the ls command to show the contents of the directory (to ensure main.cpp is there).

Navigate to the location of main.cpp

Navigate to the location of main.cpp

Step 3: Compile the source file using the following command: g++ main.cpp. This will compile the main.cpp file into a program named a.out
Step 4: Run the program a.out by issuing the following command: ./a.out. Be sure to type it exactly as shown so the program will run. The result of the program is shown in the lower right image (program output is shown in red).

PuTTY Compile Main (command: g++ main.cpp)

PuTTY Compile Main (command: g++ main.cpp)

Run Main (command: ./a.out)

Run Main (command: ./a.out)

The resulting output of the program is the text “Hello World!”.

Step 5: Use the command exit to disconnect and exit PuTTY