Closed jdyen closed 5 months ago
Thanks for this report! I've done a bit of a dive here, and discovered that the issue is that rstan run on Windows has a problem with the character #
included in a comment. Very strange; not something I expected!
So on my windows machine (which I don't typically use for Stan), the following compiles fine:
parameters {
x;
}
model {
target += normal_lpdf(x | 0, 1);
}
but this fails with your error:
// # test
parameters {
x;
}
model {
target += normal_lpdf(x | 0, 1);
}
Anyhow, it's an easy fix on my end. Hopefully I can find time by end-of-day today; if not certainly by the beginning of next week. I've also reported the issue to Stan devs. I'll be interested to learn if this was known/expected behavior!
Thanks for getting onto this so quickly. I could submit a PR if you prefer but won't get a chance until next week.
Just got the pull open. I'll wait for checks before merging. Sounds like there's no rush from your end but if there is a rush for some reason (like you want to run a model over the weekend), you can grab the number-comment-fix
branch.
Fantastic. Running a test model on my MacBook right now and won't be back into this until next week. Thanks very much.
I ran into an error compiling a rep-varying model on my Windows computer. I have recreated it using the example from the
flock
help file (modified to test the rep-constant version of the model as well).The rep-constant model samples fine but the rep-varying model throws an error (example below) on Windows 10 with R 4.3.3 and rstan 2.32.6 calling Stan 2.32.2. Was also getting this same error on R 4.3.0 with Stan 2.26.? before I re-installed everything. This is my main (work) computer and I use Stan, rstan, and brms regularly without issue. I'd hoped to try cmdstanr as well but cannot get the cmdstan toolchain working on this computer.
Both the rep-varying and rep-constant models work on my macbook running OSX (macOS Big Sur 11.7.9) with R 4.3.1 and rstan 2.32.6 calling Stan 2.32.2. Also works on the macbook with cmdstanr 0.6.1 calling cmdstan 2.32.2.
The error suggests installing the V8 package. This was already installed and I've updated it and tried again without success.
I appreciate the Stan compiler errors are quite cryptic. Happy to dig further, or happy to leave this and use my macbook for this particular project.
Example