[Intel MPI 3.2] Static linking : libclibmpich multiple symbol definitions

[Intel MPI 3.2] Static linking : libclibmpich multiple symbol definitions

Hello,

Assume there is an objective to compile a pure static program using Intel MPI 3.2. Here's what I'm getting on the linking step:

/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(viainit.o): In function `MPID_VIA_Init':
viainit.c:(.text+0x8c5): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib64/libc.a(malloc.o): In function `__malloc_check_init':
malloc.c:(.text+0xbc0): multiple definition of `__malloc_check_init'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x6082): first defined here
ld: Warning: size of symbol `__malloc_check_init' changed from 144 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 103 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `_int_free':
malloc.c:(.text+0x1be0): multiple definition of `_int_free'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x22d0): first defined here
ld: Warning: size of symbol `_int_free' changed from 1012 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 1209 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `_int_malloc':
malloc.c:(.text+0x2170): multiple definition of `_int_malloc'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0xe1e): first defined here
ld: Warning: size of symbol `_int_malloc' changed from 4520 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 3282 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `_int_memalign':
malloc.c:(.text+0x2e50): multiple definition of `_int_memalign'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x71c): first defined here
ld: Warning: size of symbol `_int_memalign' changed from 494 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 550 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `_int_valloc':
malloc.c:(.text+0x3180): multiple definition of `_int_valloc'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x3d50): first defined here
ld: Warning: size of symbol `_int_valloc' changed from 416 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 62 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `_int_realloc':
malloc.c:(.text+0x32b0): multiple definition of `_int_realloc'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x1fc6): first defined here
ld: Warning: size of symbol `_int_realloc' changed from 778 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 1072 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `free':
malloc.c:(.text+0x20a0): multiple definition of `free'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0xb7a): first defined here
ld: Warning: size of symbol `free' changed from 302 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 200 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `malloc':
malloc.c:(.text+0x3a50): multiple definition of `malloc'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0xca8): first defined here
ld: Warning: size of symbol `malloc' changed from 374 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 466 in /usr/lib64/libc.a(malloc.o)
/usr/lib64/libc.a(malloc.o): In function `realloc':
malloc.c:(.text+0x3ed0): multiple definition of `realloc'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x942): first defined here
ld: Warning: size of symbol `realloc' changed from 568 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 691 in /usr/lib64/libc.a(malloc.o)
Lib/Nix/Release//libibverbs.a(src_libibverbs_la-init.o): In function `ibverbs_init':
/root/libibverbs-1.1.2/src/init.c:500: warning: Using 'dlopen' in statically linked applicationsrequires at runtime the shared libraries from the glibc version used for linking
make: *** [Release] 1

Are there any suggestions - how can I resolve multiple symbol definitions between libc and libmpich?

Thanks in advance!

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting - maemarcus

Assume there is an objective to compile a pure static program using Intel MPI 3.2.

malloc.c:(.text+0xbc0): multiple definition of `__malloc_check_init'
/usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o):malloc.c:(.text+0x6082): first defined here
ld: Warning: size of symbol `__malloc_check_init' changed from 144 in /usr/lib/mvapich-intel-x86_64/lib/libmpich.a(malloc.o) to 103 in /usr/lib64/libc.a(malloc.o)

I don't think mixtures of mvapich and Intel MPI can be supported. The build has to be done entirely with the headers and libraries of one or the other, even though they ought to be source code compatible and bear some resemblance in functionality.
If, contrary to your opening statement, you are using mvapich, not Intel MPI, you will need to stick with one version of MPI. You may need to rebuild the mvapich against the glibc you intend to use. In my limited experience with mvapich, you must be extremely careful about versions.

Quoting - tim18

I don't think mixtures of mvapich and Intel MPI can be supported. The build has to be done entirely with the headers and libraries of one or the other, even though they ought to be source code compatible and bear some resemblance in functionality.
If, contrary to your opening statement, you are using mvapich, not Intel MPI, you will need to stick with one version of MPI. You may need to rebuild the mvapich against the glibc you intend to use. In my limited experience with mvapich, you must be extremely careful about versions.

Hello, Tim,

Ops, I'm sorrry, I have to switch on Intel MPI, and that was just MVAPICH coompiled with intel compilers...

Leave a Comment

Please sign in to add a comment. Not a member? Join today