0

I am having a lot of trouble getting Rstan to work on my OSX setup. For background info, my system is as follows:

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

Each time I run a stan model in R through R stan, I get the following error (regardless of the model I am running, so the stan code has already been checked for syntax errors)

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 
>

Other pertinent information:
I can successfully run a test program in PyStan. This seems to be a problem largely with Rstan.

Can anyone give me any clues as to how I can resolve this issue?

  • Looks like some brew stuff. If so, run `brew doctor` – Thomas Ayoub Nov 10 '15 at 14:59
  • What version of RStan are you using? It looks like you've got an incompatible Stan version inside RStan, which could happen if you're updating the Stan submodule independently of RStan. – syclik Nov 10 '15 at 15:33
  • 1
    It appears as if you have a conflict between different versions of Stan. It looks for `/usr/local/include/stan/services/mcmc/run_markov_chain.hpp` but it should only be looking for Stan-related packages in the StanHeaders package or the rstan package. Make sure you installed rstan with `dependencies = TRUE` and that your CFLAGS is correctly set in ~/.R/Makevars – Ben Goodrich Nov 10 '15 at 18:13

1 Answers1

0

First, make sure you have the latest version of Stan (currently 2.8.0) and have installed Rstan exactly as directed. Whenever I don't do that, I get into trouble!

If that doesn't/didn't work: have you tried the Stan user group? They might have more people competent to answer this question.

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