Hello R users and developers, I would like to install Rmpi so that I may take advantage of all of the CPUs in my computer, but I cannot get it to install and I am not very good with linux so it is adding to the headache. I have looked through the help archive, but I have not been successful at getting Rmpi to work. I am not sure if I am even installing openMPI correctly in linux. I would really like to get Rmpi to work so that I can take advantage of libraries that use Rmpi and more importantly reduce my computation time from several days to maybe a day. I am using fedora 11 (64-bit) on a AMD phenom III (AM3) system and I am not an expert at linux so I run into trouble compiling and installing software out of inexperience. I would truly appreciated it if someone could please provide me with some instructions on how to get openMPI installed correctly on Fedora11 and Rmpi to work? I have included the processes I attempted below. Thank you, Alan Smith ##################### what I have attempted so far ################ #I have tried two different ways to install openMPI in fedora in the linux shell #in the linux shell cd Download wget http://www.open-mpi.org/software/ompi/v1.3/downloads/openmpi-1.3.2.tar.gz tar -xzf openmpi* cd openmpi* ./configure make make install #AND #in the linux shell cd Download wget ftp://rpmfind.net/linux/fedora/releases/11/Everything/x86_64/os/Packages/openmpi-1.3.1-1.fc11.x86_64.rpm sudo yum install openmpi-devel # I find the program in this path /usr/lib64/openmpi/1.3.1-gcc/openmpi #I then try to install Rmpi using two methods neither of which work #Using the linux shell I have tried wget http://cran.r-project.org/src/contrib/Rmpi_0.5-7.tar.gz R CMD INSTALL Rmpi_0.5-7.tar.gz #and R CMD INSTALL Rmpi_0.5-7.tar.gz --configure-args=--with-mpi=/usr/lib64/openmpi/1.3.1-gcc R CMD INSTALL Rmpi_0.5-7.tar.gz --configure-args=--with-mpi=/usr/lib64/openmpi/ #All of these attempt lead to error cannot find mpi head file and tell me to use "with-mpi=path/to/mpi" or specify the MPI_ROOT which I clearly cant find #I have also tried this in R using R install.packages("Rmpi") #but it gives the same error. sessionInfo() R version 2.9.0 (2009-04-17) x86_64-unknown-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base -- Alan Smith
Allan Engelhardt
2009-Jun-12 09:59 UTC
[R] Installing Rmpi on Fedora Linux [was: Re: help installing Rmpi]
On 11/06/09 22:46, ALAN SMITH wrote:> Hello R users and developers, > I would like to install Rmpi so that I may take advantage of all of > the CPUs in my computerPackage "multicore" *may* be easier for this.> , but I cannot get it to install [...]The configuration file for Rmpi is, unfortunately, completely brain-damaged with hard-coded assumptions about which subdirectories should contain header and library files and no way of overriding it. This is what I did:> [...] > #I have tried two different ways to install openMPI in fedora in the linux shellIn any recent version of Fedora don't do any of what you suggest; instead do # yum install openmpi openmpi-devel openmpi-libs Then *download* the Rmpi package and unpack it using something like $ tar xvf Rmpi_0.5-7.tar.gz (version number may be different). Then go into the Rmpi directory and change configure.ac. If you are on a x86_64 platform, the following hack should work (for 32 bit try s/64/32/g): +++[cut here]+++ Process this file with autoconf to produce a configure script. AC_INIT(DESCRIPTION) AC_PROG_CC MPI_LIBS=`pkg-config --libs openmpi-1.3.1-gcc-64` MPI_INCLUDE=`pkg-config --cflags openmpi-1.3.1-gcc-64` MPITYPE="OPENMPI" MPI_DEPS="-DMPI2" AC_CHECK_LIB(util, openpty, [ MPI_LIBS="$MPI_LIBS -lutil" ]) AC_CHECK_LIB(pthread, main, [ MPI_LIBS="$MPI_LIBS -lpthread" ]) PKG_LIBS="${MPI_LIBS} -fPIC" PKG_CPPFLAGS="${MPI_INCLUDE} ${MPI_DEPS} -D${MPITYPE} -fPIC" AC_SUBST(PKG_LIBS) AC_SUBST(PKG_CPPFLAGS) AC_SUBST(DEFS) AC_OUTPUT(src/Makevars) ---[cut here]--- The number 1.3.1 may change in future updates to Fedora, I guess.... Now (still in Rmpi directory) do $ autoconf $ cd .. $ tar zcvf Rmpi-0.5-7-F1.tar.gz Rmpi $ R CMD INSTALL Rmpi-0.5-7-F1.tar.gz Which more-or-less works in R: > library("Rmpi") > mpi.spawn.Rslaves(nslaves=2) 2 slaves are spawned successfully. 0 failed. master (rank 0, comm 1) of size 3 is running on: server slave1 (rank 1, comm 1) of size 3 is running on: server slave2 (rank 2, comm 1) of size 3 is running on: server > x=c(10,20) > mpi.apply(x,runif) [[1]] [1] 0.25142616 0.93505554 0.03162852 0.71783194 0.35916139 0.85082154 [7] 0.35404191 0.14221315 0.60063773 0.71805190 [[2]] [1] 0.84157864 0.63481773 0.38217188 0.67839089 0.27827728 0.35429266 [7] 0.04898744 0.96601584 0.25687905 0.77381186 0.69011927 0.37391028 [13] 0.19017369 0.51196594 0.51970563 0.15791524 0.21358237 0.69642478 [19] 0.12690207 0.44177656 > Hope this helps! Allan.