CmdStan path has not been set yet, Windows, cmdstanr 0.8

Not sure if this is a bug or intended behaviour, but a heads up to all Windows cmdstanr users who suddenly get “CmdStan path has not been set yet.” error, even when they succesfully used cmdstanr previously.

Between cmdstanr 0.7.1 and 0.8, the location where a Cmdstan installation is expected by default has changed from something like C:/Users/<YOUR-USERNAME>/Documents/.cmdstan to C:/Users/<YOUR-USERNAME>/.cmdstan (i.e. the Documents part is missing).

Moving the .cmdstan folder lets you use cmdstanr again as expected, without reinstalling.

A suggestion for @andrjohns - maybe CmdStanR should - at least for a while - search in both the old and new default locations?

Oh no, that definitely wasn’t intentional. I think it’s a side-effect from a fix for OneDrive path issues.

I’m already doing a bugfix release today, so I’ll add a fix for that as well. Thanks for the heads up!!

1 Like

I didn’t realize cmdstanr was using a different default location than cmdstanpy (we are just in the user folder, not Documents/). It doesn’t look like that is documented, either.

I think some windows configs essentially symlink the documents folder into OneDrive, so I would be sure that changing it back doesn’t just re-break those systems

It’s because the default was always in $HOME, which is in Documents on windows

$HOME is not set by the Windows operating system

No, but it is set by R

Ahhh it wasn’t even a cmdstanr or onedrive issue in the end!

The cmdstan makefile has an -include for a file in $(HOME), which breaks if there is a space in the path (at least on Windows):

-include $(HOME)/.config/stan/make.local 

This just needs to be quoted, and then all seems to work:

-include '$(HOME)'/.config/stan/make.local 
1 Like

Looks like the same include is in the Stan & Math makefiles as well

Are there not other issues actually building? I seem to recall g++ itself complaining on Windows about spaces in paths

If that’s all that’s needed, 1) that’s pretty funny and 2) that’s an awesome find!

Seems to fix things for cmdstanr at least! Was legitimately questioning my sanity when calling make in C:/cmdstan failed with errors about the onedrive folder though

1 Like

Does that include just get ignored when $HOME is unset? (e.g., outside of R?)

Yep, works just fine in the shell

1 Like

This has now been fixed in cmdstanr 0.8.1

@andrjohns should we change our makefiles to quote HOME in those places?