Rcpp error with Xcode 5.0 and OSX 10.8.5 and R 3.0.2

I'm just trying to run Rcpp on my Mac, but I'm afraid. I installed the command line tools. I installed Rcpp and built-in packages. I am trying to run the following script in R and get the following error.

fx <- cxxfunction(signature( x = "numeric" ),

  'NumericVector xx(x);

  return wrap( std::accumulate( xx.begin(), xx.end(), 0.0));',

  plugin = "Rcpp",verbose=TRUE)


Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! /bin/sh: llvm-g++-4.2: command not found
make: *** [file2e731b1c0ff8.o] Error 127

I understand that this is very similar to the question posed. But I would like more details on where to find the makevars file.

Thanks.

+4
source share
2 answers

, , R, CRAN, old XCode, g++. ( ) :

  • etc/Makeconf ( R install) , CC CXX clang clang++.

  • , ~/.R/Makevars .

  • CC CXX .

: CC CXX R, ( XCode 5). , R , .

R , .

+5

g++ Xcode 5, clang. @Romain Francois Xcode 5.0 Rcpp ( ARE), Makevars ~/.R/. Makevars :

CC=clang
CXX=clang++
CFLAGS="-mtune=native -g -O2 -Wall -pedantic -Wconversion"
CXXFLAGS="-mtune=native -g -O2 -Wall -pedantic -Wconversion"
FLIBS=-lgfortran
+3

All Articles