在Mac 10.8上Rcpp安装失败

时间:2012-08-10 21:29:58

标签: r rcpp

Rcpp无法为我安装。当我在R控制台(Mac 10.8上的R 2.15.1)中运行以下内容时:

install.packages("Rcpp")

我收到以下错误:

/usr/bin/clang++ -I/usr/local/Cellar/r/2.15.1/R.framework/Resources/include \
       -DNDEBUG -I../inst/include/ -I/usr/local/Cellar/readline/6.2.4/include \
       -isystem /usr/local/include -I/opt/X11/include    -fPIC  -Os -w -pipe - \
       march=native -Qunused-arguments -mmacosx-version-min=10.8  \
       -c exceptions.cpp -o exceptions.o

exceptions.cpp:82:14: fatal error: 'bits/exception_defines.h' file not found 
#include <bits/exception_defines.h>
        ^
1 error generated.
make: *** [exceptions.o] Error 1
ERROR: compilation failed for package ‘Rcpp’

我做错了什么?

1 个答案:

答案 0 :(得分:7)

哪个版本的Rcpp?这已在SVN中修复:

2012-07-06  Dirk Eddelbuettel  <edd@debian.org>

        * inst/include/Rcpp/config.h: In order to not attempt to include
        exception_defines.h if on OS X (as the clang runtime may not have
        predictable access to g+++ headers providing these), do not define
        RCPP_HAS_DEMANGLING which is used in src/exceptions.cpp

并在rcpp-devel列表中进行了讨论。

我试图容纳OS X和clang&gt; = 3.0,但是clang和g ++的交互有点棘手。尝试抓取the file from SVN或只修改其中的部分以获得

#ifdef __GNUC__
  // from http://sourceforge.net/apps/mediawiki/predef/index.php?\  
  //              title=Operating_Systems#MacOS
  #ifndef __APPLE__ 
    #ifndef __MACH__
      #define RCPP_HAS_DEMANGLING
    #endif
  #endif
#endif

将所有OS X实例关闭。