the problem here means that it cant find the command it is trying to run. In install_cmdstan() the only command we run is bash. We use bash to run the install script.
Unfortunately bash is not natively found on Windows, but it is part of Git for Windows for instance. This means that in order for install cmdstan to work on Windows you need to install Git for Windows (https://git-scm.com/download/win).
After installing please open the command line and try to run
If both run succesfully you are all set. The latter one should work for you already as that one comes with RTools. If not, then you will probably need to add C:\Program Files (x86)\Git\bin to the PATH variable. If you need helping doing that please let me know.
Thanks for discovering this! Everyone that tried cmdstanr on Windows, including myself, probably had either Git installed and in their PATH or some other version of bash from one of the other sources.
Unfortuantely, I am still having the problem that on the system I am working I am not not allowed to execute the executables that were generated (stanc.exe, diagnose.exe, stansummary.exe, print.exe). I have contacted my local IT support to solve this problem locally.
I know nothing about installation or rights management on windows. But, would it be possible to install cmdstanr in a way its executables are not automatically blocked by a restrictive rights management?
Yes, I knew this was a permission problem.
The thing is that at the place were I work users do not have rights to change permissions*.
In fact, I just got feedback from the IT-support they don’t want to give me permissions to use these .exe files, which means that I won’t be able to use cmdstanr if I can’t convince them otherwise.
I am not sure how common it is to have such a restrictive IT setup as at my working place. But If this is not so uncommon, it might worth it to see if there is a way to install cmdstanr more like a typical R package (i.e. without that .exe files are generated during installation.)
IT rights are generally very restrictive due to the type of data we are working with.
unzip the file into your document folder or desktop folder or something like that and run mingw32-make build in the unzipped folder
run mingw32-make examples/bernoulli/bernoulli.exe at the same location
move to the examples/bernoulli folder and run bernoulli.exe with bernoulli.exe help
If you can get that to run then it was just a problem that cmdstan was initially installed to the C:/Users/username folder and the permissions set there were too restrictive. You can then use cmdstanr by simply pointing to this new location with set_cmdstan_path().
If you are also unable to run this bernoulli.exe then I am afraid that you will not be able to use cmdstanr on this system. Cmdstanr is envisioned as a lightweight wrapper for cmdstan which is essentially these exe files.
My IT support finally informed me that I am allowed to run .exe files from C:/Rtools.
I assume that will be similar on other systems with very restrictive rights management. So maybe one could add the Rtools folder as an optional target folder for the installation of cmndstan through cmdstanr? (or just point to this possibility in the documentation)
If anyone (after the new release of cmdstanr) is getting errors like the above, ` Error in rethrow_call(c_processx_exec, command, c(command, args), stdin, : Command not found @win/processx.c:977', and followed the information below here, I can recommend also adding Rtools\bin to your path, rather than just Rtools/mingw_64\bin otherwise you run into errors with ‘stanc’ (namely, make/stanc:61: recipe for target 'bin/stanc.exe' failed). Spent a while playing with this today and hoped it might help someone!
I’m getting a similar error on Windows 10, R-4.0.2, and rtools40:
This is cmdstanr version 0.1.0
- Online documentation and vignettes at mc-stan.org/cmdstanr
- CmdStan path set to: C:/Users/kmatsuu/home/.cmdstanr/cmdstan-2.24.0
- Use set_cmdstan_path() to change the path
> file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")
> mod <- cmdstan_model(file)
Compiling Stan program...
rethrow_call(c_processx_exec, command, c(command, args), stdin, でエラー:
Command 'mingw32-make.exe' not found @win/processx.c:994 (processx_exec)
Type .Last.error.trace to see where the error occured
I have already added C:\rtools40\mingw64\bin to PATH. But I haven’t added C:\rtools40\bin to PATH because the folder doesn’t exist. Also, the file mingw32-make.exe does not exist in C:\rtools40\mingw64\bin and C:\rtools40\usr\bin (see attachment). In addition, the BINPREF in C:\Program Files\R\R-4.0.2\etc\x64\Makeconf seems to be set correctly as well. What should I do?
I faced the exactly the same situation to @MatsuuraKentaro (i.e. Command 'mingw32-make.exe' not found and mingw32-make.exe did not exist anywhere). Although I tried running pacman -Sy mingw-w64-x86_64-make on bash, bash only threw an error: bash: pacman: command not found…
When I executed the command on Rtools bash (msys2.exe), pacman always failed to install mingw32-make, too.
Is there any way to install mingw32-makewithout using pacman? Any kind of suggestions are welcomed.