0

我正在尝试使用 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
4

1 回答 1

2

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

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

于 2012-10-05T20:43:08.730 回答