Lab 0

Due January 21 by class time.

Using the CS server for programming

Goal

Convert a program from Data Structures to work on the CS server

Links

Step 1

Use SSH to log into cs.mvnu.edu

Username: Your email username (before the @)

Password: Your MVNU ID

Once logged in, change your password with passwd

Step 2

Review the Linux Shell tutorial

Step 3

Copy and build:

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}
Place code in hello.cpp
g++ -o hello hello.cpp

Run with "./hello"

How to put files on the server

Use secure copy (scp) or FTP from a MAC or Win computer.

Step 4

Port your own program

You goal is to select a program from Data Structures and get it to run on the our Linux Server. The program must be at least 100 lines of code.

If your program has multiple source files, copy them all, includeing the .h files, and then do the following:

Assume you have the following sources:

  • a.cpp
  • a.h
  • b.cpp
  • b.h
  • main.cpp
Then:

user% g++ -c a.cpp
user% g++ -c b.cpp
user% g++ -c main.cpp
user% g++ -o main a.o b.o main.o

Turn in

  1. Screen shoot(s) of your running program
  2. A brief writeup of your experience: What problems you encountered, what you learned.

Reference

Topic revision: r7 - 2016-08-16 - RobertKasper
 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback