[R-sig-Debian] LTO flags in 4.1.0 Ubuntu 21.04 Makeconf

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Wed Jun 2 04:48:09 CEST 2021


Hi Karl,

On 1 June 2021 at 19:12, Karl Dunkle Werner wrote:
| Thanks for the very helpful response!

Thanks for weaving the threads back together.

| Got it, and thank you for the offer! I can edit my Makeconf (everything 
| works when I remove the LTO-related flags). I was hoping to make 
| installation smoother for other Arrow and Ubuntu users, but maybe that's 
| something users or the Arrow developers will need to tackle.

Yes indeed. One difficulty is that package authors can generally not override
what is in R's makeconf. As e.g. with my Rcpp maintainer hat on I have found
that frustrating. But such is life with R: not everything can be altered on
the fly.
 
| I think I'm confused by this comment (because I don't know much about 
| the packaging process).
| > - the Debian and hence derived Ubuntu package of R 4.1.0 does*not*  enable
| >    LTO yet, in other words I have not yet add --enable-lto to the configure
| >    call and we use to default of 'nope'
| I'm confused because the R 4.1.0 Debian versions have flags like:
| CXX11FLAGS = -g -O2 
| -ffile-prefix-map=/home/jranke/git/r-backports/bullseye/r-base-4.1.0=. 
| -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
| -D_FORTIFY_SOURCE=2 -g $(LTO)
| 
| The R 4.1.0 Ubuntu 20.10 flags are:
| CXX11FLAGS = -g -O2 
| -fdebug-prefix-map=/build/r-base-2Aokdc/r-base-4.1.0=. 
| -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
| -D_FORTIFY_SOURCE=2 -g $(LTO)
| 
| While the R 4.1.0 Ubuntu 21.04 flags are:
| CXX11FLAGS = -g -O2 
| -ffile-prefix-map=/build/r-base-aXXzqd/r-base-4.1.0=. -flto=auto 
| -ffat-lto-objects -fstack-protector-strong -Wformat 
| -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g $(LTO)
| 
| Should the Ubuntu 21.04 LTO flags be different than the others?

<shrug emoji here>

Bbut these come from two (or three) distinct sources
- default compiler settings plus distro settings (really two players)
- package changes

and here you only one of the three constant (R 4.1.0). I think the -flto=auto
(amd -ffat-lto-objects) may come from gcc itself.  I can assure you (and you
can test that by looking at the git log at salsa.debian.org under my 'edd'
handle for the r-base package) that the debian/rules files configuring the
build _has not changed_ recently and does not set either.  In particularly no
with/without lto settings.  It's all 'without lto by default' from my end. So
back to ... distribution and compiler changes. And I have learned in the 20+
years here to trust my colleagues looking after gcc et al.

Also, and just to be plain, recall that $(LTO) is calling a variable which
may, or may not, bet set.  When I look at my most recent package build logs
I see the compilation (in the long log) commence with

make[4]: Entering directory '/build/r-base-4.1.0/src/main'
gcc -std=gnu99 -I../../src/extra  -I. -I../../src/include -I../../src/include   -I../../src/nmath -DHAVE_CONFIG_H   -fopenmp -fpic  -g -O2 -ffile-prefix-map=/build/r-base-4.1.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c CommandLineArgs.c -o CommandLineArgs.o

No LTO or -flto here (or in the rest of the file). I may of course have
missed something.

| My challenges are with the Makeconf flags packaged with Ubuntu 21.04's R 
| 4.1.0, but the example above also fails when the same Makeconf file is 
| copied into the rocker/r-base:4.0.5 image.

I have not looked as deeply into this as you but I can assure that I myself
of the maintainer of 'r-base' have been deeply and profoundly frustrated by
the inability of this one package to build properly.  If you can improve that
without heavy surgery, side effects to other packages, or other shenanigans I
would be all ears.

Cheers, Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-SIG-Debian mailing list