-
-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble Updating CmdStan to 2.36: C++20 Compatibility Issues #1306
Comments
Those are only warnings, so your installation should still successfully build. The C++ standard also has no impact on the speed of running models so it might be a codebase change instead, could you share a model that is running slower now so that we can debug? |
Thanks for the prompt reply! Here is an example of a model that takes much longer to run now than it did before. (Please note that I'm using the Rethinking package from the McElreath textbook Statistical Rethinking.)
The model also produces many of the warning messages like the first snippet I quoted above. I can send a full copy of the error message if that would be helpful. |
We cannot in general guarantee there are no compiler warnings, especially in our decencies which the snippet here seems to be |
Hi @WardBrian, Thank you for your response and for clarifying that compiler warnings don’t necessarily prevent successful builds. However, I wanted to highlight that these issues weren’t present in earlier CmdStan versions, such as 2.35, where the workaround of using C++17 resolved compatibility concerns. Given that the same workaround no longer works in 2.36, it feels like a regression, even for free software. I understand that dependencies can introduce challenges, but the significant slowdown and errors I’m encountering now are unexpected compared to my prior experience. It's making it hard for me to continue in my studies of Stan, as each model now takes so much longer to run that it's no longer practicable for me to study even simple models. I appreciate the team’s hard work and would be happy to assist in debugging to the extent possible (I'm not all that tech saavy, so I don't know how much help I can be! But I'll do my best) Thanks again for your time and support! Best regards, |
I’m not sure why the warnings would be different, because the version of the dependency did not change. As for why adding the C++17 flag doesn’t remove it any longer, I’m not sure — we’re defaulting to C++17 in this version anyway. A slow down is definitely a concern. If you compile the same model under 2.35, it’s automatically faster? Is this for all models or a specific one? |
Hi @WardBrian, thank you for taking the time to follow up on my issue -- I really appreciate your attention to this! To answer your first question, I actually tried to go back and delete cmdstan 2.36 and replace it with 2.35, but I still got the same slowdown and warnings. Actually I uninstalled R, RStudio, and rtools44 to reinstall everything from the ground up -- as excessive as that may be, it seemed to work when I was first troubleshooting this issue back in November. I really thought that switching back to 2.35 would be at least a short-term fix, so now I'm at a loss for what's going on. Here's a quick recap of all I can say with at least some certainty:
To your question about all models vs. a specific one, I went back to my notes from Statistical Rethinking and tested the simplest Stan model I could find (shown below). This model also experienced significant slowdown and the same (or at least highly similar) warnings. So it does seem to me that my slowdown issues are fairly general and not limited to one or two complex models.
If there’s anything unclear about my explanation or additional details you’d like me to provide, please let me know -- I’d be happy to elaborate further! Thanks again for your help. |
@richardCrandall are you using I've also run your example ulam model with And to emphasise again, you can safely ignore the compiler warnings, they are completely unrelated to model performance and running time |
Hi @andrjohns thanks for your continued help! I feel a bit like the person who calls the mechanic to come inspect their washing machine only for the thing to run perfectly once the mechanic is in your house. This morning I reran the very same model I had quoted in the above message yesterday -- and now my laptop is able to run it again in a reasonable time and without compiler warnings. (I promise it was giving me trouble yesterday -- I tested it before writing my last post!) My best guess is that a Lenovo driver/system update I ran this morning may have fixed things? I really can't account for why else the model would have malfunctioned yesterday and worked fine today -- I stopped tinkering with R/RStudio/Stan/etc after my post yesterday, so I don't know how else my laptop could have "fixed itself." Just to address the question of if rethinking uses cmdstanr or rstan, from what I've read rethinking used to use rstan but now it uses cmdnstan: https://github.com/rmcelreath/rethinking/releases/tag/v2.2.1 Also, when I pull up the documentation for rethinking (version 2.42) directly in R, I see it depends on cmdstanr only -- I don't see a mention of rstan anymore. Just sharing this information in the hopes it benefits you, in thanks for all the time you've invested in helping me. @andrjohns I want to thank you and @WardBrian for the time you have shared with me in trying to solve this issue. |
Thanks for following up, @richardCrandall. I know the feeling of "works with the mechanic watching" from pestering the devs myself. |
Summary:
After updating to CmdStan 2.36, I encountered repeated error/warning messages that appear related to C++20 vs. C++17 compatibility. Switching to C++17 did not resolve the issue. Additionally, Stan models now run significantly slower or fail to execute.
Description:
I first experienced this issue with CmdStan 2.35 after updating both CmdStan and CmdStanR to their latest versions. At that time, I resolved it by adding the following line to the make/local file and rebuilding CmdStan:
CXXFLAGS += -std=c++17
This worked for CmdStan 2.35 but no longer resolves the issue in CmdStan 2.36. Rebuilding with this flag still results in the same warnings/errors.
Reproducible Steps:
The issue occurs after uninstalling and reinstalling CmdStan and CmdStanR, followed by rebuilding CmdStan.
Current Output:
During installation/rebuild, I receive numerous warnings. Below are representative snippets:
Expected Output:
Successful installation of CmdStan without errors or warnings.
Current Version:
The text was updated successfully, but these errors were encountered: