Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28591 Discussions

Debugging preprocessed source file

Ian_M_
Beginner
703 Views
Hi,
I'm currently using Intel Fortran Compiler for Windows version 8.1 (Build 20040802Z Package ID: w_fc_p_8.1.019)
My source files have prepressor directive (#include, #ifdef, etc.) and .for extension. So, I'm using the /fpp option to "preprocess prior to compilation"
There are two problems :
1- I can't debug my application because MS Visual Studio 7.1 debugger ask me for a deleted preprocessed file (ex : c: mp213222.f)
I tried the /keep option with no result : the preprocessed file is always deleted.
Is this normal ? How can I fix this behavior ?
2- To fix the previous problem, I triedthe /P option to "preprocess to file". It seems that I can't do that, the compiler complains :
"IFort: Command line warning: no action; 'somefile.for' lacks preprocessor input suffix '.fpp'.
I tried the /extfpp:for option with no result.
Thanks for your help,
Ian Maurin-Soucy
0 Kudos
8 Replies
Steven_L_Intel1
Employee
703 Views
I don't see this behavior with a more recent compiler. The one you're using is very old at this point. If you can, please upgrade to 9.0.024, or at least the latest 8.1, and see if the behavior exists.

You will need to use the /extfor:.fpp option to have the compiler driver recognize a .fpp file as Fortran source. You may also need /free if it is supposed to be free-form.
0 Kudos
Ian_M_
Beginner
703 Views
First, thank you for your support.
I noticed that the build number given by the ifort.exe is not the same as the file w_fc_pc_8[1].1.034.exe seems to pretend. This is, I think, the last update for this version. So, I don't think this is "very old at this point" : the file is dated of 9/7/2005. I installed this "update" recently because of the problem described before. That does'tfix the problem.
For the /extfor option that you mention, I don't need it. My source files have .for extension, not .fpp.
Could you explain me why I can't preprocess to file ( /P option) a .for file ?
And could you, also, explain me why, when I preprocess prior to compilation (/fpp) a .for source file, the line numbers in the obj file refer to an intermediate .f file (generated during the whole compilation process) ?
And finally, why the /keep option doesn't "keep" the generated .f file ?
Are these, officialy,bugs of the Intel Fortran compiler ?
I need official information, not a upgrade offer...
Ian Maurin-Soucy
0 Kudos
jim_dempsey
Beginner
703 Views

I use fpp extensively with V9. On the later versions of V8 it worked the debugger too. But on earlier versions it had a serious problem.

The current version works for the most part. Occasionaly the line numbers get out of sync. When that happens it is usualy on a very large source file. If it is a problem for me then I breakup the large source file into smaller pieces.

The fpp is indispensible for what I do. I have a legacy program with 100's of modules. It was originaly written with fixed size arrays in COMMON. The current code uses modules and derived types allocated from dynamic memory. I did not want to make changes to all the source modules so I used #define instead
#define FOOBAR aModule.Context.pFOOBAR
Then all my FOOBAR(I,J) work fine with no edits
Jim Dempsey
0 Kudos
Steven_L_Intel1
Employee
703 Views
The way it is supposed to work is that fpp generates source directives that are read by the compiler and used to tell the debugger which compiled source lines correspond to which original source lines. I know that in some older versions this was not reliable. The only issue I am aware of in current compilers is that sometimes, with continued lines, the source correlation line numbers are off by one or more lines.

If you actually installed w_fc_pc_8.1.034. then that's what the "banner" would say when you compiled code. Since you're seeing w_fc_p_8.1.019, then that means you have not installed 8.1.034. I suggest you do so and verify that's what you see when you compile.

/keep is not documented as a supported option. I note that the compiler driver accepts it but it ignores it. I'll have to ask what the right switch is to not delete the fpp-processed source, but you should not need it.
0 Kudos
Steven_L_Intel1
Employee
703 Views
Ah - /Q_save_temps works, but in 9.0 only, not 8.1. The temporary file is put in your TEMP folder - you can also add /#x to the command line to see where it put it.
0 Kudos
jim_dempsey
Beginner
703 Views

If you are having problems getting ifort to keep the preprocessed line then why not use fpp directly?

fpp foo.f90 foofpp.f90

Jim Dempsey

0 Kudos
Ian_M_
Beginner
703 Views
Hi Steve,
Thanks a lot for your help. Your comment about de banner help me to solve this problem of line numbers.
When I launched theupdate w_fc_pc_8[1].1.034.exe,I assumed that it was a setup program.Thefact is : the w_fc_pc_8[1].1.034.exe unpacked the setup and I never ran it... When I installed it, this update fix the line number problem.
Thanks to all of you for your precious comments.
Ian Maurin-Soucy
0 Kudos
Steven_L_Intel1
Employee
703 Views
Yes - the way we did installs in 8.1 was confusing. It unpacked the files and then opened a web page. If you didn't see the web page, you didn't know what to do next. 9.0 works differently.

By the way, I was not trying to sell you an upgrade. If your license lets you use 8.1.034, you can use 9.0.024. Our licenses are by release date, not version number.
0 Kudos
Reply