Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag for stanc3 compatibility #16

Merged
merged 1 commit into from
Sep 24, 2021
Merged

Add flag for stanc3 compatibility #16

merged 1 commit into from
Sep 24, 2021

Conversation

andrjohns
Copy link
Contributor

Hi,

This PR adds a compiler flag to your Makevars files which is needed for compatibility with the upcoming version of rstan: -DUSE_STANC3

The Stan-to-c++ transpiler (stanc) was refactored after 2.21, and so different c++ is used in the new rstan package (>= 2.26). Because of this, the flag -DUSE_STANC3 needs to be added when a stan model is being run using the new rstan package (and the new stanc implementation).

This PR adds the compiler flag, which is conditionally set based on the installed rstan version.

Feel free to let me know if you need any more info.

Thanks!
Andrew

@helske
Copy link
Owner

helske commented Sep 24, 2021

Thanks, Andrew, is this something that will be handled by the rstantools::rstan_config() automatically in future versions of rstantools? As suggested by @bgoodri in #15, I now try to avoid modifying the Makevars directly (walker needs additional LAPACK/BLAS/FLIBS flags to work as it contains Armadillo C++ code as well), which I have now tried to circumvent by modifying the configure script instead. I guess this change could go there as well, but if it is soon handled automatically it probably doesn't matter.

@andrjohns
Copy link
Contributor Author

Yep, this will be automatically handled by rstantools in the future. This PR is just an intermediate fix to work towards getting RStan CRAN-compatible

@helske helske merged commit 93885a7 into helske:master Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants