0

嗨,我正在尝试在 mac osx 上编译和运行简单的 RInside 示例。我正在使用 R 安装形式的 macports 和通过 R 安装的 RInside 以及所有库的最新版本,这是我的 R 信息

R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin11.4.0/x86_64 (64-bit)

这是我尝试编译示例的方法

 g++-mp-4.7 -I/opt/local/lib/R/library/RInside/include/
    -I/opt/local/lib/R/library/Rcpp/include/ -I/opt/local/lib/R/include/ -L/opt/local/lib/R/library/RInside/libs/ -L/opt/local/lib/R/library/Rcpp/libs/ -lRInside -lRcpp test.cpp -o test

这是我的错误

In file included from /opt/local/lib/R/library/Rcpp/include/RcppCommon.h:155:0,
                 from /opt/local/lib/R/library/Rcpp/include/Rcpp.h:27,
                 from /opt/local/lib/R/library/RInside/include/RInsideCommon.h:31,
                 from /opt/local/lib/R/library/RInside/include/RInside.h:26,
                 from thread_safe_test.cpp:5:
/opt/local/lib/R/include/R.h:34:21: fatal error: Rconfig.h: No such file or directory
compilation terminated.

有什么建议么

4

2 回答 2

1

为什么不使用r-project.org的版本并从http://r.research.att.com/tools/下载编译器等?这是我认为的首选方法。对我来说,这种方法有效。

于 2012-10-02T07:42:06.607 回答
1

我记得,你必须在 OS X 上从源代码编译 RInside。尝试 rcpp-devel 列表的档案以获取更多信息。

于 2012-10-02T14:24:43.720 回答