[R] C compilation error (unknown type R_xlen_t) when installing Rmpi package

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Apr 8 18:30:11 CEST 2015

On 08/04/2015 16:00, Sebastian L wrote:
> Hi,
> I am trying to use the parallel computing cluster of our university. To that end, I would like to install the Rmpi package on the cluster. The R version currently installed on the cluster is

This was a matter for the R-devel list as it involves compiled code: see 
the posting guide.

> R version 2.15.2 (2012-10-26) -- "Trick or Treat"
> Platform: x86_64-redhat-linux-gnu (64-bit)
> I am trying to install the Rmpi package from the tar.gz source file, but encounter the following problem during the compilation process:
> What I run within R is
> 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/"))
> and I get the following output with an error message:
> * 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’
> I can not quite figure out what happens here, and what "unknown type name "R_xlen_t"" possibly refers to.

It is a C type introduced in R 3.0.0.  Find in the CRAN archives a 
version of Rmpi as old as your version of R (or at least earlier than 
3.0.0) and install that.

Note to the maintainer (Cc:ed) -- you need to correct the R version 

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Emeritus Professor of Applied Statistics, University of Oxford
1 South Parks Road, Oxford OX1 3TG, UK

More information about the R-help mailing list