October 23 2013 Last modified: February 12 2014
Warning [2014-2-12]: Most packages are now compatible with
libc++, changing to
libstdc++ may cause problems for some packages.
On 10.9, the default complier is
libc++ library. Many old c++ files may not be compatible with it. Hence some R packages cannot be complied from source. There are 2 solutions.
1. change the complier to GNU gcc complier. 2. an easier solution, but it doesn't work for all packages
First of all, install Homebrew, then install
brew install gcc47 brew install gfortran
CC=/usr/local/bin/gcc-4.7 CXX=/usr/local/bin/g++-4.7 FC=/usr/local/bin/gfortran
~/.R/Makevars and add
But it doesn’t fix all problems.
###Test if it works<
You should be able to compile R packages from source now. If the package is installed, it means that you have already changed your complier. As
libc++ fails to compile this package.
Happy R coding~