Creates or updates the generated code for a set of dust systems in
a package. The user-provided code is assumed to be in inst/dust
as a series of C++ files; a file inst/dust/x.cpp
will be
transformed into a file src/x.cpp
.
Arguments
- path
Path to the package
- quiet
Passed to
cpp11::cpp_register
, ifTRUE
suppresses informational notices about updates to the cpp11 files. IfNULL
, uses the value of the environment variableDUST_QUIET
if set orFALSE
otherwise.
Details
Classes used within a package must be distinct; typically these will match the filenames.
We add "cpp11 attributes" to the created functions, and will run
cpp11::cpp_register()
on them once the generated code
has been created.
Your package needs a src/Makevars
file to enable OpenMP (if your
system supports it). If it is not present then a suitable Makevars
will be written, containing
following "Writing R Extensions" (see section "OpenMP support").
If your package does contain a src/Makevars
file we do not
attempt to edit it but will error if it looks like it does not
contain these lines or similar.
You also need to make sure that your package loads the dynamic
library; if you are using roxygen, then you might create a file
(say, R/zzz.R
) containing
substituting packagename
for your package name as
appropriate. This will create an entry in NAMESPACE
.