[cc-ing stan-dev]
I believe the direct answer to Scott Akenhead's query is that
you need to install Rcpp from source (why, I have no idea --- I'm
not an R expert or Rcpp expert).
Does anyone on the dev team understand all the combinatorics
of R / Mac / Rcpp / compilers to the point where we can provide
better instructions. The instructions that are there worked for
me as written no problem, so I can't even recreate the trouble our
users seem to be getting themselves into.
Can someone (preferably Ben or Jiqiang who have some chance of
getting it right) update our install instructions for RStan on
Mavericks on the wiki? We're getting lots of e-mail like this,
and it's starting to freak me out that we're going to be losing
R users who can't get through our patchwork install instructions.
I believe the issues we're having are the new ones introduced
by the interaction of Rcpp and Mavericks and the new Xcode, all
of which changed out from under us (not that this helps our
poor users struggling with installs).
Scott --- how did you figure out how to edit the .R directory?
It's trivial if you have a text editor (like emacs), but I'm curious
as to how you were trying to do it and finally managed to do it so
we can help others who don't use text editors.
Andrew had the same problem --- said he had no idea how to edit
a file starting with ".". It never even occurred to me that
this could be a point of failure, but now we know and should help
people out.
I don't have time now, but after two weeks, I'm willing to be
a guinea pig and completely rip out my C++ compilers and R installs
and start from scratch.
- Bob
On Jun 4, 2014, at 9:43 AM, Scott Akenhead <
sc...@s4s.com> wrote:
> The previous version of RStan installed on the previous version of R with zero fussing, and I did cool Bayesian models quickly. Loved it.
> But with Mac OS X 10.9.3, installing RStan has been 20 miles of bad road.
> The RStan Getting Started guide instructed me to create ~/.R/Makevars with exactly these two lines:
> CXX=g++ -arch x86_64 -ftemplate-depth-256 -stdlib=libstdc++
> CXXFLAGS="-mtune=native -O3 -Wall -pedantic -Wconversion"
> This was tricky because I had to create ~/.R and to do that I had to make Mac Finder show hidden files. That was not straightforward.
> The script proffered to do this does not work if ~/.R does not exist. Not having ~/.R was disconcerting.
> Getting Started also instructed me to install Xcode 5.1.1 in order to have a C++ compiler. Some web searching revealed the trick where you run Xcode separately to accept the Apple license. And there is something about setting “Command Line Tools” in Xcode > Downloads so that refers to Xcode 5.1.1, except that seems to be Xcode > Locations, but it looks OK.
> Next I updated Rcpp and inline. I also reinstalled R because I was starting to get nervous.
> Then I tried the Hello World script. FAIL.
> Well, it seems to run Rcpp OK, then quits at the compile stage with this message:
> Compilation argument:
> /Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file1dd173a89f7e.cpp 2> file1dd173a89f7e.cpp.err.txt
> g++ -arch x86_64 -ftemplate-depth-256 -stdlib=libstdc++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include" -fPIC "-mtune=native -O3 -Wall -pedantic -Wconversion" -c file1dd173a89f7e.cpp -o file1dd173a89f7e.o
> g++ -arch x86_64 -ftemplate-depth-256 -stdlib=libstdc++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o file1dd173a89f7e.so file1dd173a89f7e.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
> Looks like it found Makevars OK, given the references to g++. But Xcode supplies the clang compiler. I am guessing there was no g++ so the script just ended, silently.
> I seem to recall that R is compiled with clang, so now I am worrying about compatibility.
> Not that I wanted to go there, but file.show("/Library/Frameworks/R.framework/Resources/etc/Makeconf") shows CC = clang and CXX = clang++.
> Anyway, at this point I am forced to call for help.
> Do I install g++ or should I throw away ~/.R/Makevars, ignore the Hello World test, and hope RStan works with clang?
> To compile RStan, do I need g++ or is clang the right way?
>
> My previous and positive experience with Stan led me to tell everyone where I work (fisheries research) to quit using JAGS and BUGS, so please help me get back to evangelizing Stan.
>
>
> --
> 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.