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

option -srcroot for code coverage analysis in IVF

slialgor
Beginner
1,178 Views
Hi,
Does anyone know how this option works?
Could you please explain it with a simple example?
Or any suggestion where I can get the help?

Thanks a lot.
0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,178 Views
It is described in the documentation for the Code Coverage tool. (Search the index for "Code Coverage".) The description says:

Specifies a different top level project directory than was used during compiler instrumentation run to use for relative paths to source files in place of absolute paths.

You would use this if the source files were in a different location when you run codecov than when you collected the data. codecov would then use this as the base for relative path references.
0 Kudos
slialgor
Beginner
1,178 Views
Thanks, Steve.
That's the exact what I tried. But it seems not working.
(Errors show that source code file could not be found.)

This is why I came here for more suggestion or examples.

0 Kudos
Steven_L_Intel1
Employee
1,178 Views
I admit I have never tried the code coverage tool, but I'll try it now to see if I can reproduce the problem.
0 Kudos
Steven_L_Intel1
Employee
1,178 Views
I see similar results as you do. I submitted an issue DPD200168895 asking the developers to explain how this is to be used, or perhaps to fix a bug if -srcroot is in fact being ignored.
0 Kudos
Steven_L_Intel1
Employee
1,178 Views
Here's what I was told:

In order for the -srcroot substitution to take place, the sources need to be compiled with one of the following options::

-prof-src-root (Linux), /Qprof-src-root (Windows)

-prof-src-root-cwd (Linux), /Qprof-src-root-cwd (Windows)

This compiler option specifies the base directory that is to be treated as the project root directory that can be substituted later.

An example of use is:

C:> ifort -Qprof-gen:srcpos -Qprof-src-root c:\workspaces\orig_project_dir test1.f90 test2.f90

C:> test1.exe

C:> profmerge

C:> cd \workspaces\

C:> mv orig_project_dir new_project_dir

C:> cd new_project_dir\src

C:> codecov -srcroot C:\workspaces\new_project_dir

Now, "C:\workspaces\new_project_dir" will be substituted for "c:\workspaces\orig_project_dir" when looking for the source files.

It looks like the code coverage documentation, needs to cross-reference the compiler -prof-src-root* options for clarifying this.

0 Kudos
Reply