A. The compiler with which your programs must compile is the gnu compiler gcc. However, for gcc to be able to make use of the additional libraries we are using in this course, you need to tell gcc where to look. In order to simplify matters, gccx has been installed. gccx is a script which first tells gcc where to find the libraries for this course, then runs gcc normally. This way you can compile using gccx, which will act exactly like gcc, except that you won't have to tell it where the libraries are.
Q. When I type gccx I get a message like 'command not found'. What went wrong?
A.
Not everyone on the system needs to have access to gccx. The easiest way for
you to gain access is to edit the file .cshrc in your home
directory. Add the following line at or near the end of the file:
source /home/course/cs113/F96/.cshrc.cs113
Now log out and log back in again (or type source .cshrc). You should see a message which tells you that the environment for CS113 has been established. This will set some environment variables and aliases so that you have access to everything you need. If changes need to be made, we will edit .cshrc.cs113, and it will be updated everytime you log in.
(For you UNIX experts: gccx and the necessary library files are located in /home/course/cs113/F96/cslib. I plan to put other files you need to access in /home/course/cs113/F96/include. You can use this information to make the changes to your path yourself if, for example, you prefer a shell other than tcsh.)
Q. How do I use the "Makefile" for HW1?
A. Please make sure that you can compile your HW1 programs using our Makefile. Using netscape, go to the web page that has the description for HW1. Choose the link that goes to the "Makefile". While viewing this Makefile, choose "Save As..." from netscape's "File" menu. It will want to save the file as "Makefile.a1". Click on Ok.
Your must rename the file using the move command, at the UNIX prompt:
mv Makefile.a1 Makefile
Also, you must make sure the Makefile is in the same directory as you program files. If not, you will have to move the Makefile there. For example, if your files are in "hw1", you may need to do:
mv Makefile hw1
At the UNIX prompt, make sure you are in the directory with the Makefile and your source files, type:
make
It should create the files: hw1-temp, hw1-weight, hw1-sum, hw1-stats without any errors (if you've correctly written the programs).
Run each of them to make sure they work.
Don't forget to "submit" your source code when you are done and your programs work (as we did in discussion).
-Rob
Q. I don't know what I did, but the makefile wouldn't work when compiling, although separately gccx worked fine. It gave me some kind of error in line 28. Line 28 just says:
tidy:What do you think? did I paste it into emacs wrong or what? I've already submitted the files, and they work fine.
A. You need to use the saving procedure I mentioned in the last e-mail to save the Makefile. We have not had time this week to go into details of the Makefile (we will next week), but commands in the Makefile that generate files, like: $(CC) $(CFLAGS) -c hw1-temp.c have to begin with the TAB character. When you cut and paste often, TABS get turned into SPACES and thus the Makefile will no longer work. Saving the Makefile via netscape as previously mentioned will keep the TABS as TABS.
-Rob
Q. I didn't do the Makefile thing and gccx worked just fine and my programs ran just fine. They all compiled to a.out, but they worked fine. Is that OK, I already submitted my programs?
A. Well, the grader will be using the Makefile to check that your program compiles correctly, so you should verify that the Makefile works with your program.
Last update: 12 Sep 1996