Project

General

Profile

Bug #258

libmd.so and libgmx.so are not linked vs. each other

Added by Martin Hoefling about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Created an attachment (id=325)
adds links between libmd and libgmx for shared libraries

The two dynamic libraries aren't linked vs each other. This can lead to problems if one is loaded, e.g. via ctypes in python. No problems in c programs though. I suggest linking them dynamically vs. each other.

The attached patch works for me (after bootstraping).

dynamic_linking.patch (4.92 KB) dynamic_linking.patch adds links between libmd and libgmx for shared libraries Martin Hoefling, 11/12/2008 08:44 PM
nrnb.c (19.2 KB) nrnb.c nrnb.c with gmx_pmeonlynode call Berk Hess, 11/13/2008 02:23 PM

History

#1 Updated by Berk Hess about 11 years ago

The libraries were originally set up such that gmxlib
does not depend on anything and mdlib depends on gmxlib.

Is gmx_pmeonlynode the only function in mdlib that gmxlib calls?
We should move gmx_pmeonlynode from domdec.c to gmxlib,
maybe main.c.

Berk

#2 Updated by Berk Hess about 11 years ago

Created an attachment (id=326)
nrnb.c with gmx_pmeonlynode call

#3 Updated by Berk Hess about 11 years ago

Actually gmx_pmeonlynode was not required in nrnb.c.
I have removed the call in the cvs head and 4.0 release branch.

Can somebody try the attached (or cvs) nrnb.c to see
if this resolves the dependency issues?

Berk

#4 Updated by Martin Hoefling about 11 years ago

OK, so then only mdlib should be linked vs gmxlib.

nm -u libgmx.so | grep -v GLIBC
w _Jv_RegisterClasses
w gmon_start
U gmx_pmeonlynode

Looks to me as if it's the only one.

#5 Updated by Berk Hess about 11 years ago

I guess that fixed the bug then.

Berk

#6 Updated by Martin Hoefling about 11 years ago

Yes, the dependency issue should be solved, but shouldn't libmd be linked vs libgmx in case of shared libraries since it uses symbols of libgmx? Otherwise, one needs to manually load libgmx before in some cases.

#7 Updated by Berk Hess about 11 years ago

I don't know enough about this topic to understand what you mean.
Apparently in C this is no problem, you can just put both libraries
on the link line.

For python you apparently have to give both in the correct order.

What do you mean with linking one library vs. the other?

Berk

#8 Updated by Erik Lindahl almost 11 years ago

Fixed, I think. At least libmd is now linked against libgmx :-)

Also available in: Atom PDF