GNU FORTRAN Unofficial TUTORIAL for Windows
-
Upload
shaderahmawati -
Category
Documents
-
view
60 -
download
1
description
Transcript of GNU FORTRAN Unofficial TUTORIAL for Windows
-
GNU FORTRAN unofficial TUTORIAL for Windows
By Shade Rahmawati
1. Download the installer here http://users.humboldt.edu/finneyb/gfortran-windows-
20140629.exe
2. Install it. It's very easy to use (basically, just click on the OK buttons).
3. Now, right click My Computer and choose Properties. Click the Advanced system settings.
Then, click Environment Variables.
-
Then, click Edit on entry called PATH.
then add the following at the end of the line (if it is not exis yet).
;c:\gfortran\bin
NOTE: BECAREFUL TO NOT CHANGE ANYTHING ELSE, OR YOU WILL NEED TO RE-INSTALL YOUR
WHOLE SYSTEM!
OK!
4. Next, the big deal is coming. #justkidding
To use gfortran (GNU Fortran Compiler), click Start -> cmd enter
Type (assuming your program is file code.f95 in the current directory): gfortran code.f95 -o code.exe
This creates an executable named code.exe (you can give another name anyway).
-
You can execute the *.exe file by type (name of file).exe in current cmd, or by directly double
click the exe file.
But, its very troublesome to edit the path of working folder each time you want to compile the
code. Therefore, you can make a cmd shortcut that will automatically refers to current path in
which the file placed.
How to make it:
- Right click on desktop (or everywhere), find new->shortcut
- Fill in the Target space: C:\Windows\System32\cmd.exe /E:ON /V:ON /K
- Next, give the name.
- Not done yet. Right click the shortcut file, choose properties. Remove the content in Start in
space, just like this. OK!
- Now you can use it anywhere.
-
5. Example:
I use htcoef.f from here to calculate heat transfer.
Open the CMD shortcut, type the command. No error. Then, I type heat.exe to open the
program. (ignore htcoef.exe, its only my trial)
See? Its not that hard. #making the program is the hardest one.
Thanks for reading. Good luck! #Shade