Please refer to this link: https://stackoverflow.com/a/19505252/1510531. After modifying the following lines in the Makeconf
file in /Library/Frameworks/R.framework/Resources/etc
:
CC=clang
CXX=clang++
CXXFLAGS= -O3 -pedantic
I can now install R source packages :)
Update
According to @asieira, the last CXXFLAGS
is not recommended, so just make the following changes:
CC=clang
CXX=clang++