PGI 13.2 and openmpi 1.6.4

The issue I am about to describe has been brought up in the past with previous versions of PGI and openMPI, however, I am now running into the issue with 13.2 and can’t figure it out.

OS: CentOS release 6.3 (Final)
PGI compiler: 13.2
openMPI: 1.6.4

Trying to configure openMPI

../openmpi-1.6.4/configure CC=pgcc CPP="pgcc -E" CXX=pgCC F77=pgf77 FC=pgfortran --with-devel-headers --with-mpi-f90-size=medium

Getting configure error:

checking for C/C++ restrict keyword... __restrict
checking for weak symbol support... yes
checking for functional offsetof macro... no
configure: WARNING: Your compiler does not support offsetof macro
configure: error: Configure: Cannot continue

Anyone have any ideas?

Thanks

Hi Brad,

I’m able to configure OpenMP 1.6.4 without issues. Granted, I’m using CentOS 6.2 so there is a slight difference.


checking size of _Bool… 1
checking for inline… inline
checking for C/C++ restrict keyword… __restrict
checking for weak symbol support… yes
checking for functional offsetof macro… yes

*** C++ compiler and preprocessor

Can you please look in the “config.log” file and see what the actual failure is as well as the failing code?

Thanks,
Mat

Thanks for taking a look at this Mat, here is the information you requested out of the config.log, I will try this on an earlier CentOS release, but I want to get this working on 6.3 if possible.

The snippet from the config.log is quite lengthy and then it appears to repeat once again with the CPPFLAGS -DNO_PGI_OFFSET set for the pgcc compile the second time around:

configure:15583: checking for functional offsetof macro
configure:15596: pgcc -c -DNDEBUG -g  conftest.c >&5
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword struct (conftest.c: 139)
PGC-S-0039-Use of undeclared variable foo (conftest.c: 139)
PGC-S-0039-Use of undeclared variable b (conftest.c: 139)
PGC/x86-64 Linux 13.2-0: compilation completed with severe errors
configure:15596: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Open MPI"
| #define PACKAGE_TARNAME "openmpi"
| #define PACKAGE_VERSION "1.6.4"
| #define PACKAGE_STRING "Open MPI 1.6.4"
| #define PACKAGE_BUGREPORT "http://www.open-mpi.org/community/help/"
| #define PACKAGE_URL ""
| #define OPAL_ARCH "x86_64-unknown-linux-gnu"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define __EXTENSIONS__ 1
| #define _ALL_SOURCE 1
| #define _GNU_SOURCE 1
| #define _POSIX_PTHREAD_SEMANTICS 1
| #define _TANDEM_SOURCE 1
| #define OMPI_MAJOR_VERSION 1
| #define OMPI_MINOR_VERSION 6
| #define OMPI_RELEASE_VERSION 4
| #define OMPI_GREEK_VERSION ""
| #define OMPI_VERSION "4"
| #define OMPI_RELEASE_DATE "Feb 19, 2013"
| #define ORTE_MAJOR_VERSION 1
| #define ORTE_MINOR_VERSION 6
| #define ORTE_RELEASE_VERSION 4
| #define ORTE_GREEK_VERSION ""
| #define ORTE_VERSION "4"
| #define ORTE_RELEASE_DATE "Feb 19, 2013"
| #define OPAL_MAJOR_VERSION 1
| #define OPAL_MINOR_VERSION 6
| #define OPAL_RELEASE_VERSION 4
| #define OPAL_GREEK_VERSION ""
| #define OPAL_VERSION "4"
| #define OPAL_RELEASE_DATE "Feb 19, 2013"
| #define OPAL_ENABLE_PROGRESS_THREADS 0
| #define OPAL_ENABLE_MEM_DEBUG 0
| #define OPAL_ENABLE_MEM_PROFILE 0
| #define OPAL_ENABLE_DEBUG 0
| #define OPAL_WANT_PRETTY_PRINT_STACKTRACE 1
| #define OPAL_ENABLE_PTY_SUPPORT 1
| #define OPAL_ENABLE_HETEROGENEOUS_SUPPORT 0
| #define OPAL_ENABLE_TRACE 0
| #define OPAL_ENABLE_FT 0
| #define OPAL_ENABLE_FT_CR 0
| #define OPAL_WANT_HOME_CONFIG_FILES 1
| #define OPAL_ENABLE_IPV6 0
| #define OPAL_PACKAGE_STRING "Open MPI JohnDoe@FQHN-hostname Distribution"
| #define OPAL_IDENT_STRING "1.6.4"
| #define OPAL_MAX_PROCESSOR_NAME 256
| #define OPAL_MAX_ERROR_STRING 256
| #define OPAL_MAX_OBJECT_NAME 64
| #define OPAL_MAX_INFO_KEY 36
| #define OPAL_MAX_INFO_VAL 256
| #define OPAL_MAX_PORT_NAME 1024
| #define OPAL_MAX_DATAREP_STRING 128
| #define ORTE_DISABLE_FULL_SUPPORT 0
| #define ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT 0
| #define OMPI_WANT_MPI_INTERFACE_WARNING 0
| #define OMPI_GROUP_SPARSE 0
| #define OMPI_WANT_PERUSE 0
| #define OMPI_WANT_MPI_CXX_SEEK 1
| #define MPI_PARAM_CHECK ompi_mpi_param_check
| #define OPAL_CC "pgcc"
| #define STDC_HEADERS 1
| #define _GNU_SOURCE 1
| #define OPAL_C_HAVE_BUILTIN_EXPECT 1
| #define OPAL_C_HAVE_BUILTIN_PREFETCH 0
| #define OPAL_CC_USE_PRAGMA_IDENT 1
| #define OPAL_CC_USE_IDENT 0
| #define OPAL_CC_USE_PRAGMA_COMMENT
| #define OPAL_CC_USE_CONST_CHAR_IDENT 0
| #define HAVE_INT8_T 1
| #define HAVE_UINT8_T 1
| #define HAVE_INT16_T 1
| #define HAVE_UINT16_T 1
| #define HAVE_INT32_T 1
| #define HAVE_UINT32_T 1
| #define HAVE_INT64_T 1
| #define HAVE_UINT64_T 1
| #define HAVE_LONG_LONG 1
| #define HAVE_LONG_DOUBLE 1
| #define HAVE_FLOAT__COMPLEX 1
| #define HAVE_DOUBLE__COMPLEX 1
| #define HAVE_LONG_DOUBLE__COMPLEX 1
| #define HAVE_INTPTR_T 1
| #define HAVE_UINTPTR_T 1
| #define HAVE_MODE_T 1
| #define HAVE_SSIZE_T 1
| #define HAVE_PTRDIFF_T 1
| #define SIZEOF_CHAR 1
| #define SIZEOF_SHORT 2
| #define SIZEOF_INT 4
| #define SIZEOF_LONG 8
| #define SIZEOF_LONG_LONG 8
| #define SIZEOF_FLOAT 4
| #define SIZEOF_DOUBLE 8
| #define SIZEOF_LONG_DOUBLE 8
| #define SIZEOF_FLOAT__COMPLEX 8
| #define SIZEOF_DOUBLE__COMPLEX 16
| #define SIZEOF_LONG_DOUBLE__COMPLEX 16
| #define SIZEOF_VOID_P 8
| #define SIZEOF_SIZE_T 8
| #define SIZEOF_SSIZE_T 8
| #define SIZEOF_PTRDIFF_T 8
| #define SIZEOF_WCHAR_T 4
| #define OPAL_ALIGNMENT_BOOL 1
| #define OPAL_ALIGNMENT_INT8 1
| #define OPAL_ALIGNMENT_INT16 2
| #define OPAL_ALIGNMENT_INT32 4
| #define OPAL_ALIGNMENT_INT64 8
| #define OPAL_ALIGNMENT_CHAR 1
| #define OPAL_ALIGNMENT_SHORT 2
| #define OPAL_ALIGNMENT_WCHAR 4
| #define OPAL_ALIGNMENT_INT 4
| #define OPAL_ALIGNMENT_LONG 8
| #define OPAL_ALIGNMENT_LONG_LONG 8
| #define OPAL_ALIGNMENT_FLOAT 4
| #define OPAL_ALIGNMENT_DOUBLE 8
| #define OPAL_ALIGNMENT_LONG_DOUBLE 8
| #define OPAL_ALIGNMENT_FLOAT_COMPLEX 4
| #define OPAL_ALIGNMENT_DOUBLE_COMPLEX 8
| #define OPAL_ALIGNMENT_LONG_DOUBLE_COMPLEX 8
| #define OPAL_ALIGNMENT_VOID_P 8
| #define OPAL_NEED_C_BOOL 1
| #define SIZEOF__BOOL 1
| #define restrict __restrict
| /* end confdefs.h.  */
| #include<stddef.h>
| int
| main ()
| {
| struct foo {int a, b;}; size_t offset = offsetof(struct foo, b);
|   ;
|   return 0;
| }

configure:15615: pgcc -c -DNDEBUG -g  -DNO_PGI_OFFSET conftest.c >&5
PGC-S-0037-Syntax error: Recovery attempted by deleting keyword struct (conftest.c: 139)
PGC-S-0039-Use of undeclared variable foo (conftest.c: 139)
PGC-S-0039-Use of undeclared variable b (conftest.c: 139)
PGC/x86-64 Linux 13.2-0: compilation completed with severe errors
configure:15615: $? = 2
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Open MPI"
| #define PACKAGE_TARNAME "openmpi"
| #define PACKAGE_VERSION "1.6.4"
| #define PACKAGE_STRING "Open MPI 1.6.4"
| #define PACKAGE_BUGREPORT "http://www.open-mpi.org/community/help/"
| #define PACKAGE_URL ""
| #define OPAL_ARCH "x86_64-unknown-linux-gnu"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
.
.
.
| #define OPAL_NEED_C_BOOL 1
| #define SIZEOF__BOOL 1
| #define restrict __restrict
| /* end confdefs.h.  */
| #include<stddef.h>
| int
| main ()
| {
| struct foo {int a, b;}; size_t offset = offsetof(struct foo, b);
|   ;
|   return 0;
| }
configure:15623: result: no
configure:15625: WARNING: Your compiler does not support offsetof macro
configure:15627: error: Configure: Cannot continue

## ---------------- ##
## Cache variables. ##
## ---------------- ##

Hi Brad,

I thought I had seen this before: http://www.pgroup.com/userforum/viewtopic.php?p=6114

Though, the fix in the OpenMPI configure file is still in place so I don’t know why you’re seeing the same error. Can you double check that you are using the configure script that comes with 1.6.4 and not 1.3.3?

  • Mat

Hi Mat,

I double checked and I am running the configure that comes with the 1.6.4 openMPI distribution. The top of the file states:

#! /bin/sh

Guess values for system-dependent variables and create Makefiles.

Generated by GNU Autoconf 2.68 for Open MPI 1.6.4.

Looking inside the configure script there is the case statement for versions 1-5 and then version 6 and up is covered by a catch all, there is nothing explicit for version 10 as you pointed out in your other thread and nothing specific for version 13.

pgCC* | pgcpp*)
            # Portland Group C++ compiler
            case `$CC -V` in
            *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
              prelink_cmds_CXX='tpldir=Template.dir~
                rm -rf $tpldir~
                $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
                compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
              old_archive_cmds_CXX='tpldir=Template.dir~
                rm -rf $tpldir~
                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
                $RANLIB $oldlib'
              archive_cmds_CXX='tpldir=Template.dir~
                rm -rf $tpldir~
                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
              archive_expsym_cmds_CXX='tpldir=Template.dir~
                rm -rf $tpldir~
                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
              ;;
            *) # Version 6 and above use weak symbols
              archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'

Hmmm what could be causing this problem that I am running into. Next I will try actually compiling that snippet of test code that checks for offsetof capability.

Thanks

Hi Mat,

I took the piece of code that is in the configure script on which the failure of the offsetof macro occurs and tried to compile it with pgcc version 13.2

#include <stddef.h>

int main ()
{
   struct foo { int a, b;}; 

   size_t offset = offsetof(struct foo, b);
 
   return 0;
}



pgcc -c -DNDEBUG -g offsetof.c

and I get the same errors that are logged in the config.log

PGC-S-0037-Syntax error: Recovery attempted by deleting keyword struct (offsetof.c: 7)
PGC-S-0039-Use of undeclared variable foo (offsetof.c: 7)
PGC-S-0039-Use of undeclared variable b (offsetof.c: 7)
PGC/x86-64 Linux 13.2-0: compilation completed with severe errors

Do you have the same experience on an x86_64 CentOS 6.3 box?

Thanks

Hi Brad,

I’m able to compile the code on every system I test here, but I don’t have CentOS 6.3 installed anywhere (we don’t officially support CentOS). So I’m not sure if this is a problem specific to your system or a problem with CentOS 6.3. I’ve asked our IT folk to get it installed on a VM.

The definition of offsetof comes from the GNU “stddef.h” file and should be defined as:

#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)

We provide another “/opt/pgi/linux86-64/13.2/include/stddef.h” which defines “__builtin_offsetof” to be:

#define __builtin_offsetof(typ, fld)    ((int)(&(((typ*)0)->fld)))

Can you compile with “-P” (preprocess only) and then post the resulting “.i” file. This will tell us if its a problem with our header file or GNU has changed there definition.

  • Mat

Hi Mat,

I compiled the snippet of code I have saved in offsetof.c with the -P flag

pgcc -P -c -DNDEBUG -g offsetof.c

Here is the resulting offsetof.i file

typedef long int ptrdiff_t ;
 
typedef unsigned long int size_t ; 
 
typedef int wchar_t ;
 
int main ( )
{
   struct foo { int a , b ; } ; 
   size_t offset = __builtin_offsetof ( struct foo , b ) ;
 ; 
   return 0 ;
}

Hey Mat,

I just tried to verify this

We provide another “/opt/pgi/linux86-64/13.2/include/stddef.h” which defines “__builtin_offsetof” to be:

But I could only find stddef.h under

/opt/pgi/linux86/13.2/include/

I couldn’t find one under

/opt/pgi/linux86-64/13.2/include

and this is an x86_64 box. Not sure if this means anything.

Thanks

Ok, so this is mostly likely the problem as the 64-bit directory should have a “stddef.h”. Most likely the installer isn’t recognizing your OS and it’s not putting the header file in our include directory.

Can you add the following stddef.h to your installation and see if it works around the issue?

/* 
* stddef.h
*
*      Copyright 2005, STMicroelectronics, Incorporated.
*      All rights reserved.
*
*        STMICROELECTRONICS, INCORPORATED PROPRIETARY INFORMATION
* This software is supplied under the terms of a license agreement
* or nondisclosure agreement with STMicroelectronics and may not be
* copied or disclosed except in accordance with the terms of that
* agreement.
*/

#include_next <stddef.h>

#ifdef __builtin_offsetof 
#undef __builtin_offsetof 
#endif

#define __builtin_offsetof(typ, fld)	((int)(&(((typ*)0)->fld)))

Thanks,
Mat

Thanks that did the trick, I was able to compile the small excerpt of code and the configure of openMPI 1.6.4 completed without failing on the offsetof step.

However, now as I try to make openMPI I run into a compilation error.

It makes we wonder if potentially there are other files missing in the PGI installation on my CentOS 6.3 x86_64 box that might be causing this.

I think I read that the PGI compilers support RHEL 3 and higher, CentoOS 6.3 should be identical to RHEL 6.3 and I think the two have 100% binary compatibility.

I will try to configure and build openMPI with GCC and let you know the results I get.

Thanks

With gcc version 4.4.6 I was able to successfully configure and compile.

Did you ever get a chance to try this on a CentOS 6.3 x86_64 VM?

If you did and it works well for you then my install of PGI 13.2 must be faulty.

Thanks,
Marcin

Not yet. Let me go poke our IT guys to see where they’re at on this.

  • Mat

Mat,

The 13.2 PGI installation I have been working with to this point has been a network install in a shared file system as opposed to a single system install.

I re-installed 13.2 as a single system install and with that I was able to configure and compile openmpi 1.6.4 without any problems.

I noticed that the single system install was not missing the stddef.h file as was the case with my network install.

Is stddef.h suppose to be missing in a network install?

Thanks

Is stddef.h suppose to be missing in a network install?

Local installation files should get installed upon first use of the compilers in a local installation directory, typically under “/opt/pgi”.

  • Mat