My code base is very large and uses many different module files. I am trying to use the code coverage tool with intel 18.104.22.168 on linux to see how much of the code actually gets used. My compile creates 6 different libraries (.a files) in 6 different folders, and then they are linked at the end. When I compile using the option "-prof-gen=srcpos", each folder has a single pgopti.spi and pgopti.spl file with all of the .o and .mod files. When everything is linked together, the executable is created but there is no pgopti.spi file in the executable directory. I tried to run the program, and there was no .dyn file generated, so I can't use the code coverage tool.
1. Should I only get the single pgopti file in each folder, or am I just overwriting it with each new object file I compile?
2. Does the code coverage tool only work on a single file, or should I be able to use it with multiple module files? If so, what step am I missing to get it to work?
3. Does it work for static and/or dynamically linked executables?
Thanks for the help
This should work for your app and static libs. When you build the static libs, I expect you already are, but make certain to use xiar and not the gnu ‘ar’.
The easiest method to make this work is to compile all your source files with at least these two options:
Where “<a-common-directory>” is a directory where the compiler can auto-concatenate the profile info into single .spi/.spl files for the complete application (including all the static libs).
Once the compilation is complete, run the executable the desired number of times to generate the .dyn files. These too will automatically collect in the directory specified by -prof-dir= option.
Next, “cd” (change directory) into the -prof-dir= directory, run profmerge followed by codecov. Now open the CODE_COVERAGE.HTML in the browser.