Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] 1.5rc5 has been posted
From: Larry Baker (baker_at_[hidden])
Date: 2010-08-23 20:29:22


The PGI C compiler complains (issues a warning) for the redefinition
of the assert macro in opal/mca/memory/ptmalloc2/malloc.c:

Making all in mca/memory/ptmalloc2
make[2]: Entering directory `/home/baker/openmpi-1.5rc5/opal/mca/
memory/ptmalloc2'
   CC opal_ptmalloc2_component.lo
   CC opal_ptmalloc2_munmap.lo
   CC malloc.lo
PGC-W-0221-Redefinition of symbol assert (/usr/include/assert.h: 51)
PGC-W-0258-Argument 1 in macro assert is not identical to previous
definition (/usr/include/assert.h: 51)

FYI. assert.h is an unusual include file -- it does not use an ifdef
guard macro in the usual way, but undef's assert if the guard macro is
defined (NOT if assert is defined, which is the root cause of this
warning), define's the guard macro, then (re)define's assert() based
on the current value of NDEBUG.

opal/mca/memory/ptmalloc2/malloc.c did not change from OpenMPI 1.4.2.
malloc.c include's opal/mca/memory/ptmalloc2/hooks.c, which did change
in OpenMPI 1.5rc5. hooks.c indirectly include's <assert.h> through
opal/mca/base/mca_base_param.h. This is where the warning occurs.

malloc.c define's its own assert macro in lines 364-369:

364 #if MALLOC_DEBUG
365 #include <assert.h>
366 #else
367 #undef assert
368 #define assert(x) ((void)0)
369 #endif

The warning occurs because the definition of assert in line 368 is not
the same as the definition in <assert.h>:

# define assert(expr) (__ASSERT_VOID_CAST (0))

However, there is no reason to define assert here -- the only code in
malloc.c that needs assert is already inside an #if ! MALLOC_DEBUG
conditional at line 2450.

The fix is to delete lines 364-396 in opal/mca/memory/ptmalloc2/
malloc.c and move the #include <assert.h> to be inside the conditional
between lines 2459 and 2461:

2459 #else

      #include <alloc.h>

2461 #define check_chunk(A,P) do_check_chunk(A,P)

Larry Baker
US Geological Survey
650-329-5608
baker_at_[hidden]

On Aug 17, 2010, at 2:18 PM, Jeff Squyres wrote:

> We still have one known possible regression:
>
> https://svn.open-mpi.org/trac/ompi/ticket/2530
>
> But we posted rc5 anyway (there's a bunch of stuff that has been
> pending for a while that is now in). Please test!
>
> http://www.open-mpi.org/software/ompi/v1.5/
>
> --
> Jeff Squyres
> jsquyres_at_[hidden]
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
>
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel