Description Usage Arguments Details Note Author(s) See Also
Write a user Makevars with updated optimization level
1 2 3 4 5 6 | set_optimization(level = 3, omit.debug = FALSE, disable.asserts = FALSE,
suppress.warnings = FALSE, overwrite = FALSE)
show.Makevars()
rm.Makevars()
|
level |
the compiler optimization level (-O<level>) |
omit.debug |
if true, remove "-g" from flags |
disable.asserts |
if true, set NDEBUG define |
suppress.warnings |
if true, suppress compiler warnings |
overwrite |
if true, overwrite existing Makevars file |
This function will change the optimization flags used when compiling code. It will write the file "Makevars" to the ".R" directory in your "$HOME" directory. These setting will effect all subsequent compiles, even package installation, unless you remove or edit the "Makevars" file.
This function assumes that your compiler uses "-O" to indicate optimization level and "-g" to indicate that the compiler should issue debugging symbols.
Please let me know if this function fails for your compiler. (Submit and issue on GitHub.)
Don't go overboard. Levels greater than 3 can be hazardous to numerical accuracy. Some packages will not compile or will give inaccurate results for levels above 2.
A very similar function exists in the RStan package.
Timothy H. Keitt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.