`rstan` installation error RStudio cloud

Hi,

I’ve installed rstan via install.packages('rstan', repos='https://mran.microsoft.com/snapshot/2020-02-10') since this seems to be the only feasible way to do so in my RStudio cloud. When I try running the below example…

example(stan_model, package = "rstan", run.dontrun = TRUE)

…I get the following error message.

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from /usr/local/lib64/R/site-library/RcppEigen/include/Eigen/Core:397,
                 from /usr/local/lib64/R/site-library/RcppEigen/include/Eigen/Dense:1,
                 from /home/aa0212/R/x86_64-redhat-linux-gnu-library/4.0/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
                 from <command-line>:
/usr/local/lib64/R/site-library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:60:39: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
 template<> struct is_arithmetic<__m128>  { enum { value = true }; };
                                       ^
/usr/local/lib64/R/site-library/RcppEigen/include/Eigen/src/Core/arch/SSE/PacketMath.h:61:40: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
 template<> struct is_arithmetic<__m128i> { enum { va

Now, I understand from this post that it may be due to the StanHeaders being installed to a folder on the computer that the cloud-version RStudio can’t locate. But I’m not sure what to do about it. Any help would be appreciated. Thanks!

The error isn’t actually contained in that snippet, we would need to see more of the output. Have you also tried installing from source?

Hi @andrjohns, thanks for checking. I’m afraid that’s the entire error message right there. I can’t install from source, i.e. I can’t go into CRAN the way things are set up, alas. What I was able to do is to use a custom-built function to force installation using with_proxy. Seems to be working now. Thanks again though.