It appears that R-hub does not define CXX14 like winbuilder does. But in my experience, R-hub should be fine for testing of any non-Windows configuration.
Unrelated to your problem, but since I had a look at your repository, it seems to me that you can avoid having the *.h files and the RcppExports.cpp in the repository, as they are automatically generated by rstantools::rstan_config().
Thanks, you are right. I kept these, because I was once flamed for removing the man-files which I believe are also not required. And (hint, hint @bgoodri ) I thought that these would have been put into gitignore if they were not required, but gitignore is almost empty. And .Rbuildignore?
Should we just have rstantools automatically add these to .Rbuildignore (and .gitignore if it exists)? I don’t think automating it would cause any problems anywhere. I can definitely do this when I have a chance, or if you (@mcol) or anyone else has time and wants to make a PR for this that would be great too.
The rstantools package does not affect the Makevars or Makevars.win files in the user’s home directory. It only writes the src/Makevars and src/Makevars.win files for the package in question. To do the former, see
And one more question even so I have to change .R makevars file to make my own package work on windows, what would be the best way to send my package to cran?
Do STAN have some regulations recommendations? Other than the normal ones in the rstantools recomendations
The rstantools::rstan_create_package will create packages that compile on CRAN. You can upload them to https://win-builder.r-project.org/ to verify. It is only for developing packages that you have to worry about ~/.R/Makevars.win .
You need a ~/.R/Makevars.win like that on the wiki page in order to install your package from source on Windows locally. CRAN is already configured to build a binary version of your package for Windows. The overwhelming majority of R users on Windows install the binary version of the package on CRAN. Occassionally you will encounter someone who wants to install your package from source on Windows and they too will need a ~/.R/Makevars.win like that on the wiki page to do so. This post will become inapplicable with R 4.0.
Yes, installing from GitHub is essentially the same as installing from source via CRAN, which is why most people on Windows use binary packages provided by CRAN.