在mac osx上进行RInside链接

时间:2012-10-02 04:09:26

标签: macos r rinside

您好我正在尝试在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.

任何建议

2 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:1)

我记得,你可能需要在OS X上从源代码编译RInside。请尝试更多rcpp-devel列表的存档。