LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Running a gFortran job and debugging options (https://www.linuxquestions.org/questions/linux-newbie-8/running-a-gfortran-job-and-debugging-options-708921/)

Albert P. Linnell 03-03-2009 04:39 PM

Running a gFortran job and debugging options
 
I am migrating from Windows Microsoft Powerstation Fortran to gFortran on Ubuntu8.10, and am new to both Linux and gFortran. As a test I used vi to write a simple program to read a line of text from one file and write it to an output file. Compilation via gFortran went OK, with no logged errors and an executable file showing from the ls command. The seemingly trivial question is: how do I run the program? I tried typing the name of the executable and giving a carriage return: got the response command not found.

My second question: do the debug options under gcc also apply to gFortran?

rnturn 03-03-2009 10:46 PM

Quote:

I am ... new to both Linux and gFortran.
Welcome Aboard!

Quote:

I tried typing the name of the executable and giving a carriage return: got the response command not found.
The most probable cause of this is that the subdirectory where you created the executable is not in your PATH.

You should use the command:
Code:

./my-new-g77-program<CR>
(where <CR> is your carriage-return, Enter key, whatever.) The "." represents the current directory. Without the "./" prefix to tell the shell that the command that follows may be found in the current directory, the shell will look at the (colon-delimited) list of directories contained in the shell variable "PATH". Issue the command "echo $PATH" to see that list.

As for the compiler's debugging options, I can't help you there; I haven't written any new FORTRAN code in over a decade and none under Linux. I would hope that the debugging code would be nice enough to point back to a line of the FORTRAN source code when things go south at runtime. Otherwise, it'd seem pretty useless. But that's just a guess. Have you read the manpage for the compiler?

Good luck...

--
RT


All times are GMT -5. The time now is 01:37 AM.