Clemson School of Computing (SOC)Mac and Linux C Development Guide

The purpose of this guide is to get you started with program development and assignment submission if you are using Mac OS or Linux.

In the syntax of any of the commands shown below, userid is your userid and host is a SOC public machine.

Developing Programs

Mac

Using a Terminal

Using Finder, select Go, Utilities, and then Terminal. A terminal window will open in which you can enter UNIX commands such as pico or vi(editors), gcc (the c compiler), or ssh(connect to another machine). When you are finished using the terminal, enter exit or logoff commands until you no longer get a command prompt.

Developing Your Program on Your Machine

You can develop your program on your computer by using Xcode or in a terminal window using an editor along with gcc. To determine if gcc is on your machine, enter a plain gcc command in a terminal window. If gcc is not there, you will get a command not found message. If it is there, you will get a no input files message. If it is not there, you will need to install Xcode (instructions below) even if you don’t use the Xcode IDE.

Developing Your Program on SOC Machine

You can also develop the program online using a SOC machine. Open a terminal window and then SSH to a SOC machine by entering the command

sshuserid@host.cs.clemson.edu

Example:sshjoesmoe@frog6.cs.clemson.edu

Reply in the affirmative to any notification messages or requests.

Installing Xcode

Xcode can be installed from You will need to set up a developer account, which is free, before downloading and then installing.Xcode contains an IDE with an editor, the compiler, and a debugger.

Linux

You can develop your program on your computer using a terminal or online on a SOC machine as described above for a Mac.

Transferring Files

If you have been developing on your machine, you will need to transfer your program and test files to a SOC machine and then compile and test your program to make sure that it works on a SOC machine.

Mac

You can use the scp or sftp procedure below or use fetch which has a graphical interface. Fetch is self-explanatory and can be downloaded from

Mac and Linux

From a terminal, you can use scp or sftp which is better if you have multiple files to transfer. When using either, reply in the affirmative to any notification messages or requests.

scp

Syntax: scp:host-filename
Examples:

scpprog.c :prog.c

scpprog.c :cpsc999/prog.c

You will need to enter your password for each scp command.

sftp

Syntax to connect: sftp:host-filename
and then enter your password.

Example:sftp

For each file to transfer, use a put command.

Syntax: putlocal-filenamehost-filename

Examples:put prog.cprog.c

putprog.c cpsc999/prog.c

After each put, you will receive a completed message with bytes transferred.

After transferring all your files, enter an exit command to exit sftp.

Submitting

  1. If necessary transfer your files to SOC using the steps above.
  2. If necessary open a terminal window and connect to a SOC host machine.
  3. Navigate to the folder in which your program is located.
  4. Enter the handin command indicated in the instructions for the assignment.

Clemson School of Computing

PDS.110818.1100Mac and Linux C Development GuidePage 1 of 2