MPICH from macports missing symbols
Pergunta
I'm trying to write a program with Rmpi, unfortunately a symbol required is undefined, and tracking it down with otool and nm seems to just lead me to libmpich.3.3.dylib
. Unfortunately the symbol MPI_Comm_dup
, is undefined in this dynamic library.
However, I'm not an expert on OSX dynamic libraries, and am wondering if I am correct in my approach and conclusion. Furthermore I am open to any suggestions to resolve this issue.
Thanks,
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
Solução
The symbol you are looking for (or at least, Rmpi is looking for) lives in libpmpich.*.dylib
. Note the p
in that name. The details of why this extra library exists are mostly historical and uninteresting, but it does exist. It contains almost all of the MPI_
symbols in the library, while libmpich.*.dylib
contains all of the PMPI_
symbols in the library as well as all of the actual implementation code for the MPI library.
I've never used Rmpi myself, but perhaps there's a way to configure it to look in a different library or to add more libraries to the searched set? IIRC, Open MPI does not separate these two libraries, which could be the source of a single-library assumption by the Rmpi developers.