Hi all. I went to trouble of checking email in my attempt to install Stan.
But still a a problem. I followed Jiqiang's instructions on Xcode (I'll
edit the wiki later once I'm able to access that) and I could install
Xcode but then I had a problem installing Rstan. Here's what happened in
Rstudio:
R version 3.1.0 (2014-04-10) -- "Spring Dance"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin10.8.0 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> Sys.setenv(MAKEFLAGS = "-j4")
> source('
http://mc-stan.org/rstan/install.R', echo = TRUE,
max.deparse.length = 2000)
> install_rstan <- function(multiarch = FALSE) {
+ 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", "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/"))
+ if(multiarch) install.packages("rstan", type = 'source', INSTALL_opts
= '--merge-multiarch')
+ else 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() # possibly with multiarch = TRUE, see below
Removing package from
‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library’
(as ‘lib’ is unspecified)
Error in remove.packages : there is no package called ‘rstan’
trying URL '
http://cran.rstudio.com/src/contrib/inline_0.3.13.tar.gz'
Content type 'application/x-gzip' length 14224 bytes (13 Kb)
opened URL
==================================================
downloaded 13 Kb
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 ‘inline’ ...
** package ‘inline’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (inline)
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
sh: make: command not found
ERROR: compilation failed for package ‘Rcpp’
* removing
‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp’
Warning in install.packages :
installation of package ‘Rcpp’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/t7/y_qndp_51050z8p8n3df7p6c0000gp/T/RtmpZmUl10/downloaded_packages’
Show Traceback
Rerun with Debug
Error in library(Rcpp) : there is no package called ‘Rcpp’
>