J3/06-136R1 Date: February 14, 2006 To: J3 From: Dick Hendrickson Subject: Documenting Compiler Versions Reference: Repository J3-033, 05-123R2 This is a revised version of item J3-033. It documents both the compiler version and the command line that invoked the compiler. A function notation is used to allow different results for different routines which were separately compiled. Specification and implied syntax: Add two new intrinsic character functions to the ISO_FORTRAN_ENV module. COMPILER_VERSION() Returns a processor dependent result that describes the compiler name, version, or related information. COMPILER_COMMAND_LINE() Returns a processor dependent representation of the command line that invoked this compilation. The result may include additional information, such as default options or options specified by environment variables. Both are scalar default character functions. The length and result values are processor dependent. They have no arguments. Both may be used in initialization expressions. Add a note urging compiler vendors to embed the strings in the .o file so they can be found later on with other tools. The functions would normally return different results for separately compiled routines. Examples: Character(len=72) :: CCL = COMPILER_COMMAND_LINE() Character(len=*), parameter :: CCV = COMPILER_VERSION() Print *, COMPILER_VERSION() Print *, COMPILER_COMMAND_LINE()