Due to various distributions of Linux or other types of Unix, it is hard to give instructions that can be applied to all situations. However, the supplied configurations should be working for many well known distributions such as RedHat, Debian, etc. Before installing, make sure you have a proper installed MPI environment. All configurations for various systems are in the file configure.ac. Feel free to modify it to fit your system. Then run autoconf to generate a new configure file.
R CMD INSTALL Rmpi_version.tar.gz --configure-args=" \\You may go to the step 1.c. to finish the installation. If you install Rmpi on a Cray cluster, please use
--with-Rmpi-include=/path/to/mpi_include_dir \\ --with-Rmpi-libpath=/path/to/mpi_lib_dir \\ --with-Rmpi-type={OPENMPI or MPICH or MPICH2 or LAM}"
R CMD INSTALL Rmpi_version.tar.gz --configure-args=" \\
--with-Rmpi-include=/path_to_cray_mpich2_include_dir \\ --with-Rmpi-libpath=/path_to_cray_mpich2_lib_dir \\ --with-Rmpi-type=CRAY" --no-test-load
Note: Use aprun to launch Rmpi instead of mpirun on a Cray cluster.
These three steps should be enough for most cases. If Rmpi
still fails to be installed, then check MPI installation. As
for Open MPI, after installation, make sure to set LD_LIBRARY_PATH properly. In case you got errors like
(most likely under OpenMPI 1.7 or 1.8)
mca: base: component_find: unable to open /usr/local/openmpi-1.6.5/lib/openmpi/mca_paffinity_hwloc: /usr/local/openmpi-1.6.5/lib/openmpi/mca_paffinity_hwloc.so: undefined symbol:
then configure OpenMPI with ./configure --disable-dlopen
To test if Rmpi can be run on a host with OpenMPI, try at
command line
mpirun -oversubscribe -np 1 R --vanilla
Then run R and
> library(Rmpi)
library(Rmpi)
> mpi.spawn.Rslaves()
Some slaves should be spawned. Test a few Rmpi functions like
mpi.remote.exec.