From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by sourceware.org (Postfix) with ESMTPS id 6D1A83858296 for ; Wed, 1 Jun 2022 09:50:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D1A83858296 X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from vepi2 ([79.194.174.96]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mwwdf-1nbuXI1YxH-00yRg7; Wed, 01 Jun 2022 11:50:27 +0200 Date: Wed, 1 Jun 2022 11:50:26 +0200 From: Andre Vehreschild To: Kay Diederichs Cc: Fortran List Subject: Re: is there a way to find out gfortran version and/or options from a given binary? Message-ID: <20220601115026.452a6840@vepi2> In-Reply-To: References: X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:VdAjBk7dks5qVgdIfOJkJ6b8PiPW9dwZDFEcFoEX0KYNUU1zzbd aZIdkqkabQOYqlx+y3v67LlSDik9XujUfUkp7FhARN8AQvl6nvhraWIlIQB3ppAsqlKyE2f G2FAFDDoEVOrihW5x3N0+eNCcBDrciHmThMw+SzDodJQqViQYVepx3XlhgVSCrJHemvYpBF vaNvCLUW0Vde6q8KgTjbQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:e5owT6sjh64=:naMvJfowvNGQHdVdGARJZB OEO/J3D11d6/TfH/WmRR5PPmTXCIOoxSj1sGqY6JPBLn0CSeO+LM1fvnGnEiU1SEeCC3OaGWz JuLzZ4/RRf/MhHgnKYBqUOPc/K+UIiYJCk3JWLWtgghr26zyNg9740VGkXwllmAU4NsTWAlsY Osz3w7ngZsBD1s2bynoPhzTQEhmtu685MwSo12PDczjdWy/J/32HrV049izavSpPC35xzTf4T rlWZbMgl28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autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2022 09:50:33 -0000 Hi Kay, did you try: $ strings coarray_collectives_18 | grep GNU GCC: (GNU) 11.2.1 20211203 (Red Hat 11.2.1-7) GCC: (GNU) 12.0.1 20220214 (experimental) GNU Fortran2008 12.0.1 20220214 (experimental) -mtune=3Dgeneric -march=3Dx8= 6-64 -g -fcoarray=3Dlib -fintrinsic-modules-path /home/vehre/Projekte/gcc/gfortran/lib/gcc/x86_64-pc-linux-gnu/12.0.1/finclu= de -fpre-include=3D/usr/include/finclude/math-vector-fortran.h GNU C11 12.0.1 20220214 (experimental) -mshstk -mtune=3Dgeneric -march=3Dx86-64 -g -O2 -O0 -std=3Dgnu11 -fcf-protection=3Dfull -fcx-fortran-rules -ffunction-sections -fdata-sections __GNU_EH_FRAME_HDR or strings coarray_collectives_18 | grep GCC ... ?=20 Both give me some output (albeit more than I desire) for an executable comp= iled with gfortran. But presumably, I had activated debug. I don't know, if optimized builds will have it, too. Regards, Andre On Wed, 1 Jun 2022 11:41:41 +0200 Kay Diederichs wrote: > Hi Arjen, >=20 > 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=3Dnone). >=20 > So I really am looking for strings or other type of info in the binary. >=20 > Best wishes, > Kay >=20 > 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: > >=20 > >=20 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WRITE( lurep, = '(a)' ) 'Report of simulation' > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WRITE( lurep, = '(a)' ) '--------------------' > > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 WRITE( lurep, = '(a)' ) 'Compiler version: ', > > compiler_version() WRITE( lurep, '(a)' ) 'Compiler options: ', > > compiler_options() > >=20 > > Regards, > >=20 > > Arjen > >=20 > > Op wo 1 jun. 2022 om 10:42 schreef Kay Diederichs > > = >: > >=20 > > Hi, > >=20 > > is there any gfortran option and/or version information available > > from/in a binary? Maybe accessible with objdump or strings? > >=20 > > 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 > >=20 > > Or is there a gfortran option that makes this accessible in a binar= y? > >=20 > > Thanks, > > Kay > >=20 > > =20 >=20 --=20 Andre Vehreschild * Email: vehre ad gmx dot de=20