[mpich2-dev] error compiling ROMIO's malloc.c in Fedora 15

Larry Baker baker at usgs.gov
Tue Aug 23 14:06:44 CDT 2011


I would have thought #include <malloc.h> would have been replaced with  
#include <stdlib.h> starting over 20 years ago with C89.  Old coding  
habits have caused me problems with other packages because there is no  
malloc.h system include file on a Mac, for example.  Is it rational to  
examine the MPICH2 code base and upgrade the #include <malloc.h>'s to  
#include <stdlib.h>?

Larry Baker
US Geological Survey
650-329-5608
baker at usgs.gov

On 23 Aug 2011, at 11:11 AM, 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