Great! Two things to check next, can you install the github version of cmdstanr:
devtools::install_github("stan-dev/cmdstanr")
And then run:
cmdstanr::check_cmdstan_toolchain(fix=TRUE)
Which will check that everything is configured and setup correctly. If there’s an error which the program corrects, try installing cmdstan again like before.
If not, and it says that everything is properly setup, then the next step is to check whether it works when you try to install cmdstan in a local folder (on your computer, rather than on the networked drive). This can be something like your Documents folder or somewhere on the C:/ drive, as long as it’s not on the networked drive. You can specify this install directory via:
install_cmdstan(cores=2, dir = new_install_dir_here)
hi, I have followed the steps you mentioned before, but when I run cmdstanr::check_cmdstan_toolchain(fix=TRUE)
I got this error message:
Error:
Rtools42 was not found but is required to run CmdStan with R version 4.3.1.
Please install Rtools42 and run cmdstanr::check_cmdstan_toolchain().
But I have installed Rtools 43. Both my R and Rstudio are the newest versions. Can you help me to figure this out? Many thanks!!
So I download the source code from GitHub manually, and run the code: set_cmdstan_path("D:/R-Rstudio/cmdstan-2.32.2")
It seemed successful:
CmdStan path set to: D:/R-Rstudio/cmdstan-2.32.2
But when I try to compile a model, I got error messages as follows:
Error in process_initialize(self, private, command, args, stdin, stdout, …:
! Native call to processx_exec failed
Caused by error in chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …:
! Command ‘bin/stanc.exe’ not found @win/processx.c:982 (processx_exec)
Type .Last.error to see the more details.
When I tried cmdstanr:: rebuild_cmdstan(), I got the error message
Ϣ: ṩģʽҵļ
rm -f -r test
rm -f
rm -f
rm -f
rm -f
removing dependency files
rm -f
rm -f
rm -f
mingw32-make: *** No rule to make target ‘clean-libraries’, needed by ‘clean-all’. Stop.
Ϣ: ṩģʽҵļ
mingw32-make: *** No rule to make target ‘stan/src/stan/model/model_header.hpp’, needed by ‘stan/src/stan/model/model_header.hpp.gch’. Stop.
mingw32-make: *** Waiting for unfinished jobs…
— Compiling the main object file. This might take up to a minute. —
g++ -Wno-nonnull -c -o src/cmdstan/main.o src/cmdstan/main.cpp
src/cmdstan/main.cpp:1:10: fatal error: cmdstan/command.hpp: No such file or directory
1 | #include <cmdstan/command.hpp>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
mingw32-make: *** [make/program:14: src/cmdstan/main.o] Error 1
Hi,
I try to install cmdstanr. I use your code system(“tar.exe”) and got the following result
system(“tar.exe”)
tar.exe: Must specify one of -c, -r, -t, -u, -x
[1] 1
However, when I use devtools::install_github(“stan-dev/cmdstanr”)
I found the following results
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
namespace ‘rlang’ 1.0.2 is already loaded, but >= 1.0.6 is required
Could you plz me how to solve it and install cmdstanr?
I installed cmdsstanr. However, when I try to run a model using cmdstan_model, I got the following message.
Error: CmdStan path has not been set yet. See ?set_cmdstan_path.
My guess is that you have not installed cmdstan (which is not the same thing as cmdstanr, and is required for cmdstanr to fit models). Run cmdstanr::check_cmdstan_toolchain(). If that gives you a message saying that the toolchain is set up properly, then run cmdstanr::install_cmdstan(), which should install cmdstan and set the path automatically.
If you are certain that you have previously installed cmdstan and for some reason you don’t want to reinstall it in the default location, then you need to set the cmdstan path so that cmdstanr knows where to find cmdstan. The suggestion in the error message to check out ?set_cmdstan_path is helpful.
I used your previous command cmdstanr::check_cmdstan_toolchain() and I got the following message
The C++ toolchain required for CmdStan is setup properly!
When I try to install C++, I got,
Installing package into ‘C:/Users/shah_/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘C++’ is not available for this version of R
Installing package into ‘C:/Users/shah_/AppData/Local/R/win-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘C++’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at