Closed chvandorp closed 2 years ago
Oohh, that is weird.
writeLines(c("update(x) <- 1", "initial(x) <- 1"),
"odin_test.R")
odin.dust::odin_dust("odin_test.R")
The issue is that we create the name for the shared library from the filename, but we should really just work around that, and if we do throw an error should throw a better one than this...
Ah, I remember now. dust
uses pkgload
and we create a little fake package behind the scenes. This means that the name of the model needs to be a valid C++ identifier, R identifier and (most annoyingly) R package identifier. I suspect I can relax the last one and then this issue will go away (https://github.com/mrc-ide/dust/issues/358)
Can you please try with this version of dust: https://github.com/mrc-ide/dust/pull/359
With that installed (0.11.22) I believe this will work; at least it does for my toy example. Thanks for the report!
Hi, I tried compiling a odin model with odin.dust and got a strange error message. I then found out that the problem was that the file name contained an underscore (as in
odin_test.txt
). However the stringodin_test
was not show in the error message:results in the following error
regards,
Chris