Computer Tutorial

Read these carefully for course policy and procedures.
Post Reply
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Computer Tutorial

Post by goodwine »

I would strongly recommend that you use the linux machines in the computer labs on the first floor of Fitzpatrick for some, if not all, of you assignments. The examinations will be held there and it having to use a different platform may cause some problems, which is something I assume you don't want during an exam.

Here are the steps to use the linux machines.
  1. Log on.
  2. If it is the first time you have logged on or you haven't modified your account, it should start the gnome window manager.
  3. You should do most things from a terminal window (a window with a command line where you have to type commands). To open a terminal either
    1. right click on the background and the top option should be "open terminal" or
    2. under "system tools" on the main menu (the red hat) there is a terminal option.
  4. A few useful commands are:
    • pwd ("print working directory"): prints the directory you are in
    • mkdir ("make directory"): makes a new directory (a directory is a folder)
    • cd ("change directory"): e.g., "cd Private" will put you in the Private directory
    • mv ("move"): e.g., "mv hw1.f Private" would move the file hw1.f into the Private directory.
    There is also a "file browser" under the red hat applications menu. You may use that to make new directories and move files around, etc.
  5. To start your editor either find it somewhere in the redhat applications menu or type it in the terminal. I do the latter, e.g., "emacs hw1.f" will start emacs and open the file hw1.f. If the file doesn't exist it will remember the name and save it as that when you save.
  6. Make sure all your programs end in .f because most editors are smart enough to recognize that as a fortran file and will do the right syntax highlighting and indentation.
  7. Some terminal hints:
    • If you type something like "kate hw1.f" you will not be able to type any more commands in that terminal. You could simply open another terminal if you want. Alternatively, if you type "kate hw1.f &" the basic effect of the ampersand is to give the prompt back to you so you don't have to open another terminal. (Note, the editors vi and vim do not open another window, so you do NOT want to put an ampersand at the end of the command if you use those).
    • The up and down arrows take you back and forward through the previous commands you typed.
  8. How to recreate what I did in class.
    1. If you want, you can download the file I wrote.
    2. Edit the file. I would type "emacs pi.f &" after you save it.
    3. Change something. For example change "you entered" to "you said this many steps"
    4. Save it.
    5. Compile it by typing "pgf77 pi.f"
    6. If there are no errors, run it by typing "a.out"
    7. Note that every time you change the text file you must recompile the program. Otherwise you will be running the old one.
    8. If you think "a.out" is a stupid name" you can tell the compiler to name it something else by using the "-o" option, e.g., if you compile by typing "pgf77 -o piprogram pi.f" you would run it by typing "piprogram"
Good luck! If you have any questions post them here and I will do my best to answer them.
Bill Goodwine, 376 Fitzpatrick
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Computer Tutorial

Post by goodwine »

Someone asked me:
I just attempted to do homework 1, and I was going through the steps of your Linux tutorial, when i encountered an issue I couldn't solve. After saving my program with Kate, all of the "pgf77 prof.f" commands read back "Command pgf77 not found." I check my spelling, tried other file names, and logged in/out, and tested in on several different machines, but the the command was never found. I tried "a.out" as well as and that was not found either. I was wondering if my section of the AFS does not have the right file libraries or something? Is there a way to solve this?
I can't help solve it very well without being there with you, but I can kind of diagnose it. I would say there is a 99% chance that your path isn't set up correctly. In a terminal, type "which pfg77" or "which f77" and if it says command not found, then the path that your account searches for commands isn't set to include some default directories. If you want to solve it tonight, then you need to see if there is a consultant in there to help you with your path settings.

If you can't find help tonight, then you can try to find me tomorrow; alternatively, if you can wait until Tuesday night I can help then.
Bill Goodwine, 376 Fitzpatrick
msobole1

Re: Computer Tutorial

Post by msobole1 »

I am not sure if I am running my program correctly. Where should I be typing in "a.out"? When I try to run it, the program asks me my first prompt ("Enter the number of terms"), but when I try to respond to it nothing happens.
msobole1

Re: Computer Tutorial

Post by msobole1 »

Scratch my last post, I figured it out. Thanks anyways.
amrugala

Re: Computer Tutorial

Post by amrugala »

I have resorted to copying almost word for word the program used in the notes and have not been able to get rid of the error 'PGFTN-S-0026 Unmatched quote.' I have googled every conceivable phrasing of the error and there is no explanation as to exactly what is wrong with my code (it looks just like other perfectly functional ones). Could you tell me what this error means?
goodwine
Site Admin
Posts: 1596
Joined: Tue Aug 24, 2004 4:54 pm
Location: 376 Fitzpatrick
Contact:

Re: Computer Tutorial

Post by goodwine »

amrugala wrote:I have resorted to copying almost word for word the program used in the notes and have not been able to get rid of the error 'PGFTN-S-0026 Unmatched quote.' I have googled every conceivable phrasing of the error and there is no explanation as to exactly what is wrong with my code (it looks just like other perfectly functional ones). Could you tell me what this error means?
That means that there is a quotation mark in your program that doesn't match up with either an opening one or a closing one. The error is probably on one of your "print" lines.
Bill Goodwine, 376 Fitzpatrick
Post Reply

Return to “Course Administration”