[R-SIG-Mac] Link-Time Optimization (LTO)

Prof Brian Ripley r|p|ey @end|ng |rom @t@t@@ox@@c@uk
Wed Jul 15 12:22:22 CEST 2020


On 15/07/2020 09:50, Jeroen Ooms wrote:
> On Tue, Jul 14, 2020 at 4:22 PM Prof Brian Ripley <ripley using stats.ox.ac.uk> wrote:
>>
>> This is a rather technical post about how libraries of compiled code can
>> be further optimized.  LTO generally produces smaller[*] and faster code
>> (typically by a few percent) at the expense of increased installation
>> time and is being used for large projects such as browsers and soon for
>> some Linux distributions.
>>
>> I have committed a series of enhancements to LTO support in R-devel and
>> will shortly port the more important of these to R-patched.
> 
> Would it be worthwhile looking into this for Windows? We did enable
> support for LTO in the rtools40 toolchains*, but those are gcc-8.3.0
> and some of the benefits require gcc-9.
> 
> * https://github.com/r-windows/rtools-packages/blob/master/mingw-w64-gcc/PKGBUILD#L166

Way off topic for R-sig-mac, but it is under discussion for Windows once 
all the planned LTO changes are in.

A minor point which is relevant here: the recommended gfortran 
distribution for macOS (which is from GCC 8.2) contains gcc and g++.  So 
Mac users could try that to get C/Fortran consistency checks.  However, 
only much later versions are compatible with Catalina's SDK 
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90835), and from trying on 
High Sierra it looks like Apple's linker does not understand GCC's LTO 
format.

-- 
Brian D. Ripley,                  ripley using stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford



More information about the R-SIG-Mac mailing list