Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] mpicc link shouldn't add -ldl and -lhwloc
From: Orion Poplawski (orion_at_[hidden])
Date: 2012-05-23 00:34:58


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 compiler...?
>
> 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.

-- 
Orion Poplawski
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