在Centos6上安装Rmpi'找不到-lmpi'

时间:2013-08-29 06:46:07

标签: r centos mpi

嘿,我在这里看到了以下两个问题:

  1. Install Rmpi on Centos fails with "can't find -lmpi"
  2. Installing Rmpi on LAM/MPI cluster
  3. 但是他们没有对这个问题提供任何具体的答案。

    以下是一些相关信息:

    R> system('echo "$LD_LIBRARY_PATH"')
    /usr/lib64/R/lib:/usr/local/lib64:/usr/lib/jvm/jre/lib/amd64/server:/usr/lib/jvm/jre/lib/amd64:/usr/lib/jvm/java/lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib:/usr/lib64/openmpi/lib
    
    R> install.packages("Rmpi", configure.args="--with-Rmpi-include=/usr/include/openmpi-x86_64 --with-Rmpi-libpath=/usr/lib64/openmpi --with-Rmpi-type=OPENMPI")
    

    这是错误消息的最后一部分:

    gcc -m64 -std=gnu99 -shared -L/usr/local/lib64 -o Rmpi.so RegQuery.o Rmpi.o conversion.o internal.o -L/usr/lib64/openmpi -lmpi -L/usr/lib64/R/lib -lR
    /usr/bin/ld: cannot find -lmpi
    collect2: ld returned 1 exit status
    make: *** [Rmpi.so] Error 1
    

    任何帮助都会很棒。感谢。

1 个答案:

答案 0 :(得分:1)

安装openmpi-devel后, 我在libmpi.so中看到/usr/lib64/openmpi/lib/

$ sudo yum install openmpi-devel
$ sudo updatedb
$ locate libmpi.so
/usr/lib64/openmpi/lib/libmpi.so
/usr/lib64/openmpi/lib/libmpi.so.1
/usr/lib64/openmpi/lib/libmpi.so.1.0.2

以下内容应该有效:

install.packages(
  "Rmpi", 
  configure.args = paste( 
    "--with-Rmpi-include=/usr/include/openmpi-x86_64",
    "--with-Rmpi-libpath=/usr/lib64/openmpi/lib",
    "--with-Rmpi-type=OPENMPI"
  )
)

如果可能需要告诉系统在此目录中查找共享库:

# echo "/usr/lib64/openmpi/lib" > /etc/ld.so.conf.d/openmpi.conf
# ldconfig