What could be issues for failing to build the teststan example package?

I am trying to develop a R package that makes use of rstan and started from the proposed skeleton etc (as per the steps in guidelines for rstan-based packages). I believe what does wrong is the Stan compilation part. After a while I started to wonder whether there is a problem with my computer/R/rstan/devtools/RStudio/something set-up and whether I should try a simple example project. I tried to download the project https://github.com/dmenne/teststan (version downloaded this morning) and to create a package from that in RStudio for Windows 10. This fails, too, with the message below.

Does anyone know, whether the example project should still work? Am I overlooking something really obvious? Have I somehow set things up incorrectly, failed to install something or anything like that?

==> Rcmd.exe INSTALL --no-multiarch --with-keep.source teststan-master

  • installing to library ‘C:/programs/R/R-3.4.0/library’
  • installing source package ‘teststan’ …
    ** libs
    no DLL was created
    ERROR: compilation failed for package ‘teststan’
  • removing ‘C:/programs/R/R-3.4.0/library/teststan’

Exited with status 1.

sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] rstantools_1.2.0 rstan_2.15.1 StanHeaders_2.15.0-1 ggplot2_2.2.1

loaded via a namespace (and not attached):
[1] Rcpp_0.12.11 grid_3.4.0 plyr_1.8.4 gtable_0.2.0 stats4_3.4.0 scales_0.4.1 rlang_0.1.1
[8] lazyeval_0.2.0 tools_3.4.0 munsell_0.4.3 compiler_3.4.0 inline_0.3.14 colorspace_1.3-2 gridExtra_2.2.1
[15] tibble_1.3.3

Try Rcmd.exe INSTALL --no-multiarch -with-keep.source --preclean teststan-master
Or do Rcmd.exe build first.

Thanks! Adding that one option did indeed result in things working fine for the teststan package.

Should this option always be used for Stan based packages?

It depends if you want to (re)build the C++ or keep the same C++ and build the package with possibly modified R code.