Rmpi for Mac OS X

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

  1. 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 gfortran by
    brew install gfortran
  3. At the terminal, install Open MPI by
    brew install open-mpi
  4. Launch R64 and install Rmpi by
    install.packages("Rmpi", type="source")
    You need to compile Rmpi from source. The binary  Rmpi at CRAN is only for 32bit openmpi.
    Note: To compile Rmpi with the latest version, grab it here and use install.packages(file.choose(), repos = NULL, type = "source")
    Note:  Do not use Rstudio to compile Rmpi. It will call R which is 32bit.
    Note: You can install R through homebrew as well: brew install R.
  5. Test Rmpi
    mpi.iparReplicate(100, mean(rnorm(1000000)))
  6. That's it.

Install Rmpi with LAM on Mac (older instructions):

It is relatively easy to build or run Rmpi under Mac OS X as long as the required component, LAM, is installed and configured properly.  First get lam 7.1.3 for Mac OS X 10.4 from http://www.lam-mpi.org/download/files/lam-7.1.3-1.dmg.gz. Edit /usr/local/lam-bhost.def to include nodes. If you mainly run Rmpi under one machine such as Mac Pro with up to 8 CPUs, just add (if 8 CPUs are available)
        localhost cpu=8

To install Rmpi from source, you may need additional tools such as xcode. Once downloaded, please use
    sudo R CMD INSTALL Rmp_xxx.tar.gz
to install.