<div dir="ltr">I think this bit:<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>The \texttt{clang} and \texttt{clang++} compilers from the LLVM project can</div></div><div><div>

also be used as they are inter-operable with \texttt{gcc} et al.  The</div></div><div><div>\texttt{clang++} compiler is interesting as it emits much more</div></div><div><div>comprehensible error messages than \texttt{g++} (though \texttt{g++} 4.8 and 4.9</div>

</div><div><div>have caught up).</div></div></blockquote><div><br></div><div>needs to be amended. The standard library implementation used with gcc (libstdc++) is not ABI compatible with the one used with clang (libc++). This has been a common pain point for users running Snow Leopard who updated their operating system to Mavericks, and also installed Mavericks R, without re-installing any previously installed packages -- having a clang-compiled package with C++ code try to link to an older gcc-compiled package with C++ code caused many headaches for users, either with weird segfaults or errors on loading packages or (if lucky) errors at link time.<br>

</div><div><br></div><div>In addition:</div><div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px"><div><div>OS X used to be a little more conservative with compiler versions as Apple</div></div>

<div><div>stuck with gcc-4.2. Following the 'Mavericks' release, it is the opposite as</div></div><div><div>only llvm is provide in Xcode---while the R build provided by CRAN still has</div></div><div><div>hardwired settings for the gcc/g++ combination. </div>

</div><div><div><br></div></div><div><div>Until that is resolved, users either need to create softlinks (say, in,</div></div><div><div>\code{/usr/local/bin}) or override the \code{CC} and \code{CXX} variables via a</div>
</div>
<div><div>file \code{~/.R/Makevars} or its system-equivalent in R's \code{etc/}</div></div><div><div>directory. Also see \faq{q:OSXArma} below. In general, consult the</div></div><div><div>\code{r-sig-mac} mailing list for further details.</div>

</div></blockquote><div><br></div><div>There are now two separate CRAN binaries, one compiled for Snow Leopard and above (using gcc-4.2.1), and one compiled for Mavericks (using the latest clang release distributed with Mavericks). Fortunately, since R doesn't include any C++ code, one can use Snow Leopard R with clang-compiled packages containing C++ code with no problems. However, packages containing C++ code should be compiled with the same compiler suite. This is a bit of a pain point for users of Snow Leopard R who might be using clang -- the binaries distributed by CRAN are compiled with gcc-4.2 and libstdc++ (by default) and those won't be compatible with packages compiled from source with clang++ and libc++.</div>

<div><br></div><div>Professor Ripley compiled a set of recommendations in a post on R-SIG-Mac that we could link to: <a href="https://stat.ethz.ch/pipermail/r-sig-mac/2014-April/010835.html" target="_blank">https://stat.ethz.ch/pipermail/r-sig-mac/2014-April/010835.html</a></div>

<div><br></div><div>We might also link to the BioConductor guidelines for Mavericks + C++11 development: <a href="http://www.bioconductor.org/developers/how-to/mavericks-howto/" target="_blank">http://www.bioconductor.org/developers/how-to/mavericks-howto/</a>; it's a nice overview of the state of the world there.<br>
<br>The general prescription, I think:<br><br></div><div>1. If you want to mix and match CRAN binaries with packages installed from source, make sure your compiler suite matches that of the CRAN R you've installed. Otherwise, the safer route is to compile all packages from source.<br>
</div><div><br>2. If you're running OS X Mavericks (or greater), and want to compile packages from source (ostensibly using clang), use the Mavericks CRAN R binary, otherwise you will run into frustrating ABI compatibility issues (as Snow Leopard R will grab CRAN package binaries compiled with gcc 4.2; again incompatible with those compiled with clang)*.<br>
</div><div><br></div><div>I can try to amend the vignette to this effect later and submit a PR. If anyone else on the list thinks I missed something here, let me know too.<br></div><div><br></div><div>Cheers,<br>Kevin<br>
<br>*I suppose someone running Mavericks with a Snow Leopard R could set the 'pkgType' option (see ?install.packages) to grab Mavericks binaries of packages, but I doubt this is recommended.<br><br>PS: A useful utility one could write would check what C++ standard library implementation each installed package links to. Maybe I'll write that...</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 3, 2014 at 9:17 AM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I noticed a post cross-referenced on R Bloggers about Rcpp(Armadillo), OS X<br>
and the need for an additional Fortran packages from Simon's site -- so I<br>
took this as opportunity to update the OS X answers in the Rcpp FAQ vignette.<br>
<br>
As I don't use OS X, I'd appreciate a second set of eyes by anyone with a<br>
moment to spare and some mad OS X "skillz".<br>
<br>
Current Rnw file<br>
  <a href="https://github.com/RcppCore/Rcpp/blob/master/vignettes/Rcpp-FAQ.Rnw" target="_blank">https://github.com/RcppCore/Rcpp/blob/master/vignettes/Rcpp-FAQ.Rnw</a><br>
<br>
Link to the committed changes<br>
  <a href="https://github.com/RcppCore/Rcpp/commit/e892622ce1c741f47b2e43b1d44ece32d44ee239" target="_blank">https://github.com/RcppCore/Rcpp/commit/e892622ce1c741f47b2e43b1d44ece32d44ee239</a><br>
<br>
Corrections and improvements to other parts are of course welcome as well :)<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</font></span></blockquote></div><br></div>