For lower-level odin functions odin_parse
,
odin_validate
we accept a list of options rather
than individually named options.
odin_options(verbose = NULL, target = NULL, workdir = NULL,
validate = NULL, pretty = NULL, skip_cache = NULL,
compiler_warnings = NULL, no_check_unused_equations = NULL,
no_check_naked_index = NULL, options = NULL)
Logical scalar indicating if the compilation should
be verbose. Defaults to the value of the option
odin.verbose
or FALSE
otherwise.
Compilation target. Options are "c" and "r",
defaulting to the option odin.target
or "c" otherwise.
Directory to use for any generated files. This is
only relevant for the "c" target. Defaults to the value of the
option odin.workdir
or tempdir()
otherwise.
Validate the model's intermediate representation
against the included schema. Normally this is not needed and is
intended primarily for development use. Defaults to the value
of the option odin.validate
or FALSE
otherwise.
Pretty-print the model's intermediate
representation. Normally this is not needed and is intended
primarily for development use. Defaults to the value of the
option odin.pretty
or FALSE
otherwise.
Skip odin's cache. This might be useful if the
model appears not to compile when you would expect it to.
Hopefully this will not be needed often. Defaults to the option
odin.skip_cache
or FALSE
otherwise.
Logical scalar indicating if compiler
warnings should be converted to R warnings. If this is
TRUE
, then if any compiler warnings are generated, the
compiler output will be displayed (regardless of the value of
verbose
) within an R warning (suppressible via
suppressWarnings
and catchable via tryCatch
). The
default is to default to FALSE
unless the global option
odin.compiler_warnings
is set to TRUE
(set with
options(odin.compiler_warnings = TRUE)
). The default may
change to TRUE
in future. Warnings are currently a mix
of ambiguous syntax in your model (worth fixing) and limitations
in the code that odin generates (which you can't fix but I will
get on to over time). What is flagged will depend strongly on
your platform and what is in your Makevars
. I develop
odin with -Wall -Wextra -pedantic
and still see warnings
with both gcc and clang. The compiler output is very simple and
may not work on all platforms. Defaults to the option
odin.compiler_warnings
or FALSE
otherwise.
If TRUE
, then don't print
messages about unused variables. Defaults to the option
odin.no_check_unused_equations
or FALSE
otherwise.
If TRUE
, then if an index
variable (i
, j
, ...) is used outside of an array
subset (e.g., x[] <- i
) then a notice is printed. The
behaviour of this functionality changed in odin version
0.2.0
and this flag is intended to notify users about the
change. See https://github.com/mrc-ide/odin/issues/136
for more information. Defaults to the option
odin.no_check_naked_index
or FALSE
otherwise.
Named list of options. If provided, then all other options are ignored.
# NOT RUN {
odin_options()
# }
Run the code above in your browser using DataCamp Workspace