Rmpi for Mac OS X

Use homebrew to install Open MPI and Rmpi on Mac OS (64bit only)

  1. For Mac OS El Capitan, follow this page to install Apple's Xcode, Command Line Tools, and homebrew (just homebrew itself).
    For old versions of Mac OS, follow this page to install Apple's Xcode, Command Line Tools, and homebrew. Follow up to the Step 3 in that guide.
  2. At the terminal, install gcc by
    brew install gcc
  3. At the terminal, install Open MPI by
    brew install open-mpi
  4. Launch Rstudio or R and install Rmpi by
    install.packages("Rmpi", type="source")
    Note: To compile Rmpi with the latest version, grab it here and use install.packages(file.choose(), repos = NULL, type = "source")
    Note: You can install R through homebrew as well: brew install R.
  5. Test Rmpi
    library(Rmpi)
    mpi.spawn.Rslaves()
    mpi.parReplicate(100, mean(rnorm(1000000)))
    mpi.close.Rslaves()
    mpi.quit()
  6. That's it.

To install Rmpi from command line (xterm terminal), please use
    sudo R CMD INSTALL Rmp_xxx.tar.gz
to install.