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: Entering directory `/home/baker/openmpi-1.5rc5/opal/mca/
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>
367 #undef assert
368 #define assert(x) ((void)0)
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:
2461 #define check_chunk(A,P) do_check_chunk(A,P)
US Geological Survey
On Aug 17, 2010, at 2:18 PM, Jeff Squyres wrote:
> We still have one known possible regression:
> But we posted rc5 anyway (there's a bunch of stuff that has been
> pending for a while that is now in). Please test!
> Jeff Squyres
> For corporate legal information go to:
> devel mailing list