Skip to content
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

mingw32-make is no longer required on Windows #1035

Closed
WardBrian opened this issue Nov 15, 2024 · 5 comments · Fixed by #1036
Closed

mingw32-make is no longer required on Windows #1035

WardBrian opened this issue Nov 15, 2024 · 5 comments · Fixed by #1036

Comments

@WardBrian
Copy link
Member

Describe the issue
As of stan-dev/cmdstan#1262, just plain old make can be used on Windows.

This code:

cmdstanr/R/utils.R

Lines 95 to 101 in b762c54

make_cmd <- function() {
if (os_is_windows() && !os_is_wsl() && (Sys.getenv("CMDSTANR_USE_RTOOLS") == "")) {
"mingw32-make.exe"
} else {
"make"
}
}

Should either be updated or should at least check $MAKE

@jgabry
Copy link
Member

jgabry commented Nov 15, 2024

So it sounds like I can just modify the function so the if clause also checks if the user has an older CmdStan installed, in which case we still need to use mingw32-make when we were using it before. So something like this:

 make_cmd <- function() { 
   if ((cmdstan_version() < "2.35.0") && os_is_windows() && !os_is_wsl() && (Sys.getenv("CMDSTANR_USE_RTOOLS") == "")) { 
     "mingw32-make.exe" 
   } else { 
     "make" 
   } 
 } 

where the only change is checking the version number too. If they have at least 2.35 then it just uses make for everyone, otherwise it does the same check as before. Does that seem right?

@WardBrian
Copy link
Member Author

Seems fine, you may also want to check $MAKE regardless of system, and just fall back to these system-specific defaults if unset

@jgabry
Copy link
Member

jgabry commented Nov 20, 2024

The reason my PR is failing is that install_cmdstan uses make before cmdstan_version() can be checked (since it hasn't been installed yet). I guess we could use two different methods of choosing the make command, one to be used inside install_cmdstan and one to use elsewhere. The difference would be that in the former we check the version number from the release URL and in the latter we can use cmdstan_version(). Doable, but I don't love that idea.

@WardBrian How are you dealing with this in CmdStanPy? Currently it looks like install_cmdstan.py still uses mingw32-make on Windows: https://github.com/stan-dev/cmdstanpy/blob/c5bcfb3164f18c68a6100dd9146721b68c34db80/cmdstanpy/install_cmdstan.py#L84

@WardBrian
Copy link
Member Author

Well, it uses whatever $MAKE is set to, or mingw32-make, which we still do install unconditionally. So in practice, things like cmdstan's conda recipe just make sure $MAKE is set, while the rest of the users are still going to be using mingw32-make for the time being.

Eventually I'd like to introduce the idea of a "minimum supported cmdstan version" for a given version of cmdstanpy, and then drop all the conditionals stuff like this can lead to

@jgabry
Copy link
Member

jgabry commented Nov 20, 2024

Well, it uses whatever $MAKE is set to, or mingw32-make, which we still do install unconditionally. So in practice, things like cmdstan's conda recipe just make sure $MAKE is set, while the rest of the users are still going to be using mingw32-make for the time being.

Oh ok, I see. I was thinking that since make is supported also on Windows now that we'd want to fall back to just make (instead of mingw32-make) if $MAKE isn't set and CmdStan >=2.35.0. But I can just do the same thing you do in CmdStanPy and it should be fine.

Eventually I'd like to introduce the idea of a "minimum supported cmdstan version" for a given version of cmdstanpy, and then drop all the conditionals stuff like this can lead to

I agree, that would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants