set-opt: Set compiler optimization

Description Usage Arguments Details Note Author(s) See Also

Description

Write a user Makevars with updated optimization level

Usage

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()

Arguments

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

Details

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.)

Note

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.

Author(s)

Timothy H. Keitt

See Also

compile_sys


thk686/odeintr documentation built on May 31, 2019, 10:43 a.m.