There are a couple of problems. I've inserted
comments below.
Users -- if you want help debugging compilation, please
please include the model as a plain text file attachment
(not embedded in R or with line numbers, etc.).
You can send to
st...@mc-stan.org if you want, but I have
to warn you that we're going to prioritize questions on
our open-access lists over proprietary communications.
One reason is that we're already drowning in complex user
models and if we take them on one-by-one off the list,
we have to deal with them one-by-one rather than hopefully
building up some group expertise so users can help each
other in the future.
More below inline.
On 10/1/12 5:55 PM, atzap wrote:
> Hi all
>
> I'm trying to fit my first STAN model and have hit a rather indecipherable wall.
> The model fails to run and throws up
> the following error (more attached):
>
>
> TRANSLATING MODEL 'anon_model' FROM Stan CODE TO C++ CODE NOW.
>
> COMPILING THE C++ CODE FOR MODEL 'anon_model' NOW.
>
> cygwin warning:
>
> MS-DOS style path detected: C:/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
>
> Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-215~1.1/etc/i386/Makeconf
If you use cygwin, you should use Unix-style paths, not
DOS-style paths. This isn't Stan-related per se and isn't fatal,
but it's why you get these warnings.
>
> file23c28003c5a.cpp: In member function 'void anon_model_namespace::anon_model::set_param_ranges()':
>
> file23c28003c5a.cpp:254:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
This is an issue we need to fix, but it's
not fatal. Actually, it won't come up in
1.0.2 because we trap and throw errors if users
try to define discrete parameters.
>
> file23c28003c5a.cpp:255:62: error: 'nil' was not declared in this scope
This is the killer. You use a variable named 'nil' without
defining it.
My guess without seeing your model is that you used an int
parameter -- that gets flagged in 1.0.2 with an error message.
Stan doesn't support int params.
> file23c28003c5a.cpp:255:62: note: suggested alternative:
>
> C:/.../R/win-library/2.15/rstan/include//stanlib/boost_1.51.0/boost/fusion/container/list/cons.hpp:37:12: note:
> 'boost::fusion::nil'
>
> file23c28003c5a.cpp:258:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>
> file23c28003c5a.cpp:259:62: error: 'nil' was not declared in this scope
>
> file23c28003c5a.cpp:259:62: note: suggested alternative:
>
> C:/.../R/win-library/2.15/rstan/include//stanlib/boost_1.51.0/boost/fusion/container/list/cons.hpp:37:12: note:
> 'boost::fusion::nil'
>
> C:/.../R/win-library/2.15/rstan/include//stansrc/stan/agrad/agrad.hpp: At global scope:
>
> C:.../R/win-library/2.15/rstan/include//stansrc/stan/agrad/agrad.hpp:2215:17: warning: 'void
> stan::agrad::free_memory()' defined but not used [-Wunused-function]
>
> C:/.../R/win-library/2.15/rstan/include//stansrc/stan/math/special_functions.hpp:591:19: warning: 'double
> stan::math::log_sum_exp(const std::vector<double>&)' defined but not used [-Wunused-function]
>
> make: *** [file23c28003c5a.o] Error 1
>
>
> ERROR(s) during compilation: source code errors or compiler configuration errors!
>
>
>
> Does anyone have any idea what this might be trying to tell me? I am using R 2.15.1 with rstan_1.0.0, RcppEigen_0.3.1,
> inline_0.3.8, and Rcpp_0.9.13 (among other packages loaded). The "schools" example runs fine. Presumably, there are
> several problems with my model (hence the warnings), but I can't figure out what the error is trying to tell me... I'm
> happy to email my model and data structure off-list.
>
> Many thanks and sorry I chose such a complicated example to begin my work with STAN!
Our advice is to always start with simpler models and build up.
This isn't just a principle for beginners using Stan, but for
any level user with any kind of software.
The alternative is to start bigger, and then trim down
until you isolate the problem, but that's relatively painful
than going the other way around.
- Bob