Open arranhamlet opened 1 month ago
This suggests it would be beneficial to run R CMD check
in CI on macOS and Windows as well as Ubuntu. I will create an issue.
Update, I can't reproduce the error using R 4.4.1 on my Mac.
I would have guessed this is an issue with an update of cmdstan
or cmdstanr
where we have seen issues before when cmdstan gets stricter on say an extra space. But I am using the same version of cmdstanr and @arranhamlet is using cmdstan
2.35.0
@arranhamlet @kaitejohnson I suspect this may have to do with how non-Unix-style paths are handled
Hmm yeah in R this is why we have file.path("folder", "file")
everywhere...
@arranhamlet Which version of R were you running before this broke if you remember? If it is a windows file system thing, I am surprised it ever worked!
The same version, 4.4.1, very bizzare.
This sounds like an annoying one and it also sounds like you've checked all the common sense things.
I've seen an issue like this with vscode where it has shown this error message but there is in fact no error (i.e everything runs). When I looked into it it was because cmdstan didn't like file systems with spaces in them (i.e here program files). That has since been resolved for me but perhaps it has resurfaced here?
I guess I would suggest/ask two things:
Great work resolving this!
@arranhamlet
Interesting, so the problem is that the package gets installed in Program Files
in Windows and then cmdstanr tried to include those paths in the include_paths
and it breaks... wondering what we should do re README/documentation to warn about this issue.
Also super curious why reinstalling R drove this!
Glad that got you unstuck!
wondering what we should do re README/documentation to warn about this issue.
So I think maybe this is worth pointing the cmdstan
/cmdstanr
folks at as I can imagine it coming up quite a bit in Windows and last time I checked they thought it was fixed.
@arranhamlet What was the precise solution you took? Did you reset the path that your R packages install to, or just this package? Would like to scope out an issue for cmdstanr
/cmdstan
and want to make sure I understand the solution you took.
I moved the stan files from the package located at:
"C:\Program Files\R\R-4.4.1\library\wwinference\stan" to a new folder I created "C:\R"
and then updated the function wwinference::compile_model()
to wwinference::compile_model(model_filepath = "C:/R/wwinference.stan", include_paths = "C:/R/")
Super helpful -- if you reinstall the package though, is it set up to install in C:\R
?
No, it would install it back in my default R library, which is found in "C:\Program Files\R\R-4.4.1\library".
I've not changed my library location, I just moved the stan files to above the Program Files directory to avoid the space in the name.
Hmm ok-- this is good to know as its not ideal for working off something that is in development as it will not update properly when you pull from git and reinstall.
I would think there is a way to specify that the library location is not in Program Files
, which might be a better temporary solution for anything relying on cmdstan
/ cmdstanr
...
I would think there is a way to specify that the library location is not in Program Files, which might be a better temporary solution for anything relying on cmdstan/ cmdstanr...
I think we want to avoid having this package make any assumption about where it is installed. As @seabbs says, if cmdstanr
doesn't currently play well with Windows paths containing spaces, that's something they'll want to know about and fix.
That said, perhaps time to reconsider depending on instantiate
and compiling the package models at install time.
Yes, though this feels like a v2 issue!
That said, perhaps time to reconsider depending on instantiate and compiling the package models at install time.
I think this uses cmdstanr and so will have the same error but just at install time
Depends on where instantiate
places the source files to be compiled, no? Could potentially be somewhere more robust to this behavior than the user's default R library. Agree that the long-term solution is for cmdstanr
to handle these paths!
@dylanhmorris Ok if we close this and continue discussion in #213 ?
Hi,
I'm running into some issues running the ww-inference-model in the worked example you provided on the github repo. The error occurs at the fitting stage, with the function
wwinference()
.The error is:
The file
functions/ar1.stan
is found in the include path stated, and if I change the order of the include files in the stan model, it can't see any of them, so its not just an issue with that file. I've scoured github/stackoverflow/discourse.mc-stan.org, but not found a solution.Steps I have tried:
OS: Windows 10 I'm running cmdstan version 2.35.0, and my session info is: