Closed bob-carpenter closed 11 months ago
we've discussed getting rid of pch headers altogether. time to revisit this issue?
I’m in favor of removal. It’s caused too many headaches to be worth it.
On Thu, Sep 21, 2023 at 2:14 PM Mitzi Morris @.***> wrote:
we've discussed getting rid of pch headers altogether. time to revisit this issue?
— Reply to this email directly, view it on GitHub https://github.com/stan-dev/cmdstanpy/issues/702#issuecomment-1730074055, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADH6F6SLCMY57QKQQ6SEYDX3R7ZBANCNFSM6AAAAAA5B6L4CA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Disabling the precompiled headers roughly doubles the amount of time required to compile a model (see https://github.com/roualdes/bridgestan/issues/151). This problem also seems to be essentially exclusive to MacOS, I've never encountered it on Linux
We tried to fix issues like this in https://github.com/stan-dev/cmdstan/pull/1171 which was included in the 2.33 release
This problem also seems to be essentially exclusive to MacOS, I've never encountered it on Linux
I thought it was only implemented for MacOS?
update: defined in CmdStan makefile
here: https://github.com/stan-dev/cmdstan/blob/e99e0f2ac9a920624c36899817856183a13d6e3e/makefile#L121-L133
We use it on all three major platforms since 2.28
@bob-carpenter can you share the output of csp.rebuild_cmdstan(verbose=True)
?
Disabling the precompiled headers roughly doubles the amount of time required to compile a model
Thanks for linking the issue!
I'm always going to favor things that are more robust to configuration error.
Errors like this make the 2x time per compile worth it for me. Whenever I run into it and I have to spend half an hour rebuilding cmdstan to get everything back into a consistent state, it's tough. It's a hard context switch from where I'm normally at. I don't know how someone that doesn't know the infrastructure as well navigates past this problem.
Btw, I'd be happy if there were clear instructions that appear when this error occurs. I just don't think we have that yet.
Rebuilding cmdstan usually works (I'm curious what exactly is going wrong for Bob during that).
We used to try to show instructions to do so, but the message the compiler shows when the PCH is bad seems to change often and we ended up writing such a broad net that we were showing that suggestion when the PCH wasn't even the real issue.
Adding PRECOMPILED_HEADERS=false
into a make/local
file will make it never be used on your individual system, which might be a good idea if you're in a situation where this is happening frequently
@bob-carpenter can you share the output of csp.rebuild_cmdstan(verbose=True)?
Afraid not. I upgraded CmdStan, updated CmdStanPy, and rebooted. The problem turned out to be because I really had updated in between. I'll update the issue text to reflect that.
I wouldn't want to remove precompiled headers altogether. I'll let you know if I get this problem going forward. If I keep running into the problem, I'll lobby for turning it off by default.
Closing because we expect PCH to break and require manual fixes when we update the underlying C++ compiler, at least for the version I was using.
Summary:
Update: It turns out what happened is that in the first report, the first run where it appeared to work, failed in the parser, so it never tried to run the compiler. I had updated Xcode before running everything below, but the problem didn't appear until I finally got around to compiling. So I did pull the rug out from under CmdStan.
This was not at all obvious to me and I was essentially blocked because the usual ways to fix didn't work. I had to reinstall cmdstan (which I did through CmdStanPy). Then everything worked. So I'm just going to close this issue.
Description:
I'm going to give you two session reports. The first one is where the problem crops up. The second is where I fail to fix it.
When I try again I get the dreaded PCH error.
This is my call to
rebuild_cmdstan()
failing.Current Version: