I’m a reasonably experienced user of pystan but to resolve some compatibility issues I’m trying to switch some of my work over to cmdstan.
I’ve built all the submodules and run the tests with the “test-all.sh” script without any issues, however upon trying to run the bernoulli example I’m receiving an error.
I run:
make examples/bernoulli/bernoulli
from the cmdstan base directory and receive an error from (I think?) gcc:
cc1plus: fatal error: -pch: No such file or directory
This occurs during linking the c++ model, at which point the compilation is terminated.
Any advice on how to troubleshoot this would be appreciated - I’ve had a quick search but have found nothing helpful so far.
This is a makefile bug. @seantalts@syclik just pinging you so you see this.
clang++ uses the -include-pch flag but g++ just includes precompiled headers automatically if they are in the same directory as the original header. So here g++ is interpreting -include-pch as the -include flag with -pch as the value so it can’t find the file called -pch.
For Daniel and Sean: This would all be much easier to resolve if we didn’t have to have pull so much makefile magic from the math lib. Could we just make separate makefiles for CmdStan and only pull the really generic ones from the math lib like identifying compiler and os?
I recently intentionally refactored the makefiles to share more code and settings because there was a ton of duplication. Maybe I went too far, though I don’t think this bug speaks to that question in either direction as its just in the CmdStan makefile and doesn’t have anything to do with the Stan or Math repo makefiles the CmdStan repo includes.
I think this was the cause of it. It was the right thing to do… I don’t think we realized how far-reaching the effects would be. I’ll take action to walk through the makefiles before releasing the next CmdStan version. Hopefully this week.
I haven’t had a chance to test that it works. I think for these makefile fixes, we should be making sure it compiles against Win, Mac, and Linux. I know we have all three at Columbia, so I’ll try running it there before approving.
If you don’t mind editing the makefiles you can find the -include-pch flag in there and remove it (and whatever was getting included like that). Or you can clone cmdstan develop which (I think) has this fixed.
I get the same error with a fresh install of cmdstan 2.17.1. See attached dump of the command line output (I’m on Windows…). Is this a bug on my machine? Any idea on how I can fix it?