[R-SIG-Mac] C++ and Mavericks

Prof Brian Ripley ripley at stats.ox.ac.uk
Sun Oct 27 08:06:23 CET 2013


It was not clear from any of the documentation that Xcode 5.0.1 for 10.8 
and for 10.9 use (by default) essentially separate C++ toolchains.

Both are based on clang++ "3.3svn" which is Apple parlance for 'some 
version less than 3.3 and lacking some 3.2 features'.  But they have 
different headers and C++ libraries.

- 10.8 is using those from g++ 4.2.1
- 10.9 is using those from libcxx.

This means that they are not completely ABI-compatible, and any package 
with C++ linkage (e.g. packages rgdal and rzmq) may need the external 
software recompiled. [NB: clang++ vs g++ were ABI compatible in 10.8. 
And 'may' not 'will'.]

10.9 contains a back-compatibility libstdc++, and most binary packages 
using C++ still work.  However, at least for me JAGS (and hence packages 
rjags and runjags) and BioC package mzR segfault.  I successfully 
re-compiled JAGS and rjags from their sources, but mzR will not compile.

There are about 35 C++-based CRAN packages which do not compile using 
clang++ plus libcxx.  The usual issues: g++ headers include other 
headers not required by the standards which other implementations do 
not, g++ uses 'tr1' for headers where libcxx does not, and more 
comprehensive implementations result in ambiguous matches.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-SIG-Mac mailing list