is there a way to find out gfortran version and/or options from a given binary?

Kay Diederichs Kay.Diederichs@uni-konstanz.de
Wed Jun 1 09:41:41 GMT 2022


Hi Arjen,

thanks for your answer. I do know about these functions, and use them in my own programs if appropriate. However, programs
distributed to others for production use should not output this because it confuses users (as does "Note: The following floating-point exceptions are signalling: IEEE_INVALID_FLAG" which I need to switch off with -ffpe-summary=none).

So I really am looking for strings or other type of info in the binary.

Best wishes,
Kay

On 6/1/22 11:30, Arjen Markus wrote:
> Are you perhaps looking for the compiler_version() and compiler_options() functions? I use them like this, they were defined in Fortran 2008 if I am not mistaken:
> 
> 
>                  WRITE( lurep, '(a)' ) 'Report of simulation'
>                  WRITE( lurep, '(a)' ) '--------------------'
>                  WRITE( lurep, '(a)' ) 'Compiler version: ', compiler_version()
>                  WRITE( lurep, '(a)' ) 'Compiler options: ', compiler_options()
> 
> Regards,
> 
> Arjen
> 
> Op wo 1 jun. 2022 om 10:42 schreef Kay Diederichs <kay.diederichs@uni-konstanz.de <mailto:kay.diederichs@uni-konstanz.de>>:
> 
>     Hi,
> 
>     is there any gfortran option and/or version information available from/in a binary? Maybe accessible with objdump or strings?
> 
>     For ifort, we use the -sox option ("This option tells the compiler to save the compilation options and version number in the executable file. ..."). This enables e.g.
>     strings /path/to/binary | grep Intel
> 
>     Or is there a gfortran option that makes this accessible in a binary?
> 
>     Thanks,
>     Kay
> 
> 

-- 
Kay Diederichs                http://strucbio.biologie.uni-konstanz.de
email: Kay.Diederichs@uni-konstanz.de             Tel +49 7531 88 4049
Fachbereich Biologie, Universität Konstanz, Box M647, D-78457 Konstanz

This e-mail is digitally signed. If your e-mail client does not have the
necessary capabilities, just ignore the attached signature "smime.p7s".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5905 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20220601/c623f924/attachment.p7s>


More information about the Fortran mailing list