|
[Sponsors] |
May 3, 2011, 18:06 |
gfortran compilation
|
#1 |
Senior Member
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17 |
i have a code in gfortran...
i need to change the code so obviously i need to see that whether changes r fine or r there any errors.. so how can i compile the code for errors?? and then how to Run it... regards |
|
May 3, 2011, 23:41 |
|
#2 |
Senior Member
Join Date: Nov 2009
Posts: 411
Rep Power: 19 |
Suppose your program is named test.f90, open a Command Prompt in the folder where your Fortran code is placed and write:
gfortran test.f90 -o test.exe If you will see no error messages and you will obtain a new file test.exe then your original program was free of syntax errors. If you want to run the new program just write in the same Command Prompt window: test.exe Do |
|
May 4, 2011, 18:16 |
|
#3 |
New Member
|
Try this:
gfortran -g -o Output Program.f90 Output being the executable. The option -g allows the compiler to generate debug symbols for debugging. The compiler should catch syntax errors automatically. if you are on linux you can use the gnu debugger to debug the code. I don't know what to use on windows. |
|
May 4, 2011, 20:08 |
|
#4 |
Member
Join Date: Mar 2009
Posts: 62
Rep Power: 17 |
@Eezyville
"I don't know what to use on windows." On Windows you will use the same gdb debugger ... |
|
May 4, 2011, 22:58 |
|
#5 |
Senior Member
Hassan
Join Date: Apr 2009
Posts: 106
Rep Power: 17 |
thanks to all. ill check this gnu debugger....
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
errors during compilation and installation of OpenFOAM-1.7.x on Ubuntu 10.04 | ftec | OpenFOAM Installation | 7 | February 23, 2011 06:07 |
Compilation Order and Single Precision Issues | gocarts | OpenFOAM Bugs | 1 | October 14, 2009 17:19 |
Compilation Error when running Tutorial 2.4 | zhihuali | Siemens | 7 | April 1, 2008 07:34 |
Compilation error with uparm.f | Raghu | Siemens | 2 | May 30, 2007 02:09 |
Compilation Error.... | Arnab | Siemens | 4 | September 12, 2004 15:54 |