Error in Installing rstan Package

799 views
Skip to first unread message

Shyue-Ming Loh

unread,
Jul 28, 2015, 4:22:50 PM7/28/15
to stan-...@googlegroups.com
Hi, I get this error when I tried to install the rstan R package:

> install.packages("rstan", dependencies=TRUE)
Installing package into ‘/usr/local/google/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependency ‘loo’ is not available
Content type 'application/x-gzip' length 1093296 bytes (1.0 Mb)
opened URL
==================================================
downloaded 1.0 Mb

* installing *source* package ‘rstan’ ...
** package ‘rstan’ successfully unpacked and MD5 sums checked
** libs
[some output]

In file included from [usr/local/ folder]/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:4:0,
                 from chains.cpp:19:
[usr/local/ folder]/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:23: fatal error: Eigen/Dense: No such file or directory
 #include <Eigen/Dense>
                       ^
compilation terminated.
make: *** [chains.o] Error 1
ERROR: compilation failed for package ‘rstan’
* removing ‘[usr/local/ folder]/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1/rstan’

I've omitted the usr/local/ folder in the paths above, for confidentiality's sake.

I am not sure whether the error is due to the fact that the loo package is not installed. Here's my session info:

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
 [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

loaded via a namespace (and not attached):
[1] tools_3.1.1

The loo package is only available for R 3.1.2 and above.

Shyue-Ming Loh

unread,
Jul 28, 2015, 4:31:55 PM7/28/15
to stan-...@googlegroups.com

Ben Goodrich

unread,
Jul 28, 2015, 5:14:29 PM7/28/15
to Stan users mailing list, shyuem...@gmail.com, shyuem...@gmail.com
On Tuesday, July 28, 2015 at 4:22:50 PM UTC-4, Shyue-Ming Loh wrote:
In file included from [usr/local/ folder]/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1/StanHeaders/include/stan/math/prim/mat/fun/mean.hpp:4:0,
                 from chains.cpp:19:
[usr/local/ folder]/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:4:23: fatal error: Eigen/Dense: No such file or directory
 #include <Eigen/Dense>
                       ^
compilation terminated.
make: *** [chains.o] Error 1
ERROR: compilation failed for package ‘rstan’
* removing ‘[usr/local/ folder]/home/shyuemingloh/R/x86_64-pc-linux-gnu-library/3.1/rstan’

Do you have RcppEigen installed? The loo thing is not really a problem because no rstan code utilizes it.

Ben


Shyue-Ming Loh

unread,
Jul 28, 2015, 5:21:38 PM7/28/15
to Ben Goodrich, Stan users mailing list
Apparently, I do. I executed installed.packages() and found the following the output:

Rcpp               NA                    NA      NA     "yes"            "3.1.1"
RcppEigen          NA                    NA      NA     "yes"            "3.1.1"

Ben Goodrich

unread,
Jul 28, 2015, 5:26:46 PM7/28/15
to Stan users mailing list, shyuem...@gmail.com, shyuem...@gmail.com
On Tuesday, July 28, 2015 at 5:21:38 PM UTC-4, Shyue-Ming Loh wrote:
Apparently, I do. I executed installed.packages() and found the following the output:

I would try reinstalling RcppEigen. The rstan error says that it cannot find the Eigen headers, even though RcppEigen is in the LinkingTo line in rstan's DESCRIPTION file.

Ben


Shyue-Ming Loh

unread,
Jul 29, 2015, 2:12:25 PM7/29/15
to Ben Goodrich, Stan users mailing list
Thanks, Ben. I had an older version of RcppEigen. I updated to the latest version, and I can now install without any problems. 
Reply all
Reply to author
Forward
0 new messages