pgfotran : how to traceback

I want to know the location of a floating point operation error in pgfortran.
I would like to display the line number with traceback, if possible, without using the debugger.

In the next command option, the line number that stopped is not displayed.
pgfortran -Ktrap = fp test.f 90


I tried PGI_TERM environment variable, but this environment variable is not set properly.


set PGI_TERM = ‘1’
or
set PGI_TERM = ‘y’

Pgfortran say that PGI_TERM will be ineffective. I do not know the meaning and usage of PGI_TERM.

What should I do?

Hi sigebo,

Try setting PGI_TERM to “trace” to get a traceback.

Full details can be found here: https://www.pgroup.com/resources/docs/18.5/x86/pgi-user-guide/index.htm#env-vars-pgi-term

Hope this helps,
Mat

Thanks teach me the information of enviloment variables.

After setting PGI_TERM=trace , how to know the line number at the error.
I tried following.

set PGI_TERM=trace
pgfortran test.f90
warnig ieee-flotingpoint divide by zero is signaling


This result do not include any information of the error line no.

You may need to compile with “-g” to get the symbols.

Though since this is a floating point exception, compile with “-Ktrap=fp” and the compiler will halt and hopefully give you the line number.

-Mat

I used the -g -Ktrap options I taught, but I did not get an error line number.

I tried following

SET PGI_TERM=trap
PGFORTRAN -g -Ktrap=fp T.f90

result
Error: floating point exception
Warning: trace back not available, cannot read header

I cann’t any line number at error.
I think that something is missing.

Can you run the program in a debugger?

I misstaked typing.
Following is correct.

SET PGI_TERM=trace
PGFORTRAN -g -Ktrap=fp T.f90
T

result
Error: floating point exception
Warning: trace back not available, cannot read header

I misstaked typing.
Following is correct.

SET PGI_TERM=trace
PGFORTRAN -g -Ktrap=fp T.f90
T

result
Error: floating point exception
Warning: trace back not available, cannot read header

I don’t want to use pgdbg such as GUI.
I want to debug on commandline and to know source line number at error.
Can I get this feacher on pgfortran ?

I don’t want to use pgdbg such as GUI.

You can you pgdbg from the command line by adding the “-text” option. i.e. "pgdbg -text "

-Mat