[R-SIG-Mac] Trouble compiling packages under Mavericks

Andy Jacobson andy.jacobson at noaa.gov
Thu Mar 6 19:03:23 CET 2014


Howdy,

I experienced some hiccups trying to use R CMD INSTALL to compile/install packages, on Mavericks (OS X 10.9.2) with R-3.0.2 from CRAN.  I think I resolved them using a ~/.R/Makevars fix and I thought I'd report on that.

The symptom I would get is complaints about "cc1" not understanding the "-arch" argument, as in:

>  > R CMD INSTALL png_0.1-7.tar.gz 
>    
> * installing to library ‘/private/nfs/ct/lib/R-3.0/x86_64-apple-darwin10.8.0’
> * installing *source* package ‘png’ ...
> ** package ‘png’ successfully unpacked and MD5 sums checked
> ** libs
> llvm-gcc-4.2 -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I/usr/local/include    `libpng-config --cflags` -fPIC  -mtune=core2 -g -O2  -c read.c -o read.o
> cc1: error: unrecognized command line option "-arch"
> make: *** [read.o] Error 1
> ERROR: compilation failed for package ‘png’

llvm-gcc-4.2 is not the up-to-date XCode compiler.  That rather is "Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)".

Section C.3.4 ("Mavericks") of the R-admin guide suggests a "config.site" file with the following:

CC=clang
CXX=clang++
F77="gfortran-4.2 -arch x86_64"
FC=$F77
OBJC=clang

I put these definitions in my ~/.R/Makevars file and all packages compiled correctly after that.  I'm not sure this is correct.

Regards,

Andy


-- 
Andy Jacobson
andy.jacobson at noaa.gov

NOAA Earth System Research Lab
Global Monitoring Division
325 Broadway R/GMD1
Boulder, Colorado 80305

303/578-2237



More information about the R-SIG-Mac mailing list