| « Local Web Hosting on Arch | Introduction to Matrix Calculus » |
Installing R Rmpi on Arch Linux
After 2.5 hours I have finally managed to get Rmpi installed and working on Arch.
After lots of trying and searching I finally found out that Rmpi is not compatible with the latest version of openmpi which is installed from the Arch repos (version 1.5.3-2). Following the recommendation here I was able to get Rmpi working by reverting to openmpi version 1.4.3, which is in fact the current release.
To do this, I downloaded openmpi 1.4.3 from the Open MPI download page, extracted the tarball, compiled and installed the source in the usual way:
./configure
make
make install
After installation I then followed the directions here with modifications to account for the new install location. Specifically, I ran the command:
sudo ldconfig /usr/local/lib/openmpi/
and then added the line:
export LD_LIBRARY_PATH=/usr/local/lib/openmpi/:$LD_LIBRARY_PATH
to my .bashrc file.
Finally, I was able to install Rmpi in R using the following command:
install.packages("Rmpi",
configure.args =
c("--with-Rmpi-include=/usr/local/include/",
"--with-Rmpi-libpath=/usr/local/lib/openmpi/",
"--with-Rmpi-type=OPENMPI"))
I have now test Rmpi by running the script I posted previously after opening R as:
/usr/local/bin/mpirun -np 1 R --vanilla
and it all seems to work as expected. Phew!