On 05/22/2012 10:34 PM, Orion Poplawski wrote:
> On 05/21/2012 06:15 PM, Jeff Squyres wrote:
>> On May 15, 2012, at 10:37 AM, Orion Poplawski wrote:
>>> $ mpicc -showme:link
>>> -pthread -m64 -L/usr/lib64/openmpi/lib -lmpi -ldl -lhwloc
>>> -ldl and -lhwloc should not be listed. The user should only link
>>> against libraries that they are using directly, namely -lmpi, and
>>> they should explicitly add -ldl and -lhwloc if their code directly
>>> uses those libraries. There does not appear to be any references to
>>> libdl or libhwloc symbols in the openmpi headers which is the other
>>> place it could come in.
>> I just read this a few times, and I admit that I'm a little confused.
>> libmpi does use symbols from libdl; we use it to load OMPI's plugins.
>> So I'm not sure why you're saying we shouldn't -ldl in the wrapper
>> libhwloc might be a little questionable here -- I'll have to check to
>> see whether 1.6 uses hwloc only in a plugin or whether it's used in
>> the base library (I don't remember offhand).
> But libmpi is already linked against libdl and libhwloc. The wrapper
> libraries are added when linking user code. But unless a user's code
> directly uses libdl or libhwloc they don't need to link to those libraries.
I should add the caveat that they are need when linking statically, but
not when using shared libraries.
Technical Manager 303-415-9701 x222
NWRA/CoRA Division FAX: 303-415-9702
3380 Mitchell Lane orion_at_[hidden]
Boulder, CO 80301 http://www.cora.nwra.com