Instructions for Downloading the Labs ------------------------------------- 1) Your tutor will show you how to boot to linux 2) log in and start a browser From a command line (the prompt is probably >) type: > firefox& 3) Go to the ASP3012 Stars webpage: http://web.maths.monash.edu.au/~johnl/astro/ASP3012/stars.html 4) Go down to the section on the computer labs. 5) Right click on "Lab 1" (or which ever lab you are after) and select 'Save Link As'. This will open a dialog box to save the file in your home directory. Click on SAVE. 6) Now at the > prompt you should type: > tar xvfz ASP3012-Lab1.tgz 7) This will create a folder called ASP3012-Lab1 8) Type: > cd ASP3012-Lab1 9) This places you in that directory and if you do a ls command (for LIST files) you should see: > ls > total 248 184 Lab1-2009.pdf 4 makefile* 4 ODE1.f 12 PlotODE1.f 8 PlotRKF45-1b.f 4 RKF45-1b.f 8 le.f 4 ODE1err.f 4 ODE2.f 12 PlotODE2.f 4 RKF45-1a.f You may or may not have numbers associated with each file (depending on the default setup for your ls command) and you may or may not have as * after the names of the files. You will need the asterisk after the makefile so if you do not see that type: > chmod a+rx makefile (The * means the file is executable. The makefile must be executed to construct executable files from the fortran files, which are the .f files. The chmod command above sets the properties of the file to allow everyone to read and execute the file...a = all = everyone, r = read, x = execute.) If you want more info on a command in linux type > man "command" to see the manual page for "comand". For example > man chmod You may need to type "q" to get out of the manual page! 10) You can view the contents of files by typing > less "filename" for example to view the ODE1.f file you type > less ODE1.f 11) You can then make an executable program from the fortran file by typing > make filename SO to make ODE1.f into an executable file you type > make ODE1 NOTE: do not inlcude the .f in that line! ODE1.f does not need to be made...it already exists! ODE1 needs to be made. 12) Behind the scenes: linux sees your "make" command and then looks for a file called "makefile" which tells it what to do. Your makefile says something like: LIBS=-lm -L/Network/Servers/pgplotlibrary -lpgplot .f.o: f77 -c -O ${*}.f PlotODE1: PlotODE1.o f77 -o PlotODE1 PlotODE1.o -L/usr/lib ${LIBS} -L/usr/X11R6/lib -lX11 -lm You don't need to know this but if you want to... .f.o means make a .o (object) file from a .f (fortran) file The next line tells the computer how to do that: by using the f77 compiler - Fortran 77 is an international standard. It then turns the object file (.o) into an exectuable with the default name being the original, without the .f For some programs you want to use existing libraries of code. For example, to plot things we will use the pgplot set of routines developed at CalTech. So we need to tell the computer where they are and how to use them. This is included for each code that needs them. Its already done in the makefile, so you do not have to worry about it :-) 13) Now you have a file called ODE1. Do an ls to see it! > ls 14) To run it you just type its name: > ODE1 15) OK...NOW you need to know what the code does! So go and have a look at the pdf file Lab1-2009.pdf whichcontais the instructios for the rest of the lab. YOu can probably view Lab1-2009.pdf by typing either > evince Lab1-2009.pdf or > acroread Lab1-2009.pdf evince is a free program that reads pdf files, just like acrobat-reader.