I can confirm this on Fedora 20 with gcc 4.8.3.
Running ./configure without any options gives me the same error.
On Mon, Aug 04, 2014 at 04:24:29PM +0000, Pritchard Jr., Howard wrote:
> Hi Ralph,
>
> Nope that doesn't fix the problem I'm hitting. I tried to build the opmi
> trunk
> on a system with a much older gcc compiler (4.4.7) and it compiled :)! But
> I'd like to be able to compile opmi with a newer gcc like the one on my
> opensuse
> 13.1 box.
>
> The preprocessor is pulling in the system malloc.h and that's where things
> blow up:
>
> CC base/mpool_base_frame.lo
> In file included from ../../../opal/include/opal_config.h:2750:0,
> from base/mpool_base_frame.c:21:
> ../../../opal/include/opal_config_bottom.h:381:38: error: expected
> declaration specifiers or '...' before '(' token
> # define malloc(size) opal_malloc((size), __FILE__, __LINE__)
> ^
> In file included from base/mpool_base_frame.c:28:0:
> /usr/include/malloc.h:38:1: error: expected declaration specifiers or '...'
> before string constant
> extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
> ^
> /usr/include/malloc.h:38:1: error: expected declaration specifiers or '...'
> before numeric constant
> In file included from ../../../opal/include/opal_config.h:2750:0,
> from base/mpool_base_frame.c:21:
> ../../../opal/include/opal_config_bottom.h:385:48: error: expected
> declaration specifiers or '...' before '(' token
> # define calloc(nmembers, size) opal_calloc((nmembers), (size), __FILE__,
> __LINE__)
> ^
> ../../../opal/include/opal_config_bottom.h:385:60: error: expected
> declaration specifiers or '...' before '(' token
> # define calloc(nmembers, size) opal_calloc((nmembers), (size), __FILE__,
> __LINE__)
> ^
> In file included from base/mpool_base_frame.c:28:0:
> /usr/include/malloc.h:41:1: error: expected declaration specifiers or '...'
> before string constant
> extern void *calloc (size_t __nmemb, size_t __size)
> ^
> /usr/include/malloc.h:41:1: error: expected declaration specifiers or '...'
> before numeric constant
> In file included from ../../../opal/include/opal_config.h:2750:0,
> from base/mpool_base_frame.c:21:
> ../../../opal/include/opal_config_bottom.h:389:45: error: expected
> declaration specifiers or '...' before '(' token
> # define realloc(ptr, size) opal_realloc((ptr), (size), __FILE__, __LINE__)
> ^
> ../../../opal/include/opal_config_bottom.h:389:52: error: expected
> declaration specifiers or '...' before '(' token
> # define realloc(ptr, size) opal_realloc((ptr), (size), __FILE__, __LINE__)
> ^
> In file included from base/mpool_base_frame.c:28:0:
> /usr/include/malloc.h:49:1: error: expected declaration specifiers or '...'
> before string constant
> extern void *realloc (void *__ptr, size_t __size)
> ^
> /usr/include/malloc.h:49:1: error: expected declaration specifiers or '...'
> before numeric constant
> In file included from ../../../opal/include/opal_config.h:2750:0,
> from base/mpool_base_frame.c:21:
> ../../../opal/include/opal_config_bottom.h:393:33: error: expected
> declaration specifiers or '...' before '(' token
> # define free(ptr) opal_free((ptr), __FILE__, __LINE__)
> ^
> In file included from base/mpool_base_frame.c:28:0:
> /usr/include/malloc.h:53:1: error: expected declaration specifiers or '...'
> before string constant
> extern void free (void *__ptr) __THROW;
> ^
> /usr/include/malloc.h:53:1: error: expected declaration specifiers or '...'
> before numeric constant
>
>
>
> From: devel [mailto:[email protected]] On Behalf Of Ralph Castain
> Sent: Monday, August 04, 2014 10:09 AM
> To: Open MPI Developers
> Subject: Re: [OMPI devel] opal_config_bottom.h question again
>
> I believe the issue is actually in opal/util/malloc.h, Howard. I noticed this
> while looking around this weekend - someone included opal_config.h in the
> malloc.h file even though it explicitly says "DON'T DO THIS" in that header
> file.
>
> #ifndef OPAL_MALLOC_H
> #define OPAL_MALLOC_H
>
> #include "opal_config.h"
> #include <stdlib.h>
>
> /*
> * THIS FILE CANNOT INCLUDE ANY OTHER OPAL HEADER FILES!!!
> *
> * It is included via <opal_config_bottom.h>. Hence, it should not
> * include ANY other files, nor should it include "opal_config.h".
> *
> */
>
> Don't know why someone did that, but you might see if it fixes your problem
>
>
> On Aug 4, 2014, at 9:00 AM, Pritchard Jr., Howard
> <[email protected]<mailto:[email protected]>> wrote:
>
>
> Hi Folks,
>
> As I said last week, I'm noticing now that on my opensuse 13.1 system and gcc
> 4.8.1, when I do a fresh
> checkout of trunk ompi and try to build, without any configure options,
>
> mca_base_mpool_frame.c
>
> does not compile.
>
> The reason is there is a conflict in opal_config_bottom.h and the contents of
> malloc.h,
> which for my system is pulled in by the preprocessor.
>
> If I undefine HAVE_MALLOC_H in this file, the code compiles fine.
> Alternatively,
> one can also move the malloc.h include prior to the opal_config.h include and
> things
> work. Alternatively, one can add the OPAL_DISABLE_ENABLE_MEM_DEBUG define
> as in mpool_base_lookup.c , and the compile problem similarly goes away.
>
> I'd like to check in a fix for this. I'd prefer to just move the std include
> files ahead
> of the opal_config.h include. I'd like to do this today unless someone
> objects.
>
> I'm somewhat surprised I'm the only one seeing this though.
>
> Howard
>
>
> -------------------------------------------------
> Howard Pritchard
> HPC-5
> Los Alamos National Laboratory
>
>
> _______________________________________________
> devel mailing list
> [email protected]<mailto:[email protected]>
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/08/15495.php
>
> _______________________________________________
> devel mailing list
> [email protected]
> Subscription: http://www.open-mpi.org/mailman/listinfo.cgi/devel
> Link to this post:
> http://www.open-mpi.org/community/lists/devel/2014/08/15497.php