Can't install RStan

376 views
Skip to first unread message

Cong

unread,
Sep 27, 2014, 10:34:05 AM9/27/14
to

Dear List,


I got the following message when I was trying to install RStan, can anyone tell me how to fix that? I'm using RStudio-0.98.1062 & R-3.1.1-win.

Thanks!


> source('http://mc-stan.org/rstan/install.R', echo = TRUE, max.deparse.length = 2000)

 

> install_rstan <- function() {

+   on.exit(Sys.unsetenv("R_MAKEVARS_USER"))

+   on.exit(Sys.unsetenv("R_MAKEVARS_SITE"), add = TRUE)

+   try(remove.packages("rstan"), silent = TRUE)

+   Sys.setenv(R_MAKEVARS_USER = "foobar")

+   Sys.setenv(R_MAKEVARS_SITE = "foobar")

+   install.packages(c("inline", "BH", "RcppEigen"))

+   install.packages("Rcpp", type = "source")

+   library(inline) 

+   library(Rcpp)

+   src <- ' 

+     std::vector<std::string> s; 

+     s.push_back("hello");

+     s.push_back("world");

+     return Rcpp::wrap(s);

+   '

+   hellofun <- cxxfunction(body = src, includes = '', plugin = 'Rcpp', verbose = FALSE)

+   test <- try(hellofun())

+   if(inherits(test, "try-error")) stop("hello world failed; ask for help on Rcpp list")

+   options(repos = c(getOption("repos"), 

+           rstan = "http://rstan.org/repo/"))

+   install.packages("rstan", type = 'source')

+   library(rstan)

+   set_cppo("fast")

+   if (any(grepl("^darwin", R.version$os, ignore.case = TRUE))) {

+     cat('\nCC=clang', 'CXX=clang++ -arch x86_64 -ftemplate-depth-256', 

+         file = "~/.R/Makevars", sep = "\n", append = TRUE)

+   }

+   return(invisible(NULL))

+ }

> install_rstan()

Removing package from ‘C:/Users/CF/Documents/R/win-library/3.1’

(as ‘lib’ is unspecified)

Error in remove.packages : there is no package called ‘rstan’

Installing packages into ‘C:/Users/CF/Documents/R/win-library/3.1’

(as ‘lib’ is unspecified)

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/inline_0.3.13.zip'

Content type 'application/zip' length 80322 bytes (78 Kb)

opened URL

downloaded 78 Kb

 

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/BH_1.54.0-4.zip'

Content type 'application/zip' length 10279113 bytes (9.8 Mb)

opened URL

downloaded 9.8 Mb

 

trying URL 'http://cran.rstudio.com/bin/windows/contrib/3.1/RcppEigen_0.3.2.2.0.zip'

Content type 'application/zip' length 2105303 bytes (2.0 Mb)

opened URL

downloaded 2.0 Mb

 

package ‘inline’ successfully unpacked and MD5 sums checked

package ‘BH’ successfully unpacked and MD5 sums checked

package ‘RcppEigen’ successfully unpacked and MD5 sums checked

 

The downloaded binary packages are in

            C:\Users\CF\AppData\Local\Temp\RtmpOAZEa3\downloaded_packages

Installing package into ‘C:/Users/CF/Documents/R/win-library/3.1’

(as ‘lib’ is unspecified)

trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.2.tar.gz'

Content type 'application/x-gzip' length 2004313 bytes (1.9 Mb)

opened URL

downloaded 1.9 Mb

 

* installing *source* package 'Rcpp' ...

** package 'Rcpp' successfully unpacked and MD5 sums checked

** libs

 

*** arch - i386

Warning: running command 'make -f "Makevars.win" -f "C:/PROGRA~1/R/R-31~1.1/etc/i386/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="Rcpp.dll" OBJECTS="Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o"' had status 127

ERROR: compilation failed for package 'Rcpp'

* removing 'C:/Users/CF/Documents/R/win-library/3.1/Rcpp'

* restoring previous 'C:/Users/CF/Documents/R/win-library/3.1/Rcpp'

Warning in install.packages :

  running command '"C:/PROGRA~1/R/R-31~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\CF\Documents\R\win-library\3.1" C:\Users\CONGFE~1\AppData\Local\Temp\RtmpOAZEa3/downloaded_packages/Rcpp_0.11.2.tar.gz' had status 1

Warning in install.packages :

  installation of package ‘Rcpp’ had non-zero exit status

 

The downloaded source packages are in

            ‘C:\Users\CF\AppData\Local\Temp\RtmpOAZEa3\downloaded_packages’

 

Attaching package: ‘Rcpp’

 

The following object is masked from ‘package:inline’:

 

    registerPlugin

 

Warning message:

running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file8b0c495c75.dll" WIN=64 TCLBIN=64 OBJECTS="file8b0c495c75.o"' had status 127 

 

ERROR(s) during compilation: source code errors or compiler configuration errors!

 

Program source:

  1: 

  2: // includes from the plugin

  3: 

  4: #include <Rcpp.h>

  5: 

  6: 

  7: #ifndef BEGIN_RCPP

  8: #define BEGIN_RCPP

  9: #endif

 10: 

 11: #ifndef END_RCPP

 12: #define END_RCPP

 13: #endif

 14: 

 15: using namespace Rcpp;

 16: 

 17: 

 18: // user includes

 19: 

 20: 

 21: // declarations

 22: extern "C" {

 23: SEXP file8b0c495c75( ) ;

 24: }

 25: 

 26: // definition

 27: 

 28: SEXP file8b0c495c75(  ){

 29: BEGIN_RCPP

 30:  

 31:     std::vector<std::string> s; 

 32:     s.push_back("hello");

 33:     s.push_back("world");

 34:     return Rcpp::wrap(s);

 35:   

 36: END_RCPP

 37: }

 38: 

 39: 

 Show Traceback

 

 Rerun with Debug

 Error in compileCode(f, code, language = language, verbose = verbose) : 

  Compilation ERROR, function(s)/method(s) not created! Warning message:

running command 'make -f "C:/PROGRA~1/R/R-31~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-31~1.1/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="file8b0c495c75.dll" WIN=64 TCLBIN=64 OBJECTS="file8b0c495c75.o"' had status 127 In addition: Warning message:

running command 'C:/PROGRA~1/R/R-31~1.1/bin/x64/R CMD SHLIB file8b0c495c75.cpp 2> file8b0c495c75.cpp.err.txt' had status 1 

> library(rstan)

Error in library(rstan) : there is no package called ‘rstan’

> options(repos = c(getOption("repos"), rstan = "http://wiki.stan.googlecode.com/git/R"))

> install.packages('rstan', type = 'source')

Warning in install.packages :

  InternetOpenUrl failed: 'The host name in the certificate is invalid or does not match'

Warning in install.packages :

  InternetOpenUrl failed: 'The host name in the certificate is invalid or does not match'

Warning in install.packages :

  unable to access index for repository http://wiki.stan.googlecode.com/git/R/bin/windows/contrib/3.1

Installing package into ‘C:/Users/CF/Documents/R/win-library/3.1’

(as ‘lib’ is unspecified)

Warning in install.packages :

  InternetOpenUrl failed: 'The host name in the certificate is invalid or does not match'

Warning in install.packages :

  InternetOpenUrl failed: 'The host name in the certificate is invalid or does not match'

Warning in install.packages :

  unable to access index for repository http://wiki.stan.googlecode.com/git/R/src/contrib

Warning in install.packages :

  package ‘rstan’ is not available (for R version 3.1.1)

 

Daniel Lee

unread,
Sep 27, 2014, 10:38:14 AM9/27/14
to stan-...@googlegroups.com
Looks like you're running under Windows. Have you installed RTools? It looks like Rcpp isn't installing properly, which is required for RStan.

On Sat, Sep 27, 2014 at 10:34 AM, Cong <congf...@gmail.com> wrote:

Dear List,


I got the following message when I was trying to install RStan, can anyone tell me how to fix that? 

Thanks!

--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages