Apologies if it’s bad form to update an old issue, but I would like to summarize what helped me install cmdstan for windows, in case it’s useful for future folks searching for the same windows installation issues. Big thanks to all on this thread, you saved me right when I was about to give up!
I was struggling for multiple days trying to install cmdstan various different ways, running into strange compiler issues left and right. I was able to eventually get it working using the Installation from GitHub instructions and help from this thread. Just to summarize for those who might feel lost, these are the steps that worked for me:
- Install the C++ toolchain using RTools 4.0
- Adding RTools40
binpaths to the PATH environment variable, as suggested in the C++ Toolchain instructions for windows - May not be relevant to you: Removing any other PATH entries that I had added earlier to other
g++ormingw32-makeinstallations. - Building
mingw32-makeusingpacman -Sy mingw-w64-x86_64-makeas suggested in this thread. - Clone the cmdstan GitHub repo as listed in the instructions (using GitHub desktop to take care of the recursive cloning)
- Use
mingw32-make buildto build the stan executables. - Check the Stan compiler (in the instructions) after installation.
Credits:
TLDR; if you’re running into C++ or g++ compiler issues, try building it all from GitHub source – it’s easier than I expected. I was able to get it working in ~15 minutes after giving up on other (conda) installation methods that I assumed would be fast.