Hello,

When building OpenMPI 1.8.4 on Linux using gcc 4.8.2, the build fails for me with errors like:

romio/.libs/libromio_dist.a(delete.o): In function `lstat64':
delete.c:(.text+0x0): multiple definition of `lstat64'
romio/.libs/libromio_dist.a(close.o):close.c:(.text+0x0): first defined here
romio/.libs/libromio_dist.a(fsync.o): In function `lstat64':
fsync.c:(.text+0x0): multiple definition of `lstat64'
romio/.libs/libromio_dist.a(close.o):close.c:(.text+0x0): first defined here
romio/.libs/libromio_dist.a(get_amode.o): In function `lstat64':
get_amode.c:(.text+0x0): multiple definition of `lstat64'
romio/.libs/libromio_dist.a(close.o):close.c:(.text+0x0): first defined here

and so on for a bunch more files. I think I (vaguely) understand the problem. I'm not sure whether a "fix" is possible or appropriate, but I'm reporting it anyway since I've tracked it down.

It builds perfectly fine with gcc 4.2.0. It also builds perfectly fine with gcc 4.8.2 if I supply CFLAGS=-fgnu89-inline on the ./configure command line (and that's our current workaround). I hope this is safe to do. The reason I tried using this flag was because of the following vaguely related-looking pages Google was kind enough to show me:

http://lifecs.likai.org/2009/06/multiple-definition-of-extern-inline.html
https://gcc.gnu.org/gcc-4.3/porting_to.html

These pages made it sound like the "multiple definition" errors are because of "extern inline" declarations being used somewhere and the fact that OpenMPI apparently uses -std=c99. -fgnu89-inline simply requests the old pre-gcc-4.3 GNU-specific interpretation of "extern inline", instead of the c99 interpretation, so the lstat64() function doesn't wind up in your object files.

My best guess is that it has to do with the fact that we're using a modern compiler, but on a relatively old system (Red Hat Enterprise Linux 5.11) so lstat64() is being declared extern inline because the old system include files don't expect the new gcc behavior. However, we haven't seen this before when building other packages, just OpenMPI.

Perhaps there is a way to detect this and include the flag automatically. I noticed one other message in the archives from someone else having this problem, but it was a while back and there were no replies. So perhaps this would be helpful to others.

Just to be thorough, I've attached the configure and make output for the case that triggers the issue. I'm configuring with:

  ./configure --prefix=/opt/depot/openmpi/1.8.4 CC=gcc CXX=g++ FC=gfortran

Thank you,

Jesse Ziser
Applied Research Laboratories:
The University of Texas at Austin

Attachment: ompi-output.tar.bz2
Description: Binary data

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to