Warnings about macro offsetof

I’m installing PGI 9.0-3 on a production Linux cluster. We’ve had this version available for “friendly-users” for a couple of months, and had no reports of problems, nor had I seen any in my own testing. Today, I’m getting the following:

PGC-W-0258-Argument 1 in macro offsetof is not identical to previous definition (/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/stddef.h: 414)
PGC-W-0258-Argument 2 in macro offsetof is not identical to previous definition (/usr/lib/gcc/x86_64-redhat-linux/3.4.5/include/stddef.h: 414)

when compiling a trivial OpenMPI C program. I see this with all the OpenMPIs currently available on this cluster, namely, 1.2.4, 1.3.2, 1.3.3, and 1.4.

My first guess was that there was something wrong with my production build, so I went back to my “friendly” 9.0-3 installation. Same warnings - which I did not get previously.

  1. How important is this warning? ;-) Because that’s what my users are going to ask.

  2. It doesn’t look like there have been any changes to the gcc or any of the OpenMPIs in quite a while (except the 1.4 is a much newer build, of course). What else can I look at for possible causes?

The reported problem exists on a RHEL4 cluster. I have separate “friendly” builds on a RHEL5 cluster, and a Fedora 9 cluster, and I do not see the same warning on those clusters.

Digging into the differences, I see that all three clusters have a short “stddef.h” file in the include directory. All three redefine the macro “__builtin_offsetof”. The RHEL4 cluster, and ONLY the RHEL4 cluster, also redefines “offsetof” from the macro in the gcc include file. So help me understand what problem we’re solving here, starting with PGI 9.

We are still trying to figure out how none of the friendly users (including me) ever saw this before today.

Hi Gap,

The GNU definitions for “offsetof” changed between RHEL4 and RHEL5 with the RHEL4 version being incomparable with PGI. Hence, we needed to provide our own definition of “offsetof” on RHEL4.

However, the PGI stddef.h include file first undefines “offsetof” before defining the PGI version. I’m able to recreate your warnings but only if I remove the “undef”. Perhaps your local PGI “stddef.h” file was modified?

  • Mat

I don’t believe the PGI stddef.h was modified; in particular, the “undef” is there. The only time I receive the warnings is when OpenMPI is in the mix. That is, a plain ol’ C compile doesn’t have any problems. So I’m leaning towards worrying that the local OpenMPI builds themselves are dependent on the PGI with which they were built - or rather, pre-9.0 builds aren’t compatible with 9.0, at least in this tiny detail. Sigh.

We skipped version 8, by the way. Due to our conservative change control, I still had version 8 in early testing when 9.0 was released. The production OpenMPIs are built with 7.1-6 and 7.2-5.

More testing tomorrow.