CPSC 453 Introduction to Computer Graphics
Howto
Sunday, January 16, 2005, 04:29 PM
Compiling your code in the lab

To compile a file named foo.cpp with G++ enter:

g++ -lGL -lGLU -lglut -lXi -lXmu -L/usr/lib64 foo.cpp

Here is a description of the above line:
g++ is the C++ compiler on Linux workstations
-lGL links the core OpenGL library
-lGLU links the OpenGL Utility library
-lglut links to the OpenGL Utility Toolkit
-lXi -lXmu are libraries that glut depends on
-L/usr/lib64 tells the linker where to find Xi and Xmu libraries.

The output will be a.out (unless you specify a different name with -o during compilation).



Tar (Tape Archive)

use tar <commands> <filename.tar.gz> where commands are as follows:
x for extract,
v for verbose,
f for file,
z for zip (faster) or j for bzip2 (better) compression, and
c for creating archives.

Example:

tar xvfz hello.tar.gz will unzip and untar the file and show you which folders/files were created

tar xvfj qtexample.tar.bz2 will bunzip and untar the file and show you which folders/files were created

tar cvfz menu.tar.gz menu/ will zip tar all the contents of the menu folder and zip it. It will show you which files were archived.

You could perform the processes in two steps:
tar cf assignment1.tar assignment1/
gzip assignment1.tar

and vice versa for decomprossion:
bunzip example.tar.bz2
tar xvf example.tar



Submitting Assignments

- Make sure your assignment compiles and runs on the undergrad workstations in MS 239.
- Archive all the files into one tar/zip or tar/bzip or zip archive.
- use submit -c 453 -a N where N is the assignment being submitted.

Example:

tar cvfz assignment1.tar.gz assignment1/
submit -c 453 -a 1 assignment1.tar.gz will submit the file assignment1.tar.gz



Producing PDF Files on Linux
Short Version:
1. Produce Documentation
2. Print to File to produce PostScript
3. ps2pdf <filename.ps> to produce PDF.

Long Version:
- You can use OpenOffice.org to write your documentations.
- Other options include: HTML via Mozilla Composer or plain HTML code and simple text files.
- Use the Print To File option in OpenOffice.org or Mozilla/Firefox/Konqueror to print the documentation you created. On Linux, this file will be in PostScript format.
- Use the program ps2pdf to convert the PostScript file to PDF. If you used plain ascii, then use a2ps (a2ps -1 <filename.txt> -i <filename.ps>)

Tip for Windows users:

There are a number of free PDF creators available for Windows. Search download.com, but beware of spyware. You can use the User Reviews to determine if the application is useful.