-- I was able to solve this problem, see last edit below ---
I am trying to use R on the computing cluster of my institute. For parallel computing issues, I would like to install the snow and the Rmpi package. So I downloaded the tar.gz files and tried to install the pacakges, for snow it worked fine, but for Rmpi something strange happens:
What I did first:
install.packages("/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz", repos = NULL, type = "source", lib = "/home/myusername/Rpackages/")
* installing *source* package ‘Rmpi’ ...
** Paket ‘Rmpi’ erfolgreich entpackt und MD5 Summen überprüft
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
Trying to find mpi.h ...
Cannot find mpi.h header file
Please use --with-mpi=/path/to/mpi or specify the environment variable MPI_ROOT
ERROR: configuration failed for package ‘Rmpi’
* removing ‘/home/myusername/Rpackages/Rmpi’
Ok, so mpi.h seemed to be missing, I did some searching and found out what to do: specify the path to the MPI libraries:
> install.packages("/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz", repos = NULL, type = "source", lib = "/home/myusername/Rpackages/", configure.args="--with-mpi=/cm/local/modulefiles/openmpi/gcc/64/1.6.3" )
* installing *source* package ‘Rmpi’ ...
** Paket ‘Rmpi’ erfolgreich entpackt und MD5 Summen überprüft
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... no
configure: error: in `/tmp/Rtmp9qZ8QA/R.INSTALLad327c257ce2/Rmpi':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘Rmpi’
* removing ‘/home/myusername/Rpackages/Rmpi’
Warnmeldung:
In install.packages("/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz", :
Installation des Pakets ‘/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz’ hatte Exit-Status ungleich 0
So now there is no mpi.h error, but the C compiler appears not to work, although it did before and I only changed the mpi option in the install.packages function.
What went wrong here and how can I install the package?
Edit 2: After some help, I figured out how to find where the mpi files are located and did this:
install.packages("/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz", repos = NULL, type = "source", lib = "/home/myusername/Rpackages/", configure.args=c("--with-Rmpi-libpath=/usr/mpi/gcc/openmpi-1.6.3/lib64/","--with-Rmpi-type=OPENMPI", "--with-Rmpi-include=/usr/mpi/gcc/openmpi-1.6.3/include/") )
However, this still does not work and I get the following errors:
* installing *source* package ‘Rmpi’ ...
** Paket ‘Rmpi’ erfolgreich entpackt und MD5 Summen überprüft
checking for openpty in -lutil... no
checking for main in -lpthread... no
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/mpi/gcc/openmpi-1.6.3/include/ -DMPI2 -DOPENMPI -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Rmpi.c -o Rmpi.o
Rmpi.c: In Funktion »mpi_bcast«:
Rmpi.c:605:2: Fehler: unbekannter Typname: »R_xlen_t«
make: *** [Rmpi.o] Fehler 1
ERROR: compilation failed for package ‘Rmpi’
Edit 3: I figured out a solution to my problem which due to incomplete information, noone here could have found I guess. On the cluster, R was only installed in version 2.15.2, but Rmpi 0.6-5 is built for R 3.0.0 or newer. The R version dependence in the Rmpi package is wrongly specified. I downloaded an older version (Rmpi 0.6-1) and was able to install this one.
/cm/local/modulefiles/openmpi/gcc/64/1.6.3/
contains the whole MPI installation? Usually MPI is not installed into the modulefiles configuration. Runlocate mpi.h
andlocate mpirun
to find the directories in which MPI is actually installed. – Depolarizelocate mpi.h
as well aslocate mpirun
do not give back anything – Bumpermodule list
and then look for an entry that corresponds to openmpi 1.6.3 compiled for gcc (e.g.openmpi/1.6.3
). Pick that entry and runmodule load openmpi/1.6.3
(the name of the module might be different). Thenwhich mpirun
should tell you where openmpi is installed. – Depolarizemodule available
I found this one:openmpi/gcc/64/1.6.3
, and then loaded it viamodule load /cm/local/modulefiles/openmpi/gcc/64/1.6.3
which was then also shown aftermodule list
.which mpirun
gives back/usr/mpi/gcc/openmpi-1.6.3/bin/mpirun
, so I tried to use this in the Rmpi package installation:install.packages("/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz", repos = NULL, type = "source", lib = "/home/myusername/Rpackages/", config.args = "--with-mpi=/usr/mpi/gcc/openmpi-1.6.3/bin/mpirun")
, the compiler now works, but again,mpi.h
is not found – Bumperinstall.packages("/home/myusername/Rpackages/Rmpi_0.6-5.tar.gz", repos = NULL, type = "source", lib = "/home/myusername/Rpackages/", configure.args=c("--with-Rmpi-libpath=/usr/mpi/gcc/openmpi-1.6.3/lib64/","--with-Rmpi-type=OPENMPI", "--with-Rmpi-include=/usr/mpi/gcc/openmpi-1.6.3/include/") )
, however, I get the following error:Rmpi.c: In Funktion »mpi_bcast«: Rmpi.c:605:2: Fehler: unbekannter Typname: »R_xlen_t« make: *** [Rmpi.o] Fehler 1 ERROR: compilation failed for package ‘Rmpi’
– Bumper--with-mpi=/usr/mpi/gcc/openmpi-1.6.3/bin/mpirun
, try setting it to--with-mpi=/usr/mpi/gcc/openmpi-1.6.3/
– Depolarize