Running Stan on a Mac from the command line requires the Stan source code and a C++ build environment. This page provides step-by-step instructions.
Here are some tips before the install instructions in the next section.
To open an application, use [Command-Space] to open Spotlight, enter the application's name in the text field, then click on the application in the pop-up menu or [Return] if highlighted.
Spotlight can be used in the same way to find files or folders, such as the default Downloads folder for web downloads.
To run shell commands, open the built-in Terminal application.
The easiest (but not the only) way to install a C++ development environment on a Mac is to use Apple's Xcode development environment.
From the Xcode home page, click View in Mac App Store.
From the App Store, click Install, enter Apple ID, and wait for Xcode to finish installing.
Open the Xcode application, click top-level menu Preferences, click top-row button Downloads, click button for Components, click on the Install button to the right of the Command Line Tools entry, then wait for it to finish installing.
Click top-level menu Xcode, then click item Quit Xcode to quit.
To test, open the Terminal application and enter:
% make --version
% g++ --version
Verify that make is at version 3.81 or later and g++ is at 4.2.1 or later.
Download the most recent version of stan-src-1.m.p.tgz (m is the minor version and p the patch level) from Stan Downloads.
Open the folder containing the download in the Finder (typically, the user's top-level Downloads folder).
If the Mac OS has not automatically unpacked the .tgz file into file stan-src-1.m.p.tar, double-click the .tgz file to unpack.
Double click on the .tar file to unarchive directory stan-src-1.m.p.
Move the resulting directory to a location where it will not be deleted, henceforth called <stan-home>.
To complete the installation, following the remaining cross-platform instructions on