[mpich-discuss] statically linked mpiexec

Andy May MayAJ1 at cardiff.ac.uk
Tue Apr 8 06:28:02 CDT 2014


Ken,

Thanks, that improves things such that the number of shared libraries 
being referenced decreases, but it's still not quite there yet:

./configure --with-device=ch3:nemesis --with-pm=hydra CFLAGS=-static 
--disable-shared

ldd ../install/bin/mpiexec
         linux-vdso.so.1 (0x00007fff435fe000)
         libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fc8c4d2a000)
         libm.so.6 => /lib64/libm.so.6 (0x00007fc8c4a27000)
         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc8c4809000)
         libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fc8c45f2000)
         libc.so.6 => /lib64/libc.so.6 (0x00007fc8c4243000)
         libdl.so.2 => /lib64/libdl.so.2 (0x00007fc8c403f000)
         /lib64/ld-linux-x86-64.so.2 (0x00007fc8c4f42000)

I tried also adding 'LDFLAGS=-static' too, it doesn't change anything. 
Any ideas?

Thanks,

Andy

On 07/04/14 15:58, Kenneth Raffenetti wrote:
> Ah, sorry. I misread your first email and assumed you were only talking
> about the MPICH libraries and compiler wrappers.
>
> The Intel compilers should accept a '-static' flag that will force link
> all libraries statically. Try adding it to your CFLAGS to force this
> behavior on mpiexec.
>
> Ken
>
> On 04/07/2014 09:50 AM, Andy May wrote:
>> Ken,
>>
>> The '--disable-shared' flag removes some of the external references (to
>> the Intel compiler in my case) but still leaves:
>>
>> ldd ./bin/mpiexec
>>          linux-vdso.so.1 (0x00007fff7a7b9000)
>>          libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f3298e3f000)
>>          libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3298c21000)
>>          libpciaccess.so.0 => /usr/lib64/libpciaccess.so.0
>> (0x00007f3298a17000)
>>          libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x00007f32986ac000)
>>          libdl.so.2 => /lib64/libdl.so.2 (0x00007f32984a8000)
>>          libz.so.1 => /lib64/libz.so.1 (0x00007f3298292000)
>>          liblzma.so.5 => /usr/lib64/liblzma.so.5 (0x00007f329806c000)
>>          libm.so.6 => /lib64/libm.so.6 (0x00007f3297d69000)
>>          libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3297b52000)
>>          libc.so.6 => /lib64/libc.so.6 (0x00007f32977a3000)
>>          /lib64/ld-linux-x86-64.so.2 (0x00007f3299057000)
>>
>> whereas what I did gives:
>>
>> ldd ./bin/mpiexec
>>          not a dynamic executable
>>
>> Is there any option to ensure fully statically linked mpiexec via
>> configure?
>>
>> Thanks,
>>
>> Andy
>>
>> On 07/04/14 13:26, Kenneth Raffenetti wrote:
>>> Andy,
>>>
>>> The official way is to add '--disable-shared' to your configure line.
>>>
>>> Ken
>>>
>>> On 04/07/2014 05:47 AM, Andy May wrote:
>>>> Hi,
>>>>
>>>> Does anyone know if there is a supported or recommended way to build
>>>> MPICH such that it's binaries (eg. mpiexec) are statically linked?
>>>>
>>>> At present, post building I'm running:
>>>>
>>>> cd src/pm/hydra
>>>> eval ./configure `./config.status --config` --disable-pci
>>>> --disable-libxml2
>>>> make CCLD='$(CC) -all-static'
>>>>
>>>> which just disables two cases where the static libraries aren't
>>>> available, then links statically, but is there a better or correct way
>>>> to do this?
>>>>
>>>> Many thanks,
>>>>
>>>> Andy
>>>> _______________________________________________
>>>> discuss mailing list     discuss at mpich.org
>>>> To manage subscription options or unsubscribe:
>>>> https://lists.mpich.org/mailman/listinfo/discuss
>>> _______________________________________________
>>> discuss mailing list     discuss at mpich.org
>>> To manage subscription options or unsubscribe:
>>> https://lists.mpich.org/mailman/listinfo/discuss
>> _______________________________________________
>> discuss mailing list     discuss at mpich.org
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/discuss
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss



More information about the discuss mailing list