我正在尝试在LAM MPI群集计算机上安装Rmpi
包。以前我一直在编译和测试一些东西(mpi4py
和小C ++程序),所以我确信MPI本身是有效的。但是,链接库时安装Rmpi
包失败。
我的主要嫌疑人是在makefile中调用gcc
而不是mpicc
(我试图找到配置中的行来改变它,但到目前为止找不到它)。
有人有在LAM上安装Rmpi的经验,你是如何管理它的?
建筑
从R
调用的命令install.packages("Rmpi")
日志
trying URL 'http://cran.at.r-project.org/src/contrib/Rmpi_0.6-1.tar.gz'
Content type 'application/x-gzip' length 92977 bytes (90 Kb)
opened URL
==================================================
downloaded 90 Kb
* installing *source* package âRmpiâ ...
** package âRmpiâ successfully unpacked and MD5 sums checked
checking for gcc... gcc -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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
I am here /usr and it is OpenMPI
Trying to find mpi.h ...
Found in /usr/include
Trying to find libmpi.so or libmpich.a ...
Found libmpi in /usr/lib
checking for openpty in -lutil... yes
checking for main in -lpthread... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include -DMPI2 -DOPENMPI -I/usr/local/include -fpic -g -O2 -c RegQuery.c -o RegQuery.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include -DMPI2 -DOPENMPI -I/usr/local/include -fpic -g -O2 -c Rmpi.c -o Rmpi.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/include -DMPI2 -DOPENMPI -I/usr/local/include -fpic -g -O2 -c conversion.c -o conversion.o
gcc -std=gnu99 -I/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/include -DNDEBUG -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I/usr/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/usr/lib -lmpi -lutil -lpthread -L/g/software/linux/pack/r-2.15.2/centos-5/lib64/R/lib -lR
/usr/bin/ld: skipping incompatible /usr/lib/libutil.so when searching for -lutil
/usr/bin/ld: skipping incompatible /usr/lib/libutil.a when searching for -lutil
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.so when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libpthread.a when searching for -lpthread
/usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible /usr/lib/libc.a when searching for -lc
installing to /home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpi/libs
** R
** demo
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared object '/home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpi/libs/Rmpi.so':
/usr/lib/libmpi.so.0: undefined symbol: _kio
Error: loading failed
Execution halted
ERROR: loading failed
* removing â/home/andrejev/R/x86_64-unknown-linux-gnu-library/2.15/Rmpiâ
The downloaded source packages are in
â/tmp/Rtmp5qzeqp/downloaded_packagesâ
Warning message:
In install.packages("Rmpi") :
installation of package âRmpiâ had non-zero exit status
答案 0 :(得分:8)
我们的设置非常相似。我最近没有触及它以便能够说出你的具体情况,但我可以传递一些使我们正常运行的命令...
正如Dirk所说,我们的第一步是让OpenMPI运行。完成设置后,您需要确保LD_LIBRARY_PATH
已正确设置:
export LD_LIBRARY_PATH=/opt/openmpiv2/lib/:$LD_LIBRARY_PATH
最终为我们安装了Rmpi的命令(在运行上述命令并启动R之后)是:
install.packages("Rmpi", configure.args = c("--with-Rmpi-include=/opt/openmpiv2/include/", "--with-Rmpi-libpath=/opt/openmpiv2/lib/", "--with-Rmpi-type=OPENMPI", "--with-mpi=/opt/openmpiv2/"))
为我们成功安装了包。然后我们可以使用以下命令运行作业:
qsub -I -l nodes=2:ppn=12
/opt/openmpiv2/bin/mpirun --hostfile $PBS_NODEFILE -n 1 R --slave -f rmpitest.R
这些命令可能对我们的设置非常具体,以至于它们可能没什么用处,但希望这里的东西可以为您节省一些时间!
正如@Sergej在下面提出的,更通用的解决方案可能是:
install.packages(
"Rmpi",
configure.args = c(
"--with-Rmpi-include=/usr/include/", # This is where LAM's mpi.h is located
"--with-Rmpi-libpath=/usr/lib/", # This is where liblam.so is located (actually as I type it mine was located in /usr/lib64/liblam.so.0, so maybe this is not needed at all)
"--with-Rmpi-type=LAM" # This says that the type is LAM (there is also OPENMPI and MPICH)
))
我们的设置:RHEL 5,Rmpi 0.5-9,OpenMPI 1.4.3。,R 2.15.0
答案 1 :(得分:3)
许多年前,我曾经使用过LAM,但之后转而使用OpenMPI。 Rmpi的作者郝宇建议做同样的事情。
r-sig-hpc列表是解决此类问题的理想场所。
答案 2 :(得分:2)
根据杰夫艾伦的建议,我去了R并运行
install.packages(
"Rmpi",
configure.args = c(
"--with-Rmpi-include=/usr/include/", # This is where LAM's mpi.h is located
"--with-Rmpi-libpath=/usr/lib64/", # This is where liblam.so is located
"--with-Rmpi-type=LAM" # This says that the type is LAM (there is also OPENMPI and MPICH)
))
我也跑
# Because it was non-standard R location so it din't find shared libraries
export LD_LIBRARY_PATH=/g/software/linux/pack/r-2.15.0/lib64/R/lib
# Rmpi also could not find libutil so I had to add path to it as well
export LD_PRELOAD=/usr/lib64/libutil.so
修改强>
即使我在多个节点上运行Rmpi时设法编译它也失败了。所以我想我必须开始推动OpenMPI转换:/