From avraham.adler at gmail.com  Mon Aug  8 17:24:55 2016
From: avraham.adler at gmail.com (Avraham Adler)
Date: Mon, 8 Aug 2016 11:24:55 -0400
Subject: [Rd] Is it intentional that the Fortran optimization flags
 changefrom O3 to O2 on Windows?
Message-ID: <CAL6gwnKDFH_HV9aHAJPWOJ7=VAGJz6KyxKdM0Ba1LOiViRqDYw@mail.gmail.com>

When compiling R-devel (2016-08-07) on Windows (64bit) using Rtools
(3.4.0), the C++ optimization flags are manually changed to -O2 from
-O3. This has been the situation for years, and I believe this is to
prevent certain optimizations which may cause downstream problems. In
R_HOME/src/gnuwin32/fixed/etc/Makeconf, this is seen by the -O2
entries in the CXXFLAGS and CXX1XFLAGS variables. The FFLAGS and
FCFLAGS entries in Makeconf still show -O3.

When looking at R_HOME/etc/x64/Makeconf, however, the entries for
FCFLAGS and FFLAGS are -O2. My hunch is that in
R_HOME/src/gnuwin32/fixed/Makefile, line 29 is changing ALL O3 to O2,
and not just those relating to C++:


  ifeq "$(WIN)" "64"
    $(SED) -e 's/WIN = 32/WIN = 64/' \
      -e "s/-O3/-O2/" \
      ...


Is this intentional? If not, is there a way to keep O3 optimization
with FORTRAN outside of quickly editing Makeconf before R's
compilation gets to using it?

Thank you,

Avi



[Rd] Is it intentional that the Fortran optimization flags changefrom O3 to O2 on Windows?
Avraham Adler