-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Error: install_cmdstan #1029
Comments
So is the difference in the paths just the slashes? I'm not a Windows user, so maybe @rok-cesnovar or @andrjohns will have an idea about why that's happening.
I assume |
Oh actually I see there’s two instances of |
Sorry, the .cmdstsan was a typo. The issue is the duplication of the cmdstan-2.35.0 directory in the path. I have not been able to figure out the issue. I'll try to take a look this weekend to see if I can find other clues. Are there any settings or other diagnostics I should check that could be informative? |
I don’t think I’ve seen this particular issue with the path before. A couple things to try if you’re not able to figure out why that’s happening:
|
Deleting .cmdstan and repeating the install function did not work, but I was able to unpack and rebuild cmdstan like you suggested. Thanks! |
I'm still not sure what the source of the problem is, but glad you got it running successfully using that workaround! |
Hi @jgabry, I also managed to make it work with the workaround. It appears that the problem is with the You can reproduce it by simply trying to untar the release manually: utils::untar(
"cmdstan-2.35.0.tar.gz",
exdir = "cmdstan-2.35.0",
extras = "--strip-components 1"
) And the reason why it is not correctly executing is that utils::untar(
"cmdstan-2.35.0.tar.gz",
exdir = "extract_dir_11",
extras = "--strip-components 1",
tar = "tar.exe"
) This last call worked for me and it is correctly passing extra options to the unzipping, which is producing the correct folder structure. So I suppose something like: utils::untar(
dest_file,
exdir = dir_cmdstan,
extras = "--strip-components 1",
tar = if (os_is_windows()) "tar.exe" else Sys.getenv("TAR")
) will do the trick. However, another workaround is just to change the |
Closes #1029 Co-Authored-By: Светомир Хитов <10660923+svethitov@users.noreply.github.com>
@svethitov Thanks for these details, super helpful! I just created #1031 using your suggestion. |
Some notes:
I think this is almost certainly some R funny business, TAR is not one of the environment variables that the operating system itself sets by default.
This is only true for relatively recent installations (circa April 2018)
Because it's BSD, I think it also might not support the I guess one question @jgabry is why doesn't |
Thanks @WardBrian.
That's a good question, I'm not sure why (I think @rok-cesnovar would know, perhaps there was a specific reason). In other words, you think we can just use utils::untar(dest_file, exdir = dir) where |
Yes -- That is what cmdstanpy does, essentially. You might need to check if this folder already exists, I'm not sure what the behavior is in that case, but the code might already be checking if the requested version is installed somewhere? |
Yeah, if the default directory is used we check that it exists and if not we create it. If they specify a custom directory we check that it exists: Lines 117 to 125 in b762c54
If we find the requested version already installed in the specified location we just throw an error and tell them to delete it or specify I went ahead and made a PR (#1034) with your suggested change, so that should test this on all the GitHub actions configurations we're using, although I don't think that includes old versions of Windows. But, if I understand correctly, for this change it shouldn't matter which version of Windows the user has. Thanks again for your help with this. |
The Github Actions environments are not always representative of a typical user, unfortunately (especially on Windows), but you're correct that one of the goals of my suggestion was to get out of R's way and let it handle the platform specifics. The real test would probably be a user like @svethitov giving that branch a try |
@svethitov and/or @brianperdomo would you by chance be able to test the fix I implemented using @WardBrian's suggestion? You can install cmdstanr from that branch using remotes::install_github("stan-dev/cmdstanr", ref = "fix-untar-install") and then just run |
Describe the bug
I'm attempting a fresh installation of cmdstanr on Windows and I get the following error:
(FYI: The overwrite is because I tried again after the first error)
I checked that path and the problem is that the actual path should be "C:\Users\brian\.cmdstsan\cmdstan-2.35.0\cmdstan-2.35.0\make\local"
I've tried to find ways to get it to point to the right directory, but I'm at a loss.
To Reproduce
cmdstan::install_cmdstan()
Expected behavior
Either the archive needs to be unpacked in a way that matches the expected cmdstan_path() without the duplication of cmdstan-2.35.0 or cmdstan_path() should point to the path with the duplicate.... probably the former makes more sense.
Operating system
Windows 11
CmdStanR version number
tried with the version 0.8.1 from CRAN and the development version from github
Additional context
R 4.4.1, Rtools44
The text was updated successfully, but these errors were encountered: