OS X上的Rstan编译错误

时间:2015-11-10 14:56:31

标签: r macos stan rstan

让Rstan在我的OSX设置上工作时遇到了很多麻烦。有关背景信息,我的系统如下:

  • OSX Yosemite v.10.10.5
  • R 3.2.1 GUI 1.66 Mavericks

每次我在R到R stan中运行stan模型时,我都会收到以下错误(无论我运行的模型是什么,所以已经检查了stan代码的语法错误)

Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! In file included from file32b7b27a829.cpp:465:
In file included from /usr/local/lib/R/3.2/site-library/rstan/include/rstan/rstaninc.hpp:3:
In file included from /usr/local/lib/R/3.2/site-library/rstan/include/rstan/stan_fit.hpp:75:
In file included from /usr/local/include/stan/services/mcmc/run_markov_chain.hpp:5:
/usr/local/include/stan/io/mcmc_writer.hpp:138:23: error: no member named 'is_recording' in 'rstan::rstan_sample_writer'
        if (!recorder.is_recording())
             ~~~~~~~~ ^
/usr/local/include/stan/io/mcmc_writer.hpp:155:9: note: in instantiation of function template specialization 'stan::io::mcmc_writer<model32b75b587019_FamaFrench_COV_estimate_namespace::model32b75b587019_FamaFrench_COV_estimate, rstan::rstan_sample_writer, stan::interface_callbacks::writer::csv, stan::interface_callbacks::writer::messages>::write_adapt_finish<rstan::rstan_sample_writer>' requested here
        write_adapt_finish(sampl
In addition: Warning message:
running command '/usr/local/Cellar/r/3.2.2_1/R.framework/Resources/bin/R CMD SHLIB file32b7b27a829.cpp 2> file32b7b27a829.cpp.err.txt' had status 1 
>

其他相关信息
可以在PyStan中成功运行测试程序。这似乎是Rstan的主要问题。

有人能告诉我如何解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

首先,请确保您拥有最新版本的Stan(目前为2.8.0),并且已完全按照指示安装了Rstan。每当我不这样做,我就会遇到麻烦!

如果没有/不起作用:您是否尝试过Stan用户组?他们可能有更多的人有能力回答这个问题。

https://groups.google.com/forum/?fromgroups#!forum/stan-users