RStan 2.18.2: issue with installation or compiler

Dear RStan community

To install RStan, I followed the instruction under “RStan Getting Started”. I then ran the 8 schools example to see if RStan works. I got the following error:

Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! In file included from …/users/…/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5:0,
from …/users/…/R/win-library/3.5/StanHeaders/include/stan/math/rev/core.hpp:12,
from …/users/…/R/win-library/3.5/StanHeaders/include/stan/math/rev/mat.hpp:4,
from …/users/…/R/win-library/3.5/StanHeaders/include/stan/math.hpp:4,
from …/users/…/R/win-library/3.5/StanHeaders/include/src/stan/model/model_header.hpp:4,
from file143431fc76a3.cpp:8:
…/users/…/R/win-library/3.5/StanHeaders/include/stan/math/rev/core/var.hpp:7:39: fatal error: boost/math/tools/config.hpp: No such file or directory
#include <boost/
In addition: Warning message:
In system(cmd, intern = !verbose) :
running command ‘C:/PROGRA~1/R/R-35~1.1/bin/x64/R CMD SHLIB file143431fc76a3.cpp 2> file143431fc76a3.cpp.err.txt’ had status 1
Error in sink(type = “output”) : invalid connection

I installed RStan and its dependencies on a networked drive (I replaced the actual path with “…/users/…/” in the above text), while R and Rtools were installed on the local drive of my computer. But I get an error even when I install RStan on the local drive.

I have tried various suggestions from the forums (I haven’t properly logged everything I tried), but with no luck. I would be grateful if you would have any suggestions about how to get RStan working!

Many thanks

In addition, output from sessionInfo() :

R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

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

other attached packages:
[1] rstan_2.18.2 StanHeaders_2.18.0 ggplot2_3.1.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 pillar_1.3.0 compiler_3.5.1 plyr_1.8.4 bindr_0.1.1 prettyunits_1.0.2
[7] base64enc_0.1-3 tools_3.5.1 pkgbuild_1.0.2 tibble_1.4.2 gtable_0.2.0 pkgconfig_2.0.2
[13] rlang_0.3.0.1 cli_1.0.1 rstudioapi_0.8 parallel_3.5.1 yaml_2.2.0 loo_2.0.0
[19] bindrcpp_0.2.2 gridExtra_2.3 withr_2.1.2 dplyr_0.7.8 stats4_3.5.1 grid_3.5.1
[25] tidyselect_0.2.5 inline_0.3.15 glue_1.3.0 R6_2.3.0 processx_3.2.0 callr_3.0.0
[31] purrr_0.2.5 magrittr_1.5 scales_1.0.0 ps_1.2.1 matrixStats_0.54.0 assertthat_0.2.0
[37] colorspace_1.3-2 lazyeval_0.2.1 munsell_0.5.0 crayon_1.3.4

Hi all

It seems I was able to get RStan working by changing the “R_USER” environmental variable to local drive and installing RStan and all its dependencies on that local drive (as opposed to the networked drive)!

I realised that when I had previously installed RStan on a local drive, then some of its dependencies were still on the networked drive and this could have caused the problem. Conversely, when RStan and its non-base-R dependencies were installed on the networked drive (while R itself was on the local drive), then this setup did not work.

(Furthermore, maybe it was not necessary to change the “R_USER” variable, but simply install all dependencies on the local drive, but this is something I have not yet checked.)

Best wishes

Yes, it looks from the original error message that it was unable to find the BH package (which contains the Boost headers), so whatever you did must have resulted in BH being found.

Were you able to get this to work on the networked drive? I am trying to use a stan program on my school’s server but am running into the same error.

On networked drives I’ve always had to put a request in for the sys admin to install.