Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi there. My environment is Win7==>Oracle VB=>>Ubuntu==>GFortran.
I just converted apparently a FORTRAN77 program to GFortran and it finally compiled. The program is huge: over 6,000 lines. After the compilation I ran the exec file (./a.out) and nothing happened. I mean there is no output. So, I would like to have an option to do step by step debugging, like in Microsoft Visual Studio for instance.
I found gdb package but it required debugging symbols. I ran it with the -g option that generates them but again nothing really happens.
I am wondering what options do exist out there for debugging?
Anything written in Fortran 77 will compile without issue in gfortran. Fortran 77 is Fortran 77, the language is operating system and compiler-independent. What, exactly, did you do to "convert" it? And what did you convert it TO?
When you run it, does it return, or does it get stuck running? If it returns, what's the exit status (echo $?)?
Last edited by suicidaleggroll; 11-08-2014 at 09:28 PM.
In my OP I made it clear that I was not sure it was FORTRAN77. I am not that knowledgeable. I now know for a fact that there are quite a few FORTRAN dialects, some of them proprietary it seems. This is exactly what I did. From that first attempt to compile it, when the compiler gave me allotted 25 errors, it became clear that the compiler did not like the letter C in the first column for continuation. It takes "!" instead and, of course, as we know, not necessarily in the first column position because I stored the source code in a file with .f08 extension. Then there were many problems with FORMAT statements. I had to replace single quote with double quote mark and especially duals like /'...'/ had to be replaces with this: "...". All statements of continuation which were digits or asterisks in the 6th column had to be removed and instead an ampersand & had to be placed at the end of the previous line. This is pretty much the extend of it. It could have been even an earlier version of FORTRAN, like FORTRAN 66?
You can write a small test program to check how debugging works. (You need to compile your code with -g and run/execute with gdb). You can also try to set breakpoints.
But again: What do you mean by nothing happened?
When you run it, does it return, or does it get stuck running? If it returns, what's the exit status (echo $?)?
You can also try strace to check if the program is running (for example in an endless loop).
Thanks, I am working on it actually. What I meant by "nothing happened" was that I had practically no feedback. First time (yesterday) it stuck on a READ statement from stdin. It was also unexpected that the stdin is called LIN in this program. OK, I actually compiled it with -g option yesterday and now ran it with gdb run <filename> so it gave me a symbol table. I don't know if you have any experience with Visual Studio and the debugging over there. I expect something like this: to be able to trace execution step by step. This huge program is actually working now but it leaves me no option to understand what is going on inside.
Now it does return with a statement:
Code:
Reading symbols from /home/alex/LEGENDRE/a.out...done.
(gdb) run
Starting program: /home/alex/LEGENDRE/a.out
** TEST SINGLE PRECISION LEGENDRE FUNCTION ROUTINES IN FCNPAK **
***** TEST 1 (SINGLE PRECISION) PASSED *****
***** TEST 2 (SINGLE PRECISION) PASSED *****
***** TEST 3 (SINGLE PRECISION) PASSED *****
***** TEST 4 (SINGLE PRECISION) PASSED *****
***** TEST 5 (SINGLE PRECISION) FAILED *****
0 TESTS COMPLETED, NUMBER OF TESTS FAILED = 1
** TEST DOUBLE PRECISION LEGENDRE FUNCTION ROUTINES IN FCNPAK **
***** TEST 1 (DOUBLE PRECISION) PASSED *****
***** TEST 2 (DOUBLE PRECISION) PASSED *****
***** TEST 3 (DOUBLE PRECISION) PASSED *****
***** TEST 4 (DOUBLE PRECISION) PASSED *****
***** TEST 5 (DOUBLE PRECISION) FAILED *****
0 TESTS COMPLETED, NUMBER OF TESTS FAILED = 1
***** WARNING -- AT LEAST ONE TEST FOR SUBLIBRARY FCNPAKHAS FAILED *****
[Inferior 1 (process 18136) exited normally]
(gdb)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.