| compile_dll {pkgbuild} | R Documentation |
Compile a .dll/.so from source.
Description
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).
Usage
compile_dll(
path = ".",
force = FALSE,
compile_attributes = pkg_links_to_cpp11(path) || pkg_links_to_rcpp(path),
register_routines = FALSE,
quiet = FALSE,
debug = TRUE
)
Arguments
path |
Path to a package, or within a package. |
force |
If |
compile_attributes |
if |
register_routines |
if |
quiet |
if |
debug |
If |
Details
Invisibly returns the names of the DLL.
Configuration
Options
-
pkg.build_extra_flags: set this toFALSEto to opt out from adding debug compiler flags incompile_dll(). Takes precedence over thePKG_BUILD_EXTRA_FLAGSenvironment 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/Makevarsfile.
-
Environment variables
-
PKG_BUILD_EXTRA_FLAGS: set this tofalseto to opt out from adding debug compiler flags incompile_dll(). Thepkg.build_extra_flagsoption 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/Makevarsfile.
-
Note
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:
PKG_CPPFLAGS=$(R_HOME)/bin/Rscript -e 'Rcpp:::CxxFlags()'“
See Also
clean_dll() to delete the compiled files.