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

Debugging Mixed Language: CVF 6.6 an VS.NET

ron_g
Beginner
1,265 Views
Hi,

I recently 'upgraded' my C++ compiler from a ~1997 version of MS Dev Studio to the latest Visual Studio C++ .NET. In the past, I have been able to seamlessly compile and debug my mixed FORTRAN/C code. I simply brought the code into Compaq Visual Fortran 6.6 (CVF) and pointed to the Dev Studio C++ libraries and happily debugged (i.e. both the Fortran and C++ codes would compile and link within CVF and I could view Fortran arrays in the debugger). The code is a simple, number-crunching, console application with no graphics, etc.

With the advent of Visual Studio.NET, it seems that life has become a lot more difficult. Hence, my questions...

1) For debugging mode, is it true that one cannot compile and link mixed Fortran/C++ code within CVF anymore if the C++ compiler is .NET? I seem to able to get a Release mode version to work this way, but not the Debug Version. Has anyone actually been able to pull in the .NET libraries in CVF 6.6 to compile and link a working Debug executable?

2) Per Steve L's earlier note (I really appreciate his comments/insights), I have been able to create a Static Fortran library and add this to my C++ .NET solution. And, indeed, I can step through the code in the .NET debugger. This approach is a bit cumbersome, relative to the ease of the old Dev Studio method, but it is workable. I find, however, that there is no way to view array values of the Fortran variables in the Fortran code. In the Locals window, the array names show-up without a '+' to expand. In addition, only a hex number is shown for its value. Is there some trick that I am missing? When I used to compile with CVF and old Dev Studio, the Fortran arrays would show-up with a '+' that could be expanded to show all values, but alas not so in .NET (?).

3) Steve L. made mention a while back that CVF libraries could not be distributed (from a licensing perspective). Does that mean an executable created from my Fortran Static library cannot be distributed to the general public? I'm confused about this.

4) I am used to moving my cursor over a variable name, and having its value appear. This functionality does not seem to exist in .NET for the Fortran portions of the code (it works only in the C++ portion) Is there a way to turn on this option or is this a feature of .NET.

4) I am under the impression that Visual Studio C++ 6 can work seamlessly with CVF 6.6. So I wonder if folks interested in mixed language debugging should be upgrading their old C++ compilers to C++ 6 rather than .NET?

Thanks,
Ron G.
0 Kudos
6 Replies
Steven_L_Intel1
Employee
1,265 Views
1. That is true. You can come close by adjusting the paths shown in Tools..Options..Directories to replace the VC98 paths with the appropriate VC7 paths, but.. When the DF driver is called to link the program, it will add some link switches that the VC7 linker complains about. This will be "fixed" (I hesitate to use that term, because it's not a bug) with 6.6C. If you want to do it now, download this and unpack it into your DF98BIN folder.

2. I'm afraid you're out of luck here. The Fortran language support for VC6 isn't recognized by the VC7 debugger, and the VC6 debugger will choke on the executables created by the VC7 linker.

3. You cannot directly redistribute the .LIB files that come on the CVF CD. Your own linked EXEs and DLLs are fine. (You can distribute your own .LIBs too, but the end user has to have CVF to use them.)

4. See #2

4(5). If you want the seamless support, stay with VC6.

Steve
0 Kudos
ron_g
Beginner
1,265 Views
Steve,
Thanks for your reply and info, however I still cannot debug with CVF6.6B+udpated 6.6C drivers. Although I can compile and link without error messages, I find that..

1) When I use the Debugger to step into the program, I get the message 'C:MyDocs esprj-cDebugmysim.exe' does not contain debugging information. From that point onward, the debugger can only step through the code in Disassembly Window.

2) In addition, I get the following messages:
Loaded 'C:MyDocs estprj-cDebugmysim.exe', no matching symbolic information found.
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:WINDOWSSYSTEM32kernel32.dll', no matching symbolic information found.
Loaded 'C:WINDOWSSYSTEM32advapi32.dll', no matching symbolic information found.
Loaded 'C:WINDOWSSYSTEM32 pcrt4.dll', no matching symbolic information found.


This is what I have done..
1) Unzipped the 6.6C drivers in DF98/bin folder.
2) Replaced the VC98 directories with the VC7 ones. Specifically, my Tools->Options->Directories are now:
EXECUTABLES:
C:Program FilesMicrosoft Visual StudioDF98BIN
C:Program FilesMicrosoft Visual Studio .NETVc7in
C:Program FilesMicrosoft Visual Studio .NETCommon7Toolsin
C:Program FilesMicrosoft Visual Studio .NETCommon7Tools
C:Program FilesMicrosoft Visual Studio .NETCommon7IDE
C:Program FilesMicrosoft Visual StudioCommonTools
C:Program FilesMicrosoft Visual StudioCommonMsdev98BIN
C:Program FilesMicrosoft Visual Studio .NETFrameworkSDKin


INCLUDE:
C:Program FilesArrayVisualizerInclude
C:Program FilesMicrosoft Visual StudioDF98Include
C:Program FilesMicrosoft Visual StudioDF98IMSLInclude
C:Program FilesMicrosoft Visual Studio .NETVc7atlmfcinclude
C:Program FilesMicrosoft Visual Studio .NETVc7PlatformSDKInclude
C:Program FilesMicrosoft Visual Studio .NETVc7Include
C:Program FilesMicrosoft Visual Studio .NETFrameworkSDKinclude

LIBRARY:
C:Program FilesArrayVisualizerLib
C:Program FilesMicrosoft Visual StudioDF98IMSLLib
C:Program FilesMicrosoft Visual StudioDF98Lib
C:Program FilesMicrosoft Visual Studio .NETVc7Lib
C:Program FilesMicrosoft Visual Studio .NETVc7PlatformSDKlib
C:Program FilesMicrosoft Visual Studio .NETVc7atlmfcLib
C:Program FilesMicrosoft Visual Studio .NETFrameworkSDKLib

SOURCE FILES:
C:Program FilesMicrosoft Visual Studio .NETVc7atlmfcsrcmfc
C:Program FilesMicrosoft Visual Studio .NETVc7atlmfcsrcatl
C:Program FilesMicrosoft Visual Studio .NETVc7crtsrc

3) My Compile and Link settings are:
FORTAN TAB:
/assume:underscore /browser:"Debug/" /check:bounds
/compile_only /dbglibs /debug:full
/iface:nomixed_str_len_arg /iface:cref /names:lowercase
/nologo /traceback /warn:argument_checking
/warn:declarations /warn:nofileopt /warn:unused
/module:"Debug/" /object:"Debug/"
/pdbfile:"Debug/DF60.PDB"

C/C++ TAB:
/nologo /MLd /W3 /GX /Zi /D "WIN32" /D "_DEBUG"
/D "_CONSOLE" /D "_MBCS" /FR"Debug/"
/Fp"Debug/prj.pch" /YX /Fo"Debug/"
/Fd"Debug/" /FD /GZ /c

LINK TAB:
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console
/incremental:no /pdb:"Debug/mysim.pdb"
/debug /machine:I386 /o ut:"Debug/mysim.exe"


Any help would be appreciated,
Thanks again,
Ron G.
0 Kudos
Steven_L_Intel1
Employee
1,265 Views
Sorry, didn't mean to imply that the updated drivers helped with debugging. They don't. What they do is allow you to use the VC7 linker without it complaining about /ignore:505.

Steve
0 Kudos
durisinm
Novice
1,265 Views
Is the inability to expand Fortran arrays and to see the value of a Fortran variable by placing your cursor over it in the code going to persist with the new IVF coming out later this year?

Mike
0 Kudos
durisinm
Novice
1,265 Views
Any takers on my question?

Mike
0 Kudos
Steven_L_Intel1
Employee
1,265 Views
CVF does not support VS.NET. It does support VS98 and you can view arrays with the cursor-hover in that version.

Intel Visual Fortran will support VS.NET and will support arrays in the debugger.

Steve
0 Kudos
Reply