This page provides step-by-step instructions for installing a C++ build environment in Windows and downloading the Stan source code.
To open a Windows command shell, first open the Start Menu (usually in the lower left of the screen), select option All Programs, then option Accessories, then Command Prompt.
Alternatively, enter [Windows+r] on the keyboard and enter cmd into the text field that pops up in the Run window.)
Note for Cygwin Users: Stan can be run under Cygwin, the Linux look-and-feel environment for Windows. Cygwin must have make and a recent version of g++ (part of gcc) installed. Within a Cygwin shell, Stan will behave as under Linux.
The simplest way to install a full C++ build environment that will work for Stan is to use the Rtools package (even if you don't plan to use R).
First, download the latest frozen (aka stable) version of Rtools from
Next, double click on the downloaded file to open the Rtools install wizard, then proceed through its options.
The Stan source code distributions are named stan-src-1.m.p.tgz, where m is the minor version and p the patch level.
Download the latest Stan source from the Stan Downloads page to any non-temporary folder. (If in doubt, select My Documents on Windows XP or Documents on Windows 7.)
Change to the download directory (aka folder) using one of the following commands, replacing <username> with your Windows user name.
% cd "My Documents"
The full path (including quotes) will work from anywhere:
% cd "c:\Documents and Settings\<username>\My Documents"
% cd Documents
Or use the full path (including quotes),
% cd "c:\Users\<username>\Documents"
To verify that the downloaded Stan .tgz file is there, list the directory contents using:
% dir
Unpack the distribution using the tar command (which is installed as part of Rtools):
% tar --no-same-owner -xzf stan-src-1.m.p.tgz
The --no-same-owner flag is not strictly necessary, but it removes a bunch of irrelevant warnings.
To complete the installation, following the remaining cross-platform instructions on