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

Dirk Eddelbuettel edd at debian.org
Sat Jun 17 21:57:13 CEST 2017


On 17 June 2017 at 21:32, Guillaume Chapron wrote:
| I am trying to debug some C code that is run only through a R package. I debug with lldb but I always get a message telling that the package "was compiled with optimization - stepping may behave oddly; variables may not be available.” And in fact, I cannot evaluate all variables and understand what is wrong. I have created a Makevars file in ~/.R/ that contains C=clang -O0 -g but it does not seem to change much. What should I do to make sure I can evaluate all variables in lldb? I am on a Mac and I wrote C=clang because I read that it produced much better error messages but I am happy to use gcc as well if this can be a solution.

Edit the file Makeconf in e.g.

     R> file.path(Sys.getenv("R_HOME"), "etc", "Makeconf")
     [1] "/usr/lib/R/etc/Makeconf"
     R> 

It has those settings hardwired from when R itself was compiled for you.  You
probably want to keep a copy of the original file to be able to revert.

Dirk

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



More information about the R-package-devel mailing list