Saturday, October 31, 2009

Compile Rmpi with Windows MPI (HPC pack)

Compile Rmpi (http://www.stats.uwo.ca/faculty/yu/Rmpi/) in Windows

1. Install HPC Pack 2008 SDK with SP1 and modify line 314 in mpi.h (installed_dir\Include) as follows:
//typedef __int64 MPI_Offset;
typedef long long MPI_Offset;

2. Download Rmpi from http://www.stats.uwo.ca/faculty/yu/Rmpi/download/linux/Rmpi_0.5-7.tar.gz

3. Untar the source and modify src/Makevars.win by changing directory and library option (-lmsmpi) as follows:
PKG_CFLAGS = -I"C:\Program Files\Microsoft HPC Pack 2008 SDK\Include" -DMPI2 -DWin32
PKG_LIBS = -L"C:\Program Files\Microsoft HPC Pack 2008 SDK\Lib\i386" -lmsmpi

4. Compile and install
R CMD INSTALL Rmpi

5. Build for re-distribution
R CMD build --binary Rmpi

No comments: