Cmdstanr: Output directory for $compile

Created on 2 Jul 2020  路  5Comments  路  Source: stan-dev/cmdstanr

I would like to be able to compile a stan model to a specific directory.

This would help with model storage and when compiling a model within an R package (my current use case).

This function may be available within the cpp_options using the -o flag, but I cannot figure it out. And I suspect when you go to sample from the model, it might not retain the connection.

feature

Most helpful comment

That is exactly what I was hoping for - similar to how it handles output of model runs.

All 5 comments

Hi,

thanks for the feature request!

So if I understand correctly, you wish to place the built model (the executable) to some specific location?
Currently, we place the executable to the same location as the model. We could add something like

mod <- cmdstan_model("bernoulli.stan", output_dir = "~/someOtherLocation/")

So the executable would be placed in ~/someOtherLocation/bernoulli or ~/someOtherLocation/bernoulli.exe on Windows.

I think this sounds useful. @jgabry any thoughts?

That is exactly what I was hoping for - similar to how it handles output of model runs.

I think this sounds useful. @jgabry any thoughts?

Sure, sounds good to me!

And adding a reminder here for whichever one of us ends up adding this: remember to update these lines in the vignette

https://github.com/stan-dev/cmdstanr/blob/31016816cf346e602a8458cb15cc31f43ef16931/vignettes/cmdstanr-internals.Rmd#L104-L105

@jstagge Thanks again for the feature request. This should be working on the master branch now that #238 is merged. If you reinstall with devtools::install_github("stan-dev/cmdstanr") does the new dir argument work properly for you?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgabry picture jgabry  路  5Comments

SteveBronder picture SteveBronder  路  7Comments

rok-cesnovar picture rok-cesnovar  路  6Comments

karldw picture karldw  路  5Comments

yizhang-yiz picture yizhang-yiz  路  4Comments