Rcpp Error with Xcode 5.0 and OSX 10.8.5 and R 3.0.2

跟風遠走 提交于 2019-11-29 11:26:10
Dirk Eddelbuettel

As I alluded to in this previous answer, you must correct the values hard-coded in the R binary provided by CRAN which was built with the old XCode which still had the g++-based compiler. You have (at least) three choices:

  1. Edit etc/Makeconf (below R's install directory) directly to correct CC and CXX to clang and clang++.

  2. Alternatively, create or edit ~/.R/Makevars similarly.

  3. Create environment variables CC and CXX with these loadings.

The long and short of it is that CC and CXX have hard-coded values from R's compile-time which no longer correspond the values on your system (using XCode 5). Eventually, R will catch up and this adjustment will be unnecessary.

The R Installation and Administration manual has more to say about which variables and which values you should use on a given architecture.

Jim M.

Since g++ is no longer included in Xcode 5, you will have to re-direct the pointers to clang. Based on @Romain Francois' answer from Error when with Xcode 5.0 and Rcpp (Command Line Tools ARE installed), you will have to create your own Makevars file in the ~/.R/ directory. Example content of Makevars would contain:

CC=clang
CXX=clang++
CFLAGS="-mtune=native -g -O2 -Wall -pedantic -Wconversion"
CXXFLAGS="-mtune=native -g -O2 -Wall -pedantic -Wconversion"
FLIBS=-lgfortran
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!