Rmpi installation with openmpi (on local directory)
On Dec 4, 2011, at 2:00 PM, Brian Smith wrote:
Hi, I was trying to install the Rmpi package on a cluster (running SGE). I first installed the openmpi package in my directory, and then installed the Rmpi package (after downloading tarball from cran) by an interactive R session. If I load Rmpi within an R interactive session everything seems to be fine. However, if I try to use the SGE then I get errors: Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/bs/R/x86_64-unknown-linux-gnu-library/2.14/Rmpi/libs/Rmpi.so': libmpi.so.0: cannot open shared object file: No such file or directory Error: package/namespace load failed for ?Rmpi? Execution halted
It seems that you don't have /home/bs/openmpi-1.4.4/lib (or wherever mpi lives on the cluster) in LD_LIBRARY_PATH on the cluster. You probably want something like export LD_LIBRARY_PATH="/home/bs/openmpi-1.4.4/lib:$LD_LIBRARY_PATH" Also note that R_HOME is ignored by R - it is overridden by the R script regardless so there is no point setting it in .bashrc (unless it's for some other scripts...) Cheers, Simon
Other details of my attempts at the installation are given below. Any help would be greatly appreciated! many thanks! PS: I have read the previous threads on difficulties in installation of Rmpi and have tried to follow the advice/example... ####################################################### #### INSTALL RMPI WITH INTERACTIVE R SESSION ##### ####################################################### [bs at server library]$ cd ~/R-2.14.0/bin [bs at server bin]$ ./R
install.packages("/home/bs/R-2.14.0/library/Rmpi_0.5-9.tar.gz",configure.args=c("--with-Rmpi-include=/home/bs/openmpi-1.4.4/include","--with-Rmpi-libpath=/home/bs/openmpi-1.4.4/lib","--with-Rmpi-type=OPENMPI"))
Installing package(s) into
?/home/bs/R/x86_64-unknown-linux-gnu-library/2.14?
(as ?lib? is unspecified)
inferring 'repos = NULL' from the file name
* installing *source* package ?Rmpi? ...
checking for openpty in -lutil... no
checking for main in -lpthread... no
configure: creating ./config.status
config.status: creating src/Makevars
** Creating default NAMESPACE file
** libs
gcc -std=gnu99 -I/home/bs/R-2.14.0/lib64/R/include -DPACKAGE_NAME=\"\"
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
-DPACKAGE_BUGREPORT=\"\" -I/home/bs/openmpi-1.4.4/include -DMPI2 -DOPENMPI
-I/usr/local/include -fpic -g -O2 -c RegQuery.c -o RegQuery.o
gcc -std=gnu99 -I/home/bs/R-2.14.0/lib64/R/include -DPACKAGE_NAME=\"\"
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
-DPACKAGE_BUGREPORT=\"\" -I/home/bs/openmpi-1.4.4/include -DMPI2 -DOPENMPI
-I/usr/local/include -fpic -g -O2 -c Rmpi.c -o Rmpi.o
gcc -std=gnu99 -I/home/bs/R-2.14.0/lib64/R/include -DPACKAGE_NAME=\"\"
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
-DPACKAGE_BUGREPORT=\"\" -I/home/bs/openmpi-1.4.4/include -DMPI2 -DOPENMPI
-I/usr/local/include -fpic -g -O2 -c conversion.c -o conversion.o
gcc -std=gnu99 -I/home/bs/R-2.14.0/lib64/R/include -DPACKAGE_NAME=\"\"
-DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\"
-DPACKAGE_BUGREPORT=\"\" -I/home/bs/openmpi-1.4.4/include -DMPI2 -DOPENMPI
-I/usr/local/include -fpic -g -O2 -c internal.c -o internal.o
gcc -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so RegQuery.o Rmpi.o
conversion.o internal.o -L/home/bs/openmpi-1.4.4/lib -lmpi
installing to /home/bs/R/x86_64-unknown-linux-gnu-library/2.14/Rmpi/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
* DONE (Rmpi)
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.5279140 0.6070291 0.5367963 0.2028148 0.3930856 0.2121955 0.3994963 [8] 0.4322645 0.6733323 0.4020272 [[2]] [1] 0.39267299 0.48316984 0.88169217 0.15594098 0.81789819 0.40163353 [7] 0.25264554 0.52592001 0.72461786 0.16952091 0.52862589 0.05710565 [13] 0.48598241 0.34414770 0.62858189 0.42895010 0.88796806 0.93477003 [19] 0.82415421 0.73289008
############################
###### MY loadRmpi.R file #####
############################
library(snow)
library(Rmpi)
print('loaded...')
############################
###### eerror.out file ##########
############################
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/home/bs/R/x86_64-unknown-linux-gnu-library/2.14/Rmpi/libs/Rmpi.so':
libmpi.so.0: cannot open shared object file: No such file or directory
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/home/bs/R/x86_64-unknown-linux-gnu-library/2.14/Rmpi/libs/Rmpi.so':
libmpi.so.0: cannot open shared object file: No such file or directory
Error: package/namespace load failed for ?Rmpi?
Execution halted
##############################
############# R CMD ldd Rmpi.so ######
##############################
[bs at server Rmpi]$ R CMD ldd
~/R/x86_64-unknown-linux-gnu-library/2.14/Rmpi/libs/Rmpi.so
libmpi.so.0 => /home/bs/openmpi-1.4.4/lib/libmpi.so.0
(0x0000002a95662000)
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a9582b000)
libopen-rte.so.0 => /home/bs/openmpi-1.4.4/lib/libopen-rte.so.0
(0x0000002a95a65000)
libopen-pal.so.0 => /home/bs/openmpi-1.4.4/lib/libopen-pal.so.0
(0x0000002a95bb0000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000002a95d03000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000002a95e06000)
libutil.so.1 => /lib64/libutil.so.1 (0x0000002a95f1f000)
libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a96022000)
libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a961a8000)
/lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)
[bs at server Rmpi]$
########################
######## added to .bashrc file #######
#########################
R_HOME=$HOME/R/x86_64-unknown-linux-gnu-library/2.14/
[[alternative HTML version deleted]]
_______________________________________________ R-sig-hpc mailing list R-sig-hpc at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-hpc