Compile an odin model to work with dust.
odin_dust(x, ..., options = NULL)
odin_dust_(x, ..., options = NULL)
Either the name of a file to read, a text string (if length is greater than 1 elements will be joined with newlines) or an expression.
Arguments passed to odin_dust_options,
including real_type
, gpu
, verbose
, workdir
,
no_check_unused_equations
and rewrite_dims
.
An odin::odin_options or odin_dust_options
object. If given it overrides arguments; if it is already a
odin_dust_options
object it is returned unmodified. Otherwise
it is passed through to odin::odin_options where it will
override arguments in ...
but respond to the odin_dust
specific options (real_type
, etc)
Note that this does not (yet) support the full odin output object, instead creating the more limited dust interface. However, for many uses this should be considerably faster than the interface that odin normally uses (built on dde).
When including custom C++ code you may want to set additional options in order to enable compilation. You can do this by including pseudo-attributes
// [[odin.dust::cpp_std(C++17)]]
- use this to change the C++
standard used in compilation; this is passed to dust::dust()
as the cpp_std
option. It is only necessary to pass in values
greater than C++11 at present as that is dust's default.
// [[odin.dust::linking_to(pkg)]]
- use this to make include
files present in an R package (e.g., BH) available. You can use
as many of these attributes as you need.