I asked the following question in a forum dedicated to Vtune.
Q:Can you please tell me how to make it so that instead of references like func@0x140051b90
to output function names from source Fortran program?
However, I was redirected to the compiler developers.
Please see the link above.
Odd that they redirected you. Typically, you would need to do a build with debug information generated (requires both compile and link options to include debug info.) You can build with optimization, and clearly for Vtune you would probably want to, but note that inline expansion can muddle routine name information.
I have attached my project to the question (Vtune forum ) .
They looked at it. And they said the following:
Thank you for providing the reproducer. The attached .exe file doesn't have information about its .pdb in the IMAGE_DEBUG_TYPE_CODEVIEW debug directory. As a result, VTune doesn't try to find the .pdb. Help is needed from the Compiler team to understand why there is no reference to .pdb.
My compilation and linking parameters were as follows
/nologo /debug:full /O3 /Qaxcoffeelake /Qxcoffeelake /reentrancy:none /arch:AVX /Qoffload:none /tune:coffeelake /Qopenmp-offload- /Qopenmp-stubs interfaces /Qopt-report:5 /fpe:0 /module: "x64\Release\\" /object: "x64\Release\\" /Fd "x64\Release\vc160. pdb" /traceback /libs:static /threads /Qmkl:sequential /c
/OUT: "x64\Release\neumann_1d_msu.exe" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTFILE: "x64\Release\neumann_1d_msu.exe.intermediate.manifest" /MANIFESTUAC: "level='asInvoker' uiAccess='false'" /DEBUG /PDB: "d:\Disk\Parallel\fortran\2d_Extra_Laguerre_ALL\2d_Extra_Laguerre8\x64\Release\neumann_1d_msu. pdb" /MAP /MAPINFO:EXPORTS /SUBSYSTEM:CONSOLE /STACK:2000000000,2000000000 /IMPLIB: "d:\Disk\Parallel\fortran\2d_Extra_Laguerre_ALL\2d_Extra_Laguerre8\x64\Release\neumann_1d_msu.lib"
Why Vtune doesn't see pdb files?
I don't know what to do. For a Linux system everything works fine.
Can you (attempt to) debug the Release version to see if the VS debugger locates the .pdb?
Also, your compiler options include:
... /object: "x64\Release\\" ...
Note the space following the :. (same with /module:) There should be no space there.
And, the compiler output is to either "." or "/object: "x64\Release\\"
Whereas the linker is specifying:
for output (also with space), and
/PDB: "d:\Disk\Parallel\fortran\2d_Extra_Laguerre_ALL\2d_Extra_Laguerre8\x64\Release\neumann_1d_msu. pdb"
for where the .pdb is to be written
I suggest you try:
/PDB: "x64\Release\neumann_1d_msu. pdb"
There are no spaces there. They appeared for some reason when I copied/pasted the compilation parameters into the intel forum.
I attached a screenshot from my project. I also attached the vs2019 project(+vtune results) to my reply.
Does the MS VS debugger find the .pdb file?
A long time ago I had experienced a situation where VTune would not locate the .pdb file, this was in a multi-language build where the .pdp file(s) were not located in the "expected" folder. VTune does (did) have a procedure to specify additional locations and .pdb files.
I am unable to run VTune at this time (Windows Update broke it), but if you poke around in the tool bar and/or menus you should be able to locate it.
I am investigating the behavior. I have been able to reproduce it internally, and I am attempting to narrow down the exact cause of this issue. I have currently narrowed it to something related to /O2.
I apologize for the delayed update. We are still attempting to identify the exact root cause of the problem. However, the issue appears to be caused in part by the Visual Studio Manifest Tool. If you compile and link via command line and do not use the Manifest Tool, or change your Visual Studio project options to not embed the manifest, you should be able to get correct symbol resolution. To disable in Visual Studio, go to Project->Properties->Manifest Tool->Input and Output->Embed Manifest and set to "No".
Thank you for your reply. The problem has been solved to some extent.
I can now run the Vtune in the Release mode.
I made a new experiment!
1. I created a new empty VS2019 project and added Fortran programs to it. Everything works correctly regardless of "Embed Manifest" = "Yes" or "No"!!! I.e. for both "Yes" and "No", the Vtune displays procedure names correctly.
2. Then I delete the fortan program files and added files from another project. Now Vtune only works when "Embed Manifest " is set to "No".
Conclusion. Depending on which fortran program I compile, Vtune behaves differently. But the Vtune always works with Embed Manifest and set to=No.
I found a source of the error in the program text!!!
How this affects Vtune's behaviour I cannot explain.
I have attached a new project. Try to see the function name in Vtune for Embed Manifest=Yes in two cases.
In the first case comment out the twentieth line in the DFT_demon.f90 file.
!------------------------------------ Source of the errors--------------------
line 20: if (DFT_plan(n,id) .eq. 0) call dfftw_plan_dft_1d(DFT_plan(n,id),n,HH2,An2,FFTW_Backward,FFTW_exhaustive);
If this line (20) is commented out, the function name in Vtune will be displayed correctly and the value of the Embed Manifest parameter has no meaning.
This module is not even called from the main program, but the presence of this line (the second case) requires that Embed Manifest must be = "No". Otherwise the function name will not be shown correctly in Vtune.
The Vtune r000hs test corresponds that line 20 is commented in DFT_demon.f90.
The Vtune r001hs test corresponds to line 20 being uncommented out in DFT_demon.f90.
I have attached the project, the Vtune results are attached.
I would be glad if you could explain what this is all about.
"Is there a ; at the end of line 20 as shown above?" Yes, but it's allowed by the standard.
I think the reason is that the function in line 20, dfftw_plan_dft_1d, is a function from the Intel MKL library.
Apparently adding the MKL calls to a project causes the Vtune to work incorrectly with function name tables.
One additional point related to this. Are you able to use ifx instead of ifort? Using your simpler reproducer, compiling legendre_points.f90 and main.f90 with ifx was sufficient to keep the expected debug symbols.