Cmdstanr error: *** No rule to make target

Operating System: x86_64-w64-mingw32/x64 (64-bit), Windows 10 x64 (build 17134)
Interface Version: cmdstanr_0.0.0.9000
Compiler/Toolkit: Rtools 3.5

I am trying to compile a model with cmdstanr and am getting the error

mingw32-make.exe: *** No rule to make target ‘C:/Users/gubi/[…]/sim/test.exe’. Stop.
Error in processx::run(command = make_cmd(), args = c(exe, include_paths), :
System command error

I can compile the same model with Rstan, so the model should be OK.
Looking through other posts here on discourse suggest that the make flags could be the problem, but I didn’t manage to set the make flags for cmdstanr successfully.

My file, which I think is used by Rstan but not cmdstanr, has the following content:

CXX14FLAGS=-O3 -mtune=native -Wno-unused-variable -Wno-unused-function -fPIC
CXX11FLAGS=-O3 -mtune=native
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y

Does the solution to my problem involve submitting these flage to cmdstanr?

I tried by putting the lines into quotes and submitting them as an argument to compiler_flags, but this did not work.

Any hint/help is appreciated.


Hi Guido,

a few question to understand the issue a bit better:

  • are you able to compile any other models on this system or is this a specific model problem?
  • does the model include other files or anything like that?
  • does the path to the model or the path to cmdstan have any spaces in them?

Looking at your flags quickly I dont see any flag that would be the reason behind this.

Hi Rok,

  • I cannot compile any other model with cmdstanr (I tried the example from cmdstanr’s Getting started to be sure)
  • the model does not include other files or anything like that
  • the path has spaces (not my choice …) but temporarily moving the stan file to a location without spaces in the path does not result in successful compilation.


PS: I could previously use cmdstanr on the system, so I really don’t understand why it does not work anymore. I can also check with the local IT department and ask if they have changed rights/permissions.

Is it possible that you moved the location of cmdstan and did not update the cmdstan path?

Maybe try running set_cmdstan_path() anyways

Otherwise you could go in the cmdstan folder, open the windows command line and try running:
mingw32-make.exe path_to_the_model/model.exe

The path should not include spaces in this case. This is a limitation of the make system so spaces in path are an issue for Cmdstan also but can be circumvented in cmdstanr. We will address this issue shortly.

1 Like

It turns out the spaces were the problem.
Thanks for your help!

1 Like