difficulty following install instructions for mac OS X version 7

86 views
Skip to first unread message

Andrew Gelman

unread,
Jul 9, 2014, 1:15:59 AM7/9/14
to stan...@googlegroups.com
Hi all.  I decided to try to install Stan and Rstan on Caroline's computer which is Mac OS X version 10.7.5.  I was following all the instructions with no problem until I reached Step 2.3. Install Xcode, subsection For OS X 10.7 "Lion" or Mac OS X 10.6 "Snow Leopard".

First I followed the instructions and registered as a developer.  This worked.  Then I went to the Apple Xcode Page.  Fine.  But then I had problems with the following instructions:

Scroll down to the link after "past versions", and click on View Downloads.

There was nothing on that page about "past revisions" or "View Downloads".  Instead I clicked on Downloads, then scrolled down to Additional Tools and clicked on View Downloads there.  I think this is what I wanted to be doing, so no real problem yet, just a minor bump in the road that I figured out how to navigate.

But then I was hung up on this next step:  "Select the latest Xcode 4.minor version available and install it."  I could find a version of Xcode 4 on the list (not right away, but eventually I found one), but I have no idea what a "minor" version is.  So I'm stuck.  I don't know what a minor version is, and "minor" is italicized in the instructions so I don't want to just install regular Xcode 4.  I've had enough problems before from installing the wrong version (which then can't easily be uninstalled) that I want to make sure I have the right thing before installing.

I also looked up *xcode 4.minor version" on the web and found this:  https://developer.apple.com/library/mac/documentation/macosx/conceptual/BPFrameworks/Concepts/VersionInformation.html#//apple_ref/doc/uid/20002255-101531 which defined what a minor version is, but this didn't really help me here to figure out what I should be doing.

Thanks in advance for your help.

As always,
Your User.

Jiqiang Guo

unread,
Jul 9, 2014, 9:47:10 AM7/9/14
to stan...@googlegroups.com
In the case of Xcode 4, there are Xcode 4.6.3 and Xcode 4.6.2.  So please use Xcode 4.6.3 here. 

Jiqiang 


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

gel...@stat.columbia.edu

unread,
Jul 9, 2014, 12:11:32 PM7/9/14
to stan...@googlegroups.com
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’

>


Jiqiang Guo

unread,
Jul 9, 2014, 12:29:32 PM7/9/14
to stan...@googlegroups.com
The current problem seems to be that there is no command line tools for Xcode.  Nowadays, I don't know how to make it easy to get it installed.  However, in your case, please try go to 

and look for "Command Line Tools (OS X Lion) for Xcode - April 2013 (my screen shot, http://i.imgur.com/Homw8KA.png)

I am not  sure you can use the following link since I have that link after logged in:



 Error in library(Rcpp) : there is no package called 'Rcpp'

gel...@stat.columbia.edu

unread,
Jul 9, 2014, 3:11:12 PM7/9/14
to stan...@googlegroups.com
J
Hey, it works! Thanks. When you have time, would you be able to update
the install instructions? Thanks much.
A

Jiqiang Guo

unread,
Jul 9, 2014, 4:01:32 PM7/9/14
to stan...@googlegroups.com
Good that it works. 

Originally in the getting started page, I only point to Stan's manual for how to get the tool chain installed.  But Bob added more later.  For now, it is a bit complicated to get the tool chain installed for different versions of Mac OS X.  I think installing the tool chain is still part of the (cmd)Stan manual for now, so maybe one can improve that part and move it to a webpage.  Then rstan's getting started webpage can point to it and we don't need to write two instructions for rstan and stan. 

On second thought, maybe Xcode and the command line tools for old version of Mac are frozen, updating the instruction won't be too hard though I cannot test it. 

Jiqiang 

Bob Carpenter

unread,
Jul 9, 2014, 4:16:50 PM7/9/14
to stan...@googlegroups.com
Andrew and Jiqiang:

I'd rather not point RStan users to the CmdStan doc --- there's
nothing about installation any more in the Stan modeling language
doc.

There already ARE instructions for RStan for Mac OS X:

https://github.com/stan-dev/rstan/wiki/RStan-Mac-OS-X-Prerequisite-Installation-Instructions

The top-level page points to pre-reqs, which points to the above
(and elsewhere for other platforms). It already mentions the
need to install the command-line tools.

Andrew --- you can edit these yourself --- it's on GitHub.
You should always keep track of what you do every time you
install on a non-standard platform to help the next person who
tries it.

Andrew --- what should we change 4.minor to to make it easier
to understand? Would "4.x.y for the largest value of "x" you can
find be easier"?

- Bob

P.S. This is all the CmdStan manual says about older versions of Xcode:

------------------------
Xcode 4 may be downloaded for free for Mac OS X 10.7 (“Lion”) or later directly from Apple:

Xcode 4: https://developer.apple.com/xcode/

Once you’ve installed Xcode, you need to start it, then open menu option Xcode, select Preferences, then click on the Downloads icon and then click on the Install button next to the option labeled “Command Line Tools.”

At this point, you should have the make system make and the two C++ compil- ers/linkers, g++ and clang++, installed. This is all you need to run Stan. Xcode will also install the git version control system at this point.
----------------------------------------------

So we should probably update that.

- Bob

gel...@stat.columbia.edu

unread,
Jul 9, 2014, 4:21:03 PM7/9/14
to stan...@googlegroups.com
Bob:

There were 3 problems with the instructions:

1. The directions to find the Xcode were not quite right. I can fix this
(once I'm able again to log in to the wiki).

2. I had no idea what 4.minor meant. 4.* would be clearer to me.

3. There was an entire step that was not mentioned anywhere on the page,
having to do with installing command line tools for Xcode. Jiqang gave me
instructions here but I think they are specific to my system so there's no
way I could fix the instructions on this point.

If it were only 1 and 2, I'd do it myself once I can get back on to the
wiki. But since step 3 was needed anyway, I thought it would make sense
for Jiqiang to do all of the changes.
A

Bob Carpenter

unread,
Jul 9, 2014, 4:49:15 PM7/9/14
to stan...@googlegroups.com


On Jul 9, 2014, at 4:21 PM, gel...@stat.columbia.edu wrote:

> Bob:
>
> There were 3 problems with the instructions:

Thanks for breaking it down.

>
> 1. The directions to find the Xcode were not quite right. I can fix this
> (once I'm able again to log in to the wiki).

Is something stopping you from logging in to the wiki?

> 2. I had no idea what 4.minor meant. 4.* would be clearer to me.

I'm OK with saying "4.*" as long as that's not going to be confusing
when there are versions like 4.6.2. But as Jiqiang says, we can just
call out one of the versions.

(The usual naming convention for software, which we follow in Stan,
is to number releases as MAJOR.MINOR.PATCH. Backward-compatibility updating
releases increment MAJOR. New features that don't break backward compatibility
update MINOR. Bug fix only releases update PATCH.)

> 3. There was an entire step that was not mentioned anywhere on the page,
> having to do with installing command line tools for Xcode.

Maybe Jiqiang already updated, because what I see as the last
step of the install instructions on

https://github.com/stan-dev/rstan/wiki/RStan-Mac-OS-X-Prerequisite-Installation-Instructions

is:

• Install command-line tools, which you will need to run RStan

• Open Xcode (see Step 2.2 above).
• Select menu item Xcode, option Preferences.
• Click on Downloads tab on top.
• Click on Install button next to Command Line Tools.

it may not be right or clear enough. I think you need to download the command-line
tools separately in some cases --- depends on how old the Xcode is that you're
using.

(And by the way, this kind of thing where instructions go stale is the
main reason not to ever break backward compatibility unless absolutely
necessary! It just frustrates users to no end.)

> Jiqang gave me
> instructions here but I think they are specific to my system so there's no
> way I could fix the instructions on this point.

They are not specific to your particular machine, but specific to older
versions of the Mac OS X. So whatever you did should work for others.

> If it were only 1 and 2, I'd do it myself once I can get back on to the
> wiki. But since step 3 was needed anyway, I thought it would make sense
> for Jiqiang to do all of the changes.

Doesn't matter to me who does them. I'm making an issue to add better
instructions to the CmdStan manual, which is actually behind where the
RStan instructions are at.

- Bob

Jiqiang Guo

unread,
Jul 10, 2014, 6:01:43 PM7/10/14
to stan...@googlegroups.com
Anyway, I made some effort to update 


There might be issues with them, but I cannot test any of them. Main changes are 

1. For Mavericks, I made changes on how to get Xcode app installed.  I don't know if it is needed to install the command line tools in this case (installing command line tools wasn't in the instruction previously).  Now I even don't know how my command lines tools was installed. 

2. For old versions of Mac OS X, I added how to check if there is command line tools installed and I changed to install the command line tools by downloading from the developer website. 

Feel free to make it more clear.  But I think stuff from Apple gets changed too frequently. 

Jiqiang 


On Wed, Jul 9, 2014 at 4:49 PM, Bob Carpenter <ca...@alias-i.com> wrote:


On Jul 9, 2014, at 4:21 PM, gel...@stat.columbia.edu wrote:

> Bob:
>
> There were 3 problems with the instructions:

Thanks for breaking it down.

>
> 1.  The directions to find the Xcode were not quite right.  I can fix this
> (once I'm able again to log in to the wiki).

Is something stopping you from logging in to the wiki?

> 2.  I had no idea what 4.minor meant.  4.* would be clearer to me.

I'm OK with saying "4.*" as long as that's not going to be confusing
when there are versions like 4.6.2.  But as Jiqiang says, we can just
call out one of the versions.

(The usual naming convention for software, which we follow in Stan,
is to number releases as MAJOR.MINOR.PATCH.  Backward-compatibility updating
releases increment MAJOR.  New features that don't break backward compatibility
update MINOR.  Bug fix only releases update PATCH.)

> 3.  There was an entire step that was not mentioned anywhere on the page,
> having to do with installing command line tools for Xcode.

Maybe Jiqiang already updated, because what I see as the last
step of the install instructions on

  https://github.com/stan-dev/rstan/wiki/RStan-Mac-OS-X-Prerequisite-Installation-Instructions

is:

        * Install command-line tools, which you will need to run RStan

                * Open Xcode (see Step 2.2 above).
                * Select menu item Xcode, option Preferences.
                * Click on Downloads tab on top.
                * Click on Install button next to Command Line Tools.


it may not be right or clear enough.  I think you need to download the command-line
tools separately in some cases --- depends on how old the Xcode is that you're
using.

(And by the way, this kind of thing where instructions go stale is the
main reason not to ever break backward compatibility unless absolutely
necessary!  It just frustrates users to no end.)

>  Jiqang gave me
> instructions here but I think they are specific to my system so there's no
> way I could fix the instructions on this point.

They are not specific to your particular machine, but specific to older
versions of the Mac OS X.  So whatever you did should work for others.

> If it were only 1 and 2, I'd do it myself once I can get back on to the
> wiki.  But since step 3 was needed anyway, I thought it would make sense
> for Jiqiang to do all of the changes.

Doesn't matter to me who does them.  I'm making an issue to add better
instructions to the CmdStan manual, which is actually behind where the
RStan instructions are at.

- Bob

Bob Carpenter

unread,
Jul 11, 2014, 12:20:11 AM7/11/14
to stan...@googlegroups.com

On Jul 10, 2014, at 6:01 PM, Jiqiang Guo <guo...@gmail.com> wrote:

> Anyway, I made some effort to update
>
> https://github.com/stan-dev/rstan/wiki/RStan-Mac-OS-X-Prerequisite-Installation-Instructions
>
> There might be issues with them, but I cannot test any of them. Main changes are
>
> 1. For Mavericks, I made changes on how to get Xcode app installed. I don't know if it is needed to install the command line tools in this case (installing command line tools wasn't in the instruction previously). Now I even don't know how my command lines tools was installed.
>
> 2. For old versions of Mac OS X, I added how to check if there is command line tools installed and I changed to install the command line tools by downloading from the developer website.
>
> Feel free to make it more clear. But I think stuff from Apple gets changed too frequently.

How about we just stick to the command line on Linux?

Every other piece of the puzzle changes too quickly
and there are dependencies among R (especially config), Rcpp,
and C++ compiler. (file under "Why I hate dependencies")

The main problem for Macs is that the most recent Xcode doesn't
work for older OSes. And that they keep changing the way Xcode
is installed. (file under "Why I hate GUIs")

The main problem for Windows is that almost none of the C++
tools work as well as on other platforms, the paths are quirky
and not fully supported by R/Rcpp, and installs of Cygwin mess with
Rtools.

The main problem for R is that the config is global and gets mucked
about by other programs. The main problem with Rcpp is that it
depends on all the C++ and R business.

I haven't been following issues with Python, but I understand
the 2.x vs. 3 versions still have issues with compatibility and
that not everyone's going to play nicely with C++11.

Practically speaking for the Mac, I think what we need is instructions
on how to install an appropriate Xcode and command-line tools for each
version of the Mac OS we want to support. We can just drop support
for older versions (like the computer Andrew was trying to use) at some
point if it gets to be too much hassle. We've done that with R.

So we don't make people update their computer OS, but we do make
them update their C++ tools, their R version, and their Rcpp version.

- Bob
Reply all
Reply to author
Forward
0 new messages