Title: Compiling npRmpi from source code under MS Windows 7 (32-bit/64-bit)

Date: 03/13/2013

Author: David T. Jacho-Chavez (djachocha@emory.edu)

These are based on those given in

https://www.stats.uwo.ca/faculty/yu/Rmpi/

1. Download the following files:

   a. Rtools30.exe: http://cran.r-project.org/bin/windows/Rtools/Rtools30.exe

   b. mpich-win-ia32.msi:

https://www.mpich.org/static/tarballs/mpich-win-ia32.msi

   c. mpich-win-x86-64.msi:

https://www.mpich.org/static/tarballs/mpich-win-x86-64.msi

   d. R-latest-win.exe: https://R-project.org/mirrors.html

   e. npRmpi_0.60-20.tar.gz: https://cran.r-project.org/web/packages/npRmpi/

2. Run and install the following programs:

   a. Install (a) in the previous step, and make sure your system Path
   starts with the appropriate Rtools and R bin paths.

   b. Run and install (b). Do not change the Passphrase (i.e. behappy)
   and use the default directory: “C:\Program Files\MPICH\” (for example)

       i. Go to “Start” -> “All Programs” -> “MPICH” -> “wmpiregister.exe”
          and enter your PC username and password (the one you use to log in).

      ii. Open "Command Prompt" with administrator. At prompt,

      typesmpd -install -phrase behappy

      change behappy to whatever the pass phrase you choose).

      Run smpd -status

      If it returns "smpd running on your_host_name", then smpd is
      setup properly.

   c. Run and install (c). Do not change the Passphrase (i.e. behappy)
   and use the default directory: “C:\Program Files\MPICH\” (for example)

       i. Go to “Start” -> “All Programs” -> “MPICH” ->
       “wmpiregister” and enter your PC username and password (the one
       you use to log in).

       ii. Open "Command Prompt" with administrator. At prompt,

       typesmpd -install -phrase behappy

       change behappy to whatever the pass phrase you choose).

       Run smpd -status

       If it returns "smpd running on your_host_name", then smpd is
       setup properly.

   d. Install (d) in the previous step, and make sure the installation
   directory is correct.

       i. Go to “Start” -> “run” and type “cmd”. Then type
       “R”. ii. From inside R, run

       Install.packages(“cubature”)

       Select your mirror and let it run. Close the window. 

3. Add MPICH bin directory to PATH environment variables as follows:

   a. Right click "My Computer" and choose "Properties". Click
   "Advanced system settings" to get a new window.  ￼￼￼￼￼￼￼￼￼

   b. Click "Environment Variables..." to get a new window. Locate
   variable "PATH" (it is version dependent. Either User or System
   variables will be fine). Click Edit to get a new window.

   c. At end of Variable value, add: ";C:\Program
   Files\MPICH\bin;" (Remove the
   double quotations).

4. npRmpi Installation:

Go to “Start” -> “run” and type “cmd”. Navigate where item (e) in step
1 is located in your directory, e.g. “cd
C:\Users\yourusername\Downloads” and write

R CMD INSTALL –preclean npRmpi_0.50-1.tar.gz

5. Testing:

From inside your DOS command shell, now navigate where your test R
code (called it “mytest.R”) is located (along with the .Rprofile
file). At the command prompt, write

mpiexec –n 2 R –no-save –q < mytest.R > mytest_OUT.txt

Open “mytest_OUT.txt” using notepad or any other text editor and check
it ran correctly.
