Compile on Mac OS X

NOTE: These instructions are for compiling the development branch.

The standard way to build revbayes is to use cmake. If you want to compile using meson, see revbayes/projects/meson/


You will need to have C++ compiler installed on your computer. GCC 4.2 (or higher) and Apple LLVM version 6.0 have both been used successfully. If you don’t have a C++ compiler, you should install Xcode.

You will also need to have CMake and Boost installed

If you have root

One option to install them is using homebrew:

ruby -e "$(curl -fsSL"
brew install cmake boost

If you do not have root

First you will need to install cmake

Then you can compile boost:

curl -O -L
tar -xzvf boost_1_71_0.tar.gz
cd boost_1_71_0
./ --with-libraries=atomic,chrono,filesystem,system,regex,thread,date_time,program_options,math,serialization
./b2 link=static

When it is done, something like the following will be printed. You will need these paths for the next step.

The following directory should be added to compiler include paths:


The following directory should be added to linker library paths:



Download RevBayes from our github repository. Clone the repository using git by running the following command in the terminal

git clone --branch development revbayes

Open a terminal and go to the RevBayes cmake directory:

cd revbayes/projects/cmake

Now either build the standard version using the following:


or build the MPI version to produce the rb-mpi executeable:

./ -mpi true

To compile with a locally compiled boost, do the following. Be sure to replace the paths in the build command with those you got from boost in the previous step.

./ -boost_root /root/boost_1_71_0 -boost_lib /root/boost_1_71_0/stage/lib

You will likely see some compiler warnings (e.g. clang: warning: optimization flag '-finline-functions' is not supported). This is normal.