Closed miroi closed 9 years ago
Yes we want to have something like that but please mind that it is not so simple to do this in a program-agnostic way. Fortran has line length limitations and therefore including config_info.h
will probably fail.
One way out would be to only include this in C code and Fortran would call C which then prints. Also every code prints differently (buffered or unbuffered). I suggest that we first introduce it in the code in question (DIRAC or some other code). Then we abstract and observe and eventually the module can grow into an Autocmake module. Here bottom-up is IMO better than trying to introduce it in Autocmake directly.
What we can do is that we generate build_info.h
and we let the program deal with it.
Closing this discussion. Feel free to create a module for this but my advice is to grow the module first within an actual project.
The idea o generating the build_info.h is smart. Variables inside could be printed out by the program alone (written in Fortran,C or C++).
In DIRAC we generated own Fortran printing commands. The build_info.h file requires dedicated routine(s) to print variables content.
Yes we need to leave this to the program since every program does that differently. Another problem is the line limit of Fortran.
I'll implant the the build_info.h printout into the mathlibs-tester program to have an example of that.
In order to restore CMake configuration printouts and have the possibility to include them into the code I suggest to have a "config_info.h" file generation. This include file, analogous to "git_info.h", would contain important CMake buildup parameters, as compilers & flags, libraries ...