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.