0

I am using testing codes written in RCpp on both Windows 7 and Linux (Ubuntu Trusty 14.04) and I noticed that sourceCpp uses g++ options such as -O2. I would like to change it to -O3 (more optimizations) and also try out Intel optimizations such as -mtune=corei7-avx and/or -march=corei7-avx to see if there is any improvements in speed.

How can I change the default options of sourceCpp to allow this?

uday
  • 6,453
  • 13
  • 56
  • 94
  • 2
    Please see Dirk's answer at http://stackoverflow.com/questions/5789673/r-c-optimization-flag-when-using-the-inline-package?rq=1 (in particular, re: `~/.R/Makevars`) – Kevin Ushey Jun 26 '14 at 21:44
  • @KevinUshey, thanks. quick question, under Windows and under Linux, where is the `.R` directory located? Or does one have to create a `.R` directory first and then keep the `Makevars` file there? – uday Jun 27 '14 at 04:01
  • Look for the value of `HOME` eg via `Sys.getenv("HOME")`. You may not have set it yet on Windows, but if you set it (google for how) R will honor. – Dirk Eddelbuettel Jun 27 '14 at 07:43
  • @DirkEddelbuettel, also what about Windows? do I also create a `.R` directory in Windows there? – uday Jun 28 '14 at 04:46
  • Yes *of course*. My answer was specifically for your Windows use. Other OS always have `$HOME`. So yes, create the dir and file. – Dirk Eddelbuettel Jun 28 '14 at 04:49

0 Answers0