来自macports的MPICH缺少符号

时间:2012-10-05 14:31:26

标签: r macos mpich

我正在尝试用Rmpi编写一个程序,不幸的是,所需的符号是未定义的,用otool和nm跟踪它似乎只是引导我libmpich.3.3.dylib。遗憾的是,此动态库中未定义符号MPI_Comm_dup

但是,我不是OSX动态库的专家,我想知道我的方法和结论是否正确。此外,我愿意接受任何解决此问题的建议。

谢谢,

Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/home/jonathan.lisic/R/x86_64-apple-darwin12.2.0-library/2.15/Rmpi/libs/x86_64/Rmpi.so':
  dlopen(/home/jonathan.lisic/R/x86_64-apple-darwin12.2.0-library/2.15/Rmpi/libs/x86_64/Rmpi.so, 6): Symbol not found: _MPI_Comm_dup
  Referenced from: /opt/local/lib/libmpich.3.3.dylib
  Expected in: flat namespace
 in /opt/local/lib/libmpich.3.3.dylib
Error: package/namespace load failed for Rmpi

jonathan.lisic@server:/opt/local$ otool -L /home/jonathan.lisic/R/x86_64-apple-darwin12.2.0-library/2.15/Rmpi/libs/x86_64/Rmpi.so
/home/jonathan.lisic/R/x86_64-apple-darwin12.2.0-library/2.15/Rmpi/libs/x86_64/Rmpi.so:
        Rmpi.so (compatibility version 0.0.0, current version 0.0.0)
        /opt/local/lib/libmpich.3.3.dylib (compatibility version 0.0.0, current version 3.0.0)
        /opt/local/lib/libmpl.1.dylib (compatibility version 3.0.0, current version 3.0.0)
        /opt/local/lib/libopa.1.dylib (compatibility version 2.0.0, current version 2.0.0)
        /opt/local/lib/R/lib/x86_64/libR.dylib (compatibility version 2.15.0, current version 2.15.1)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1669.0.0)
        /opt/local/lib/gcc45/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

jonathan.lisic@server:/opt/local/lib$ otool -L libmpich.dylib
libmpich.dylib:
        /opt/local/lib/libmpich.3.3.dylib (compatibility version 0.0.0, current version 3.0.0)
        /opt/local/lib/gcc43/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

jonathan.lisic@server:/opt/local/lib$ otool -L libmpich.3.3.dylib
libmpich.3.3.dylib:
        /opt/local/lib/libmpich.3.3.dylib (compatibility version 0.0.0, current version 3.0.0)
        /opt/local/lib/gcc43/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)

jonathan.lisic@server:/opt/local/lib$ nm  -u libmpich.3.3.dylib | egrep dup
_MPI_Comm_dup
_MPL_trstrdup
_dup2
_strdup

1 个答案:

答案 0 :(得分:2)

您正在寻找的符号(或者至少是Rmpi正在寻找的符号)存在于libpmpich.*.dylib中。请注意该名称中的p。为什么这个额外的库存在的细节大多是历史的和无趣的,但确实存在。它包含库中的几乎所有MPI_符号,而libmpich.*.dylib包含库中的所有PMPI_符号以及MPI库的所有实际实现代码。< / p>

我自己从未使用过Rmpi,但也许有一种方法可以将其配置为查看不同的库或向搜索集添加更多库? IIRC,Open MPI不会将这两个库分开,这可能是Rmpi开发人员单库假设的来源。