compile_dll
performs a fake R CMD install so code that
works here should work with a regular install (and vice versa).
During compilation, debug flags are set with
compiler_flags(TRUE)
.
compile_dll(
path = ".",
force = FALSE,
compile_attributes = pkg_links_to_cpp11(path) || pkg_links_to_rcpp(path),
register_routines = FALSE,
quiet = FALSE,
debug = TRUE
)
Path to a package, or within a package.
If TRUE
, for compilation even if needs_compile()
is
FALSE
.
if TRUE
and the package uses Rcpp, call
Rcpp::compileAttributes()
before building the package. It is ignored
if package does not need compilation.
if TRUE
and the package does not use Rcpp, call
register routines with
tools::package_native_routine_registration_skeleton()
before building
the package. It is ignored if package does not need compilation.
if TRUE
suppresses output from this function.
If TRUE
, and if no user Makevars is found, then the build
runs without optimisation (-O0
) and with debug symbols (-g
). See
compiler_flags()
for details. If you have a user Makevars (e.g.,
~/.R/Makevars
) then this argument is ignored.
Invisibly returns the names of the DLL.
pkg.build_extra_flags
: set this to FALSE
to to opt out from adding
debug compiler flags in compile_dll()
. Takes precedence over the
PKG_BUILD_EXTRA_FLAGS
environment variable. Possible values:
TRUE
: add extra flags,
FALSE
: do not add extra flags,
"missing"
: add extra flags if the user does not have a
$HOME/.R/Makevars
file.
PKG_BUILD_EXTRA_FLAGS
: set this to false
to to opt out from adding
debug compiler flags in compile_dll()
. The pkg.build_extra_flags
option
takes precedence over this environment variable. Possible values:
"true"
: add extra flags,
"false"
: do not add extra flags,
"missing"
: add extra flags if the user does not have a
$HOME/.R/Makevars
file.
If this is used to compile code that uses Rcpp, you will need to
add the following line to your Makevars
file so that it
knows where to find the Rcpp headers:
clean_dll()
to delete the compiled files.