COMS 1003: Introduction to Computer Programming in C Fall 2005 How To Submit Homework $Id: submission-HOWTO.txt,v 1.3 2005/10/25 03:22:35 locasto Exp $ ---------------------------------------------------------------------------- [Summary] Homeworks should be submitted to the appropriate folder in Courseworks as a single tar.gz file that conforms to the specifications described in this document. Homework submissions that do not conform to this standard will not be graded. If you make multiple submissions, only the last one before the deadline will count. Please name your submission according to the following format: hwX-UNI.tar.gz where 'X' is the number of the homework (1,2,3, or 4) and 'UNI' is replaced with your Columbia ID. For example, my submission for homework 1 would be: hw1-mel2008.tar.gz and would contain a single directory called 'hw1'. An example of creating this tar file is listed below. [Components] A homework submission should contain a directory with the following items: - a file named 'README' produced with a text editor (i.e., NOT MSWord) that: a) lists the name and CUNI of the student and anyone the student worked with b) explains how the submission satisfied the requirements of the homework in particular whether or not all problems were solved and to what degree. c) lists what sources, if any, the student used to produce the code code that solves the homework problems d) answers any written parts of the homework e) contains a list of source files and which homework problem they address - a file called 'Makefile' that controls the build process. An example of such a file will be provided to you. You can reuse this file with minor modifications. - any reasonable number of C source files (.c) and header files (.h) that contain the source code for your solutions. The files should be appropriately named so that the grader can distinguish which source files correspond to which homework problem. The homeworks rarely require more than one .c file per problem. ...and that's it. Do not include any binaries, object files, extra documentation, messages, backup files, assembly language files, web pages, core dumps, etc. To summarize, the only things that belong in your submission are a Makefile, a README file, and your source code. [What Are These Components?] The README is explained above, but it's basically the documentation explaining to the TA how you have completed the assignment. More on writing, reading, and using a Makefile is below, but in short, it is a file that contains a simple set of instructions that tell the tool 'make' how to build and compile your C program. The Makefile is NOT written in C. Your source code is simply the collection of .c files that provide a solution to the homework problems. [What is a Makefile?] The process of compiling is often repetitive. You edit your code and make a small change and then compile. You may get an error during compilation or testing, so you make another edit and compile again. Typing 'gcc -Wall -o myprog myprog.c' (or some such) gets boring. Humans are not really good at repeating things, so the process of compiling (using gcc to compile your C code to machine code) can be automated. This automation is accomplished by using another tool called 'make.' A Makefile is a specially named file that tells 'make' how to compile C source code. Usually, once you've written a Makefile and stored it in the same directory as your source code, all you have to do to build your source code (I will use the terms 'build' and 'compile' as synonyms) is type 'make' at the command prompt. A Makefile is always named 'Makefile' There is a sample Makefile available on the course website. We will also cover the basics of creating and using a Makefile in the recitation sessions. However, here are two important points: your Makefiles should always contain a 'clean' target; that is, typing the following at the command line: $ make clean will delete object files, executables, and backup files, just leaving your source code, the README, and the Makefile. Secondly, your Makefile should always tell gcc to compile with warnings on by passing the -Wall switch to gcc. Your submission should compile without warnings. [How Homeworks Are Evaluated] Homeworks are downloaded, untarred, compiled, and run against a test suite by the TAs. Any submissions that do not compile, or compile with warnings, will not be graded (i.e., they will receive a grade of zero). Therefore, it is to your advantage to accomplish small tasks completely in the homework (and explain this in your README) if you are unable to finish the whole problem. It is better to be graded on a single working sub-part than a broken whole. The test suite will exercise your program to make sure you solved all parts of the problem. Your programs will be evaluated partly based on the output they produce under this test suite. Then, the TA will examine your source code to make sure that you used the correct techniques to obtain your answers. The TAs have a scoring rubric that will be applied consistently to each student's submission. We are looking for specific skills and uses of the language constructs. So, while your program may produce partly correct output, it will lose points if it doesn't use the correct techniques. [Example Submission] $ cd ~ $ cd coms1003/code $ ls hw1/ hw2/ hw3/ hw4/ $ cd hw1/ $ make clean $ ls fib.c grand.c Makefile pt.c README $ cd .. $ tar -cf hw1-mel2008.tar hw1/ $ gzip hw1-mel2008.tar $ ls hw1/ hw1-mel2008.tar.gz hw2/ hw3/ hw4/ $ Now you can scp or sftp this file from the CLIC machines to your local host or upload it directly (if you are at the console of a CLIC machine) to CourseWorks. [Common Mistakes to Avoid] 1. Submitting a non tar.gz file or submitting a .zip file. Dont' use zip or Stufit or something else equally not equivalent to 'tar' and 'gzip'. In other words, use 'tar' and 'gzip' as you saw them used above. 2. Submitting a file containing all your object files as well as your source files. Make certain that you 'make clean' before tarring up your submission. 3. Not compiling with warnings on. Make sure you invoke gcc with the -Wall parameter. 4. Mis-naming your submission as something other than hwX-UNI.tar.gz