Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

G++ Compilation Statistics

I was wondering if there is any way to gather statistics from GCC/G++ compilation process. Metrics like the number of lines compiled in the entire process, total time spent compiling, number of errors/warnings, number/size of compiled objects and so on.

I would like to make a script ( maybe in python ) to generate statistical information in a daily, weekly and monthly basis.

Any ideas?

Thanks

like image 530
Filipe Avatar asked Oct 05 '12 17:10

Filipe


People also ask

What does G do in compiling?

The -g option instructs the compiler to generate debugging information during compilation. In C++, the -g option turns on debugging and turns off inlining of functions. The- g0 (zero) option turns on debugging and does not affect inlining of functions.

What is G ++ and GCC?

g++ is used to compile C++ program. gcc is used to compile C program. g++ can compile any . c or . cpp files but they will be treated as C++ files only.

What is G ++ compiler?

g++ command is a GNU c++ compiler invocation command, which is used for preprocessing, compilation, assembly and linking of source code to generate an executable file. The different “options” of g++ command allow us to stop this process at the intermediate stage.

How long does it take to compile C++?

If the compiler is fed a file of 10 lines, it might take 10 ms to compile, but with 5000 lines, it might take 100 ms. One step that happens before a file is compiled is “preprocessing”. A preprocessor takes all #include "file. h" essentially copy-pastes the contents into each source file, and does this recursively.


1 Answers

I know one, it's called Cdash and it's part of a larger and ideal suite that virtually includes Cmake, Ctest and Cpack.

This will probably be an interesting video for you

like image 144
axis Avatar answered Oct 12 '22 20:10

axis