[R-pkg-devel] Compiler optimization flags with R package

Dirk Eddelbuettel edd at debian.org
Sun Jun 18 14:57:38 CEST 2017

On 18 June 2017 at 09:22, Guillaume Chapron wrote:
| Thanks!
| In that file, I see:
| CC = clang
| CFLAGS = -Wall -mtune=core2 -g -O2 $(LTO)
| will having -O0 instead give me all the variables or is there a flag for better debugging (I guess -g does it a little already)?

Right, -g is what you need. I used to not alter -O flags for simplicity but
because code _could_ be reorganized for optimization it is not a bad idea to
use -O0 as well.

But the key is -g (just how there is -pg for profiling).


http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org

More information about the R-package-devel mailing list