From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 4CF8838303DA for ; Wed, 1 Jun 2022 09:54:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4CF8838303DA Received: by mail-pf1-x430.google.com with SMTP id bo5so1505976pfb.4 for ; Wed, 01 Jun 2022 02:54:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=01ZBPJq4CgPFVUFPIj42/9G2d/p8krOQysuvn4LWMgc=; b=N/2moUqYUZnqBA35+J+BcE/KOKtFP1vTnIY6vBXnYioWj7cdylwqrLuwV6sBFQyWNP rdULxA/ezMh5PGXpa+KemxfZBXaNzwKn/RcTCX+1KVcLvNzNtOhPQ2JvSomEmaIaYNT/ meSLuYuhKdU9BgkXdCNVHKzyKKqNmjhxopnE0N5bMmLyDMWyjMf5GWrI+fyodXCkqfrY boBq4OH4MqscC1mWv0pmTAU1GsW6B4VnVecvWSa9j5Iyl5l3wRFdtWsb6SdeBjpRB1xP +SBLMH61gAA3YfpQ0rEbMQolwjvY9XD1wELxjfJPwyxAXGzCcIel5ktSnIOgwLH63IQc XHQQ== X-Gm-Message-State: AOAM530xA/3BDhTd+E3rRkCDEzcZqW+4uKaR4QTIYQ+GK8A/yoOZEz1/ MlYy7g2sf4WNfVdfynopMOvHno+kCrNAuign7xQ= X-Google-Smtp-Source: ABdhPJzEnmUg+A6hEL16bELl4HYpP8oceeG4dMJSN0oNP15rFZY1iMvyDNpMJ9wqwuC5bExEVB7xH+2G2ECJd8d4QeU= X-Received: by 2002:a63:5b18:0:b0:3fc:9921:f8b3 with SMTP id p24-20020a635b18000000b003fc9921f8b3mr2734931pgb.52.1654077243301; Wed, 01 Jun 2022 02:54:03 -0700 (PDT) MIME-Version: 1.0 References: <20220601115026.452a6840@vepi2> In-Reply-To: <20220601115026.452a6840@vepi2> From: Arjen Markus Date: Wed, 1 Jun 2022 11:53:52 +0200 Message-ID: Subject: Re: is there a way to find out gfortran version and/or options from a given binary? To: Andre Vehreschild Cc: Kay Diederichs , Fortran List X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:54:06 -0000 I thought you might get this information by using these two functions in a parameter definition, but that is not allowed, alas. Regards, Arjen Op wo 1 jun. 2022 om 11:50 schreef Andre Vehreschild via Fortran < fortran@gcc.gnu.org>: > 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=generic > -march=x86-64 -g > -fcoarray=lib -fintrinsic-modules-path > > /home/vehre/Projekte/gcc/gfortran/lib/gcc/x86_64-pc-linux-gnu/12.0.1/finclude > -fpre-include=/usr/include/finclude/math-vector-fortran.h GNU C11 12.0.1 > 20220214 (experimental) -mshstk -mtune=generic -march=x86-64 -g -O2 -O0 > -std=gnu11 -fcf-protection=full -fcx-fortran-rules -ffunction-sections > -fdata-sections __GNU_EH_FRAME_HDR > > or > > strings coarray_collectives_18 | grep GCC > > ... > ? > > Both give me some output (albeit more than I desire) for an executable > compiled > 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, > > > > 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 > > > >>: > > > > > > 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 > > > > > > > > > > > -- > Andre Vehreschild * Email: vehre ad gmx dot de >