Here are the steps to use the linux machines.
- Log on.
- If it is the first time you have logged on or you haven't modified your account, it should start the gnome window manager.
- 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
- right click on the background and the top option should be "open terminal" or
- under "system tools" on the main menu (the red hat) there is a terminal option.
- 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.
- 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.
- 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.
- 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.
- How to recreate what I did in class.
- If you want, you can download the file I wrote.
- Edit the file. I would type "emacs pi.f &" after you save it.
- Change something. For example change "you entered" to "you said this many steps"
- Save it.
- Compile it by typing "pgf77 pi.f"
- If there are no errors, run it by typing "a.out"
- Note that every time you change the text file you must recompile the program. Otherwise you will be running the old one.
- 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"