• 我能够解决这个问题,见下面的最后一个编辑---

我正在尝试在我所在学院的计算集群上使用R.对于并行计算问题,我想安装雪和Rmpi包 . 所以我下载了tar.gz文件并尝试安装了pacakges,因为它运行良好,但是对于Rmpi来说,有些奇怪的事情发生了:

我先做了什么:

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’

好吧,所以mpi.h似乎缺失了,我做了一些搜索并找出了要做的事情:指定MPI库的路径:

> 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

所以现在没有mpi.h错误,但C编译器看起来不起作用,虽然它之前做过,我只更改了install.packages函数中的mpi选项 .

这里出了什么问题,如何安装包?


编辑2:经过一些帮助后,我想出了如何找到mpi文件的位置并执行此操作:

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/") )

但是,这仍然无效,我收到以下错误:

* 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’

编辑3:我想出了一个解决我的问题的办法,由于信息不完整,我猜这里找不到任何人 . 在群集上,R仅在版本2.15.2中安装,但Rmpi 0.6-5是为R 3.0.0或更新版本构建的 . 错误地指定了Rmpi包中的R版本依赖性 . 我下载了旧版本(Rmpi 0.6-1)并且能够安装这个版本 .