Errors when using cmdstan_model()

I am a windows R user and I have successully install/library ‘cmdstanr’. Then I download cmdstan and set cmdstan_path to the folder ‘cmdstan-2.23.0’. But when I ran cmdstan_model(), there is an error message:

pool_model <- cmdstan_model(stan_file=‘pool_sens_spec.stan’)
Compiling Stan program…
‘cut’ is not recognized as an internal or external command,
operable program or batch file.
‘cut’ is not recognized as an internal or external command,
operable program or batch file.
INFO: Could not find files for the given pattern(s).
process_begin: CreateProcess(NULL, cp bin/windows-stanc bin/stanc.exe, …) failed.
make (e=2): The system cannot find the file specified.
mingw32-make.exe: *** [bin/stanc.exe] Error 2
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error

Expected behavior
I expected to reproduce the same result as one of the recent coronavirus studies using cmdstanr: https://github.com/stan-dev/example-models/blob/master/jupyter/covid-inf-rate/SantaClara_CmdStanR.ipynb

Operating system
Windows 10

CmdStanR version number
‘0.0.0.9000’

Additional context

  1. The folder ‘cmdstan-2.23.0’ is inside the folder where I set as my R working directory.
  2. when I try system (wget “www…”) it said I don’t have wget in my computer so instead I use wget() function in ‘HelpersMG’ package. Not sure whether this will have any effect on this error.

Hi,

a couple questions before I give more advice:

  • what version of R and RTools do you have installed?
  • if you run “g++ --version” in the comand line what does it return?

Hi,

  1. g++ (Rev5, Built by MSYS2 project) 5.3.0
    Copyright © 2015 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  2. I am using Rstudio 1.2.1335 based on R version 3.6.1 (2019-07-05).

Sorry I am not a command-line user so I am really confused about the error message. Also I am not sure whether my replacement of system(wget, “www…”) by wget() will alright or I need to first figure out why I cannot use system(wget, “www…”) due to the error message ‘‘wget’ not found’.

Another quick follow-up is that it seems that I didn’t get the RTools installed in my computer since I typed in the folllowing code:

rtools_path()
WARNING: Rtools is required to build R packages, but is not currently installed.

Please download and install Rtools custom from https://cran.r-project.org/bin/windows/Rtools/.
Error in get(name, envir = cache) : object ‘rtools_path’ not found

Hi,

I just finished installing Rtools based on the suggestion of Rstan using: pkgbuild::has_build_tools(debug = TRUE)

Then when I rerun the code, the error becomes:

pool_model <- cmdstan_model(stan_file=‘pool_sens_spec.stan’)
Compiling Stan program…
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
g++.exe: error: stan/lib/stan_math/lib/tbb/tbb.dll: No such file or directory
mingw32-make.exe: *** [C:/Users/SIQUAN~1/AppData/Local/Temp/RtmpkXXTy7/model-17247038ca2.exe] Error 1
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error

Actually when I ran the same code twice, it seems that the error messages are different(Error 1 vs Error 2):

pool_model <- cmdstan_model(stan_file=‘pool_sens_spec.stan’)
Compiling Stan program…
INFO: Could not find files for the given pattern(s).
process_begin: CreateProcess(NULL, chmod +x bin/stanc.exe, …) failed.
make (e=2): The system cannot find the file specified.
mingw32-make.exe: *** [bin/stanc.exe] Error 2
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error

pool_model <- cmdstan_model(stan_file=‘pool_sens_spec.stan’)
Compiling Stan program…
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
g++.exe: error: stan/lib/stan_math/lib/tbb/tbb.dll: No such file or directory
mingw32-make.exe: *** [C:/Users/SIQUAN~1/AppData/Local/Temp/RtmpG00xBe/model-3500df55aca.exe] Error 1
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error

Hi,

May I ask that is there any follow-up suggestions on how to fix this problem?

Best,
Siquan

Sorry you’re still getting an error. Unfortunately I know nothing about Windows. @rok_cesnovar or other Windows people, any ideas what’s going wrong here?

if I understand you, you’re running on a windows machine, but you tried to install the CmdStan binaries in the example notebook, i.e., you tried to run this cell:

# Install CmdStan binaries
if (!file.exists("cmdstan-2.23.0.tar.gz")) {
  system("wget https://github.com/stan-dev/cmdstan/releases/download/v2.23.0/colab-cmdstan-2.23.0.tar.gz", intern=T)
  system("tar zxf colab-cmdstan-2.23.0.tar.gz", intern=T)
}
list.files("cmdstan-2.23.0")

that is the problem - these binaries will only work on a linux (debian) install.
on a Windows machine, you’ll need to run the install_cmdstan() function - see https://mc-stan.org/cmdstanr/articles/cmdstanr.html#installing-cmdstan

I will update the notebooks to make this clear.

Hi,

Yes indeed I have encountered some problems in running:

if (!file.exists(“cmdstan-2.23.0.tar.gz”)) {
system(“wget https://github.com/stan-dev/cmdstan/releases/download/v2.23.0/colab-cmdstan-2.23.0.tar.gz”, intern=T)
system(“tar zxf colab-cmdstan-2.23.0.tar.gz”, intern=T)
}

Since my computer does not recognize the Windows command ‘wget’, however I changed it as following and I believe I have successfully downloaded cmdstan:

library(HelpersMG)
if (!file.exists(“cmdstan-2.23.0.tar.gz”)) {
wget(“https://github.com/stan-dev/cmdstan/releases/download/v2.23.0/colab-cmdstan-2.23.0.tar.gz”)
system(“tar zxf colab-cmdstan-2.23.0.tar.gz”, intern=T)
}

because I have:

cmdstan_version()
[1] “2.23.0”

But when I tried to run the example code the error is still as following (there are Error 1 and Error 2):

pool_model <- cmdstan_model(stan_file=‘pool_sens_spec.stan’)
Compiling Stan program…
INFO: Could not find files for the given pattern(s).
process_begin: CreateProcess(NULL, chmod +x bin/stanc.exe, …) failed.
make (e=2): The system cannot find the file specified.
mingw32-make.exe: *** [bin/stanc.exe] Error 2
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error

pool_model <- cmdstan_model(stan_file=‘pool_sens_spec.stan’)
Compiling Stan program…
INFO: Could not find files for the given pattern(s).
INFO: Could not find files for the given pattern(s).
g++.exe: error: stan/lib/stan_math/lib/tbb/tbb.dll: No such file or directory
mingw32-make.exe: *** [C:/Users/SIQUAN~1/AppData/Local/Temp/RtmpG00xBe/model-3500df55aca.exe] Error 1
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error

Is the question still related to incorrectly installed cmdstan?

yes, is it the same problem.

the code in the Colab notebook is only for running on Colab
when you are running on Windows, you need to install cmdstan via the install_cmdstan() command.
it’s possible that CmdStanR is confused because the binaries for linux are present, and so it won’t do a clean re-install. please try this:

  • first remove the folder that you downloaded/installed via wget.
  • then run CmdStanR’s “install_cmdstan()” function
1 Like

Thanks so much for your kindly reply!

However when I removed the folder I downloaded via wget and then ran install_cmdstan(), the following error messgae showed up:

install_cmdstan()

  • Latest CmdStan release is v2.23.0
  • Installing CmdStan v2.23.0 in C:/Users/Siquan Wang/Documents/.cmdstanr
  • Downloading cmdstan-2.23.0.tar.gz from GitHub…
  • Download complete
  • Unpacking archive…
  • Building CmdStan binaries…
    INFO: Could not find files for the given pattern(s).
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT src/cmdstan/stanc.o -M -E -MG -MP -MF src/cmdstan/stanc.d src/cmdstan/stanc.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/ast_def.o -MT stan/src/stan/lang/ast_def.d -M -E -MG -MP -MF stan/src/stan/lang/ast_def.d stan/src/stan/lang/ast_def.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/semantic_actions_def.o -MT stan/src/stan/lang/grammars/semantic_actions_def.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/semantic_actions_def.d stan/src/stan/lang/grammars/semantic_actions_def.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/program_grammar_inst.o -MT stan/src/stan/lang/grammars/program_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/program_grammar_inst.d stan/src/stan/lang/grammars/program_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/expression_grammar_inst.o -MT stan/src/stan/lang/grammars/expression_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/expression_grammar_inst.d stan/src/stan/lang/grammars/expression_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/statement_grammar_inst.o -MT stan/src/stan/lang/grammars/statement_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/statement_grammar_inst.d stan/src/stan/lang/grammars/statement_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/expression07_grammar_inst.o -MT stan/src/stan/lang/grammars/expression07_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/expression07_grammar_inst.d stan/src/stan/lang/grammars/expression07_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/statement_2_grammar_inst.o -MT stan/src/stan/lang/grammars/statement_2_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/statement_2_grammar_inst.d stan/src/stan/lang/grammars/statement_2_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/block_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d stan/src/stan/lang/grammars/block_var_decls_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/indexes_grammar_inst.o -MT stan/src/stan/lang/grammars/indexes_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/indexes_grammar_inst.d stan/src/stan/lang/grammars/indexes_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/local_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/local_var_decls_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/local_var_decls_grammar_inst.d stan/src/stan/lang/grammars/local_var_decls_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/whitespace_grammar_inst.o -MT stan/src/stan/lang/grammars/whitespace_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/whitespace_grammar_inst.d stan/src/stan/lang/grammars/whitespace_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/bare_type_grammar_inst.o -MT stan/src/stan/lang/grammars/bare_type_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/bare_type_grammar_inst.d stan/src/stan/lang/grammars/bare_type_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/term_grammar_inst.o -MT stan/src/stan/lang/grammars/term_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/term_grammar_inst.d stan/src/stan/lang/grammars/term_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/functions_grammar_inst.o -MT stan/src/stan/lang/grammars/functions_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/functions_grammar_inst.d stan/src/stan/lang/grammars/functions_grammar_inst.cpp
    INFO: Could not find files for the given pattern(s).
    cp bin/windows-stanc bin/stanc.exe
    chmod +x bin/stanc.exe
    make/stanc:61: recipe for target ‘bin/stanc.exe’ failed
    process_begin: CreateProcess(NULL, chmod +x bin/stanc.exe, …) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make.exe: *** [bin/stanc.exe] Error 2
    mingw32-make.exe: *** Waiting for unfinished jobs…
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -o bin/cmdstan/stansummary.o src/cmdstan/stansummary.cpp

Warning message:
There was a problem during installation. See the error message(s) above.

I am not sure why this error would happen and could you give me some advice on how to fix it?

Thx!

1 Like

pinging @rok_cesnovar to look at the output from failed instal_cmdstan() call.
not sure what’s going on.

@Siquan-Wang - what version of Windows do you have? and R?

Hi,

I am using Windows 10 pro (64bit) on Lenovo P71 and my R version is “R version 3.6.1 (2019-07-05)”.

Thx!

This is the same issue as here: https://github.com/stan-dev/cmdstan/issues/873

Please read through this issue.

2 Likes

Hi,

I repeated the same procedure but it seems that the error is still there (sorry to copy and paste the long output again):

library(cmdstanr)
This is cmdstanr version 0.0.0.9000

  • Online documentation and vignettes at mc-stan.org/cmdstanr
  • CmdStan path set to: C:/Users/Siquan Wang/Documents/.cmdstanr/cmdstan
  • Use set_cmdstan_path() to change the path

install_cmdstan(overwrite=TRUE)

  • Removing the existing installation of CmdStan…
  • Latest CmdStan release is v2.23.0
  • Installing CmdStan v2.23.0 in C:/Users/Siquan Wang/Documents/.cmdstanr
  • Downloading cmdstan-2.23.0.tar.gz from GitHub…
  • Download complete
  • Unpacking archive…
  • Building CmdStan binaries…
    INFO: Could not find files for the given pattern(s).
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT src/cmdstan/stanc.o -M -E -MG -MP -MF src/cmdstan/stanc.d src/cmdstan/stanc.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/ast_def.o -MT stan/src/stan/lang/ast_def.d -M -E -MG -MP -MF stan/src/stan/lang/ast_def.d stan/src/stan/lang/ast_def.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/semantic_actions_def.o -MT stan/src/stan/lang/grammars/semantic_actions_def.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/semantic_actions_def.d stan/src/stan/lang/grammars/semantic_actions_def.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/program_grammar_inst.o -MT stan/src/stan/lang/grammars/program_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/program_grammar_inst.d stan/src/stan/lang/grammars/program_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/expression_grammar_inst.o -MT stan/src/stan/lang/grammars/expression_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/expression_grammar_inst.d stan/src/stan/lang/grammars/expression_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/statement_grammar_inst.o -MT stan/src/stan/lang/grammars/statement_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/statement_grammar_inst.d stan/src/stan/lang/grammars/statement_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/expression07_grammar_inst.o -MT stan/src/stan/lang/grammars/expression07_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/expression07_grammar_inst.d stan/src/stan/lang/grammars/expression07_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/statement_2_grammar_inst.o -MT stan/src/stan/lang/grammars/statement_2_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/statement_2_grammar_inst.d stan/src/stan/lang/grammars/statement_2_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/block_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/block_var_decls_grammar_inst.d stan/src/stan/lang/grammars/block_var_decls_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/indexes_grammar_inst.o -MT stan/src/stan/lang/grammars/indexes_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/indexes_grammar_inst.d stan/src/stan/lang/grammars/indexes_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/local_var_decls_grammar_inst.o -MT stan/src/stan/lang/grammars/local_var_decls_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/local_var_decls_grammar_inst.d stan/src/stan/lang/grammars/local_var_decls_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/whitespace_grammar_inst.o -MT stan/src/stan/lang/grammars/whitespace_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/whitespace_grammar_inst.d stan/src/stan/lang/grammars/whitespace_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/bare_type_grammar_inst.o -MT stan/src/stan/lang/grammars/bare_type_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/bare_type_grammar_inst.d stan/src/stan/lang/grammars/bare_type_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/term_grammar_inst.o -MT stan/src/stan/lang/grammars/term_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/term_grammar_inst.d stan/src/stan/lang/grammars/term_grammar_inst.cpp
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -MT bin/cmdstan/lang/grammars/functions_grammar_inst.o -MT stan/src/stan/lang/grammars/functions_grammar_inst.d -M -E -MG -MP -MF stan/src/stan/lang/grammars/functions_grammar_inst.d stan/src/stan/lang/grammars/functions_grammar_inst.cpp
    INFO: Could not find files for the given pattern(s).
    cp bin/windows-stanc bin/stanc.exe
    chmod +x bin/stanc.exe
    make/stanc:61: recipe for target ‘bin/stanc.exe’ failed
    process_begin: CreateProcess(NULL, chmod +x bin/stanc.exe, …) failed.
    make (e=2): The system cannot find the file specified.
    mingw32-make.exe: *** [bin/stanc.exe] Error 2
    mingw32-make.exe: *** Waiting for unfinished jobs…
    g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -o bin/cmdstan/stansummary.o src/cmdstan/stansummary.cpp

Warning message:
There was a problem during installation. See the error message(s) above.

file.copy(file.path(cmdstanr::cmdstan_default_path(),“bin”,“windows-stanc”), file.path(cmdstanr::cmdstan_default_path(),“bin”,“stanc.exe”))
[1] FALSE
processx::run(“mingw32-make”, c(“build”,"-j4"), wd=cmdstanr::cmdstan_default_path(), echo = TRUE)
INFO: Could not find files for the given pattern(s).
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -Wl,-L,“C:/Users/Siquan Wang/Documents/.cmdstanr/cmdstan/stan/lib/stan_math/lib/tbb” -Wl,-rpath,“C:/Users/Siquan Wang/Documents/.cmdstanr/cmdstan/stan/lib/stan_math/lib/tbb” bin/cmdstan/stansummary.o -static-libgcc -static-libstdc++ -o bin/stansummary.exe
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -o bin/cmdstan/print.o src/cmdstan/print.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -I stan/lib/stan_math/lib/tbb_2019_U8/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.3 -I stan/lib/stan_math/lib/boost_1.72.0 -I stan/lib/stan_math/lib/sundials_5.2.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -c -o bin/cmdstan/diagnose.o src/cmdstan/diagnose.cpp
g++ -pipe -m64 -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_5.2.0/include -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -c -x c -include stan/lib/stan_math/lib/sundials_5.2.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.2.0/src/nvector/serial/nvector_serial.c -o stan/lib/stan_math/lib/sundials_5.2.0/src/nvector/serial/nvector_serial.o
C:/Users/Siquan Wang/Anaconda3/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find C:/Users/Siquan: No such file or directory
C:/Users/Siquan Wang/Anaconda3/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find Wang/Anaconda3/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/lib/…/lib/default-manifest.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
make/command:11: recipe for target ‘bin/stansummary.exe’ failed
mingw32-make: *** [bin/stansummary.exe] Error 1
mingw32-make: *** Waiting for unfinished jobs…
Error in processx::run(“mingw32-make”, c(“build”, “-j4”), wd = cmdstanr::cmdstan_default_path(), :
System command error

Then I restarted R and ran the sample code it seems still not working properly:

library(cmdstanr)
This is cmdstanr version 0.0.0.9000

  • Online documentation and vignettes at mc-stan.org/cmdstanr
  • CmdStan path set to: C:/Users/Siquan Wang/Documents/.cmdstanr/cmdstan
  • Use set_cmdstan_path() to change the path

file <- file.path(cmdstan_path(), “examples”, “bernoulli”, “bernoulli.stan”)
mod <- cmdstan_model(file)
Compiling Stan program…
C:/Users/Siquan Wang/Anaconda3/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find C:/Users/Siquan: No such file or directory
C:/Users/Siquan Wang/Anaconda3/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find Wang/Anaconda3/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/lib/…/lib/default-manifest.o: No such file or directory
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [C:/Users/SIQUAN~1/AppData/Local/Temp/Rtmp0qJ61a/model-466036a38cc.exe] Error 1
Error in processx::run(command = make_cmd(), args = c(tmp_exe, include_paths, :
System command error
data_list <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1))
fit <- mod$sample(

  • data = data_list,
  • seed = 123,
  • num_chains = 2,
  • num_cores = 2
  • )
    Error: object ‘mod’ not found

Thx!

is this a space in the path name problem? (C:/Users/Siquan Wang/)?

update: answer no.

Hi,

I am not sure but the space in the path name seems to be okay for all the other programs since I used this laptop 3 years ago. I am trying to change the folder name but it is far more complicated than I expected, still trying…

I think the problem is the use of Anaconda for mingw32. We advise the use of RTools.

If possible please remove C:/Users/Siquan Wang/Anaconda3/Library/mingw-w64/bin/ from your environment variables (tutorial on how to do that: https://www.architectryan.com/2018/08/31/how-to-change-environment-variables-on-windows-10/).

Then please install RTools 3.5 and make sure to tick the box to update the PATH environment variable.

Hi,

I just deleted the C:/Users/Siquan Wang/Anaconda3/Library/mingw-w64/bin/ from my environment variables and I found the RTools 3.5 has already been added to the path when I installed rstan as following:

Before

After

However, after restarting the computer this time the error message becomes:

library(cmdstanr)
This is cmdstanr version 0.0.0.9000

  • Online documentation and vignettes at mc-stan.org/cmdstanr
  • CmdStan path set to: C:/Users/Siquan Wang/Documents/.cmdstanr/cmdstan
  • Use set_cmdstan_path() to change the path

install_cmdstan(overwrite=TRUE)

  • Removing the existing installation of CmdStan…
  • Latest CmdStan release is v2.23.0
  • Installing CmdStan v2.23.0 in C:/Users/Siquan Wang/Documents/.cmdstanr
  • Downloading cmdstan-2.23.0.tar.gz from GitHub…
  • Download complete
  • Unpacking archive…
  • Building CmdStan binaries…
    Error in rethrow_call(c_processx_exec, command, c(command, args), stdin, :
    Command not found @win/processx.c:977

file.copy(file.path(cmdstanr::cmdstan_default_path(),“bin”,“windows-stanc”), file.path(cmdstanr::cmdstan_default_path(),“bin”,“stanc.exe”))
[1] TRUE
processx::run(“mingw32-make”, c(“build”,"-j4"), wd=cmdstanr::cmdstan_default_path(), echo = TRUE)
Error in rethrow_call(c_processx_exec, command, c(command, args), stdin, :
Command not found @win/processx.c:977
file <- file.path(cmdstan_path(), “examples”, “bernoulli”, “bernoulli.stan”)
mod <- cmdstan_model(file)
Compiling Stan program…
Error in rethrow_call(c_processx_exec, command, c(command, args), stdin, :
Command not found @win/processx.c:977

Sorry for the confusion and I really appreciate for your help!