I am building/using the python module for LAMMPS, which is the open source Molecular Dynamics simulator (project home, source).
The python module works by compiling the C++ application as a library, and using CDLL/ctypes to call a C function interface. When you call the CDLL() function in python, the load fails if there are any missing symbols that the OS doesn’t find in the library itself, and can’t load from other available libraries.
The particular symbol I’m getting as missing is a C++ mangled name __ZN3MPI3Win14Set_errhandlerERKNS_10ErrhandlerE, which is probably MPI_Win_set_errhandler (or some namespaced/object oriented equivilent with a similar name). For context, I’ve compiled it using the python/setup_serial.py file, which should build with a dummy MPI interface, and shouldn’t reference any real MPI symbols at all; so this is a rogue reference that’s crept in somewhere. I’ve also made some modifications to the source, but I get the same error when I disable all my changes.
My question is, what is the best debugging strategy for finding out where a symbol is referenced in a dynamic library giving this sort of error? So far, I’ve tried searching the source for references to this symbol (or parts of the name,) but I’m not finding any instances (in fact, the only results are the binary files from the python build process, of the library I’m having trouble importing.)
My next step is to search inside the binary somehow, I guess, but I have no idea where to begin that (or some other strategy).
c++filt is your friend
Now do a quick google search on that library
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512616
Looks like there is a case where parts are upgraded but not recompiled. The second thing is to look at the link line for the complier and see what libraries it includes.
Final last resort is to do something like:
And start grepping around to see if it’s defined somewhere.