octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fortran optimization flags


From: John W. Eaton
Subject: Re: Fortran optimization flags
Date: Wed, 03 Jun 2015 15:19:42 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0

On 06/03/2015 01:44 PM, Rik wrote:
On 05/08/2015 09:00 AM, address@hidden wrote:
Subject:
Minor question about optimization flags in ./configure
From:
José Luis García Pallero <address@hidden>
Date:
05/08/2015 07:45 AM

To:
Octave Maintainers <address@hidden>

List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
quoted-printable
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=ISO-8859-1
Message:
1


Hello:

I've seen (octave 4.0.0 rc4) that after the ./configure step, the
C/C++ compiling order contains the -O2 optimization flags but the
Fortran one contains only the -O. Is there any reason in order to not
use the -O2 flag in Fortran by default?

I think originally there may have been.  For some platforms there wasn't
actually a Fortran compiler, rather there was only a Fortran-to-C
translator and then the C code was compiled.  In that case it was easier
for the C compiler to perform optimization if the input code was
relatively straightforward and had not already been optimized.

But, I would say that this situation has now passed.  Most
distributions, including our MXE distribution for Windows, use gfortran
and it accepts -O2.  I know that I, personally, have been using -O2 in
FFLAGS for several years and never had a problem.

I think if jwe is okay with it then we should change the default
optimization flags on the development branch.

The autoconf macros for Fortran compilers should be doing this for us, but I see we set FFLAGS to -O if it is not already set in the environment when configure runs. That's probably the wrong thing to do. Maybe we should just leave this choice up to the autoconf macro?

Also the gcc and g++ calls contain the -g flag in order to generate
debug symbols, but it is not used in the Fortran call. About the
performance for a normal user (not a developer), has -g any impact?

Someone else will need to speak to this.

I think the only cost is extra disk space. Using -g should not affect code generation.

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]