[gmx-developers] shared libraries - unresolved symbols issue

Martin Höfling martin.hoefling at gmx.de
Wed Nov 12 15:33:58 CET 2008


Am Mittwoch 12 November 2008 15:05:56 schrieb David van der Spoel:

> No, this is due to crosslinking between libraries. It may help to list
> one or both of the two twice:
> -lmd -lgmx -lmd -lgmx

Well, this is the problem. Via ctypes, I can only load one library at a time. 
Linking in a c problem works for me withouth specifying the md and gmx twice 
here.

Creating a dummy library - linking vs both and loading this first via ctypes 
works: I created an "empty" testlib.so, linked vs md and gmx and loaded this 
one first:

In [1]: import ctypes
In [2]: tlib=ctypes.cdll.LoadLibrary("/usr/local/lib/testlib.so")
In [3]: libmd=ctypes.cdll.LoadLibrary("libmd.so")
In [4]: libgmx=ctypes.cdll.LoadLibrary("libgmx.so")

Wouldn't be the proper solution to link the gromacs shared libraries vs. each 
other? Maybe by adding -lmd and -lgmx to the LDFLAGS section in Makefile.in?

Best
        Martin




More information about the gromacs.org_gmx-developers mailing list