I wrote a small test program in fortran, using notepad as text editor,I need help as where to go from here to execute my progr

Status
Not open for further replies.
Solution
Go here and click the link at the bottom of the page (g95-Mingw_201210). Run the downloaded file and install the g95 compiler.

I'm going to assume that you are on windows, but for linux is exactly the same steps:
1) Open command prompt (win7: start->search for cmd)
2) In the command prompt type: cd address_of_your_fortran_file and press enter.
E.g. if your file is on your desktop, in a folder named "program", then the command should be: cd "c:\Users\[YourUserName]\Desktop\program"
3) Now just type the command g95 name_of_your_file and press enter.
E.g. if your file is named hello.f90 then you type: g95 hello.f90
4) Now you should have in your folder another file named a.exe (a.out for linux), double click this and it should...

InsanityCrescendo

Estimable
Feb 3, 2015
1
0
4,520
Go here and click the link at the bottom of the page (g95-Mingw_201210). Run the downloaded file and install the g95 compiler.

I'm going to assume that you are on windows, but for linux is exactly the same steps:
1) Open command prompt (win7: start->search for cmd)
2) In the command prompt type: cd address_of_your_fortran_file and press enter.
E.g. if your file is on your desktop, in a folder named "program", then the command should be: cd "c:\Users\[YourUserName]\Desktop\program"
3) Now just type the command g95 name_of_your_file and press enter.
E.g. if your file is named hello.f90 then you type: g95 hello.f90
4) Now you should have in your folder another file named a.exe (a.out for linux), double click this and it should run your program.

Notice how in my example I used .f90 extension. I think g95 supports fortran77 but I'm not sure, so if you have any trouble, just rename your file to have the extension .f90. Since it's a small program and since FORTRAN has a good compatibility with its previous versions it shouldn't give you any trouble (just change the comments indicator from "c" to "!" and you should be fine)
 
Solution
Status
Not open for further replies.

TRENDING THREADS