(I am asking here before opening an issue in case it is something trivial)
Using cmdstan master (e45ceca604c0af), the makefile does not work when there is an .r file present with the same name as the .stan file. Instead, it calls the f77 compiler for some reason.
I took a look. I can reproduce it. This is some surprising (to me) make behaviour and nothing to do with Stan. If you do,
mkdir test_make_behaviour
cd test_make_behaviour
touch foo.r
make foo
you will see:
f77 foo.r -o foo
That is, make automatically tries to compile the *.r as f77. Similar things happen with other file types. I never knew this. But it turns out that make has some implicit rules that are applied (even in this case when we have no makefile). You can see them by
make -p
We can disable implict rules by placing the empty target
# disable implicit rules
.SUFFIXES:
in the cmdstan-2.3.5/makefile. The implicit rule that causes this is indeed this one for Ratfor.
We could be more specific in cancelling the implicit rules (see here), but cancelling them all might be best.
Alternatively, if people see these weird things, they could just run