These functions check if a small C file can be compiled, linked, loaded and executed.
has_compiler()
and has_devel()
return TRUE
or FALSE
.
check_compiler()
and check_devel()
throw an error if you don't have developer tools installed.
If the "pkgbuild.has_compiler"
option is set to TRUE
or FALSE
,
no check is carried out, and the value of the option is used.
The implementation is based on a suggestion by Simon Urbanek.
End-users (particularly those on Windows) should generally run
check_build_tools()
rather than check_compiler()
.
Arguments
- debug
If
TRUE
, will print out extra information useful for debugging. IfFALSE
, it will use result cached from a previous run.
Examples
has_compiler()
#> [1] TRUE
check_compiler()
#> [1] TRUE
with_build_tools(has_compiler())
#> [1] TRUE