2

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’

私は何を間違っていますか?

4

1 に答える 1

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 >= 3.0 に対応しようとしましたが、clang と g++ の相互作用は少しトリッキーです。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 インスタンスでこれがオフになります。

于 2012-08-10T21:38:49.477 に答える