[mpich2-dev] error compiling ROMIO's malloc.c in Fedora 15
Dave Goodell
goodell at mcs.anl.gov
Tue Aug 23 13:34:37 CDT 2011
This probably is happening because MPICH2 redefines "free", "malloc", and "realloc" when configured with --enable-g=mem or --enable-g=all:
http://trac.mcs.anl.gov/projects/mpich2/browser/mpich2/trunk/src/include/mpimem.h#L236
My guess is that the malloc.h include should be moved above any MPICH2/ROMIO internal header includes. The rest of us must not have a malloc.h lying around on our systems to cause this compile error...
-Dave
On Aug 23, 2011, at 1:11 PM CDT, Lisandro Dalcin wrote:
> I'm running Fedora 15. After downloading and unpacking mpich2-1.4
> tarball, configuring, and then build, I get the error below.
>
> After editing src/mpi/romio/adio/common/malloc.c and commenting out
> the block near the beginning including malloc.h, things seems to be
> back to normal.
>
> This smells like a bug in my C stdlib header files, right?
>
>
> $ tar -zxf mpich2-1.4.tar.gz && mpich2-1.4
> $ ./configure --prefix=/home/devel/mpi/mpich2-1.4 --enable-shared
> CFLAGS=-fPIC FFLAGS=-fPIC --enable-g=all
> $ make
>
> ... lots of output ...
>
> compiling ROMIO in directory adio/common
> make[5]: Entering directory
> `/home/devel/BUILD/MPI/mpich2-1.4/src/mpi/romio/adio/common'
> CC malloc.c
> In file included from malloc.c:24:0:
> /usr/include/malloc.h:61:14: error: expected identifier or ‘(’ before
> '\x6c6c6f63'
> /usr/include/malloc.h:64:14: error: expected identifier or ‘(’ before
> '\x6c6c6f63'
> /usr/include/malloc.h:72:49: error: macro "realloc" passed 2
> arguments, but takes just 1
> /usr/include/malloc.h:72:14: error: ‘realloc’ redeclared as different
> kind of symbol
> /usr/include/malloc.h:76:13: error: expected identifier or ‘(’ before
> '\x46726565'
> make[5]: *** [malloc.o] Error 1
> make[5]: Leaving directory
> `/home/devel/BUILD/MPI/mpich2-1.4/src/mpi/romio/adio/common'
> make[4]: *** [mpiolib] Error 1
> make[4]: Leaving directory `/home/devel/BUILD/MPI/mpich2-1.4/src/mpi/romio'
> make[3]: *** [mpio] Error 2
> make[3]: Leaving directory `/home/devel/BUILD/MPI/mpich2-1.4/src/mpi/romio'
> make[2]: *** [all-redirect] Error 1
> make[2]: Leaving directory `/home/devel/BUILD/MPI/mpich2-1.4/src/mpi'
> make[1]: *** [all-redirect] Error 1
> make[1]: Leaving directory `/home/devel/BUILD/MPI/mpich2-1.4/src'
> make: *** [all-redirect] Error 1
>
>
> --
> Lisandro Dalcin
> ---------------
> CIMEC (INTEC/CONICET-UNL)
> Predio CONICET-Santa Fe
> Colectora RN 168 Km 472, Paraje El Pozo
> 3000 Santa Fe, Argentina
> Tel: +54-342-4511594 (ext 1011)
> Tel/Fax: +54-342-4511169
More information about the mpich2-dev
mailing list