On 03/13/09 16:40, Jeff Squyres wrote:
On Mar 13, 2009, at 4:37 PM, Mostyn Lewis wrote:

>From config.log

configure:21522: checking for C/C++ restrict keyword
configure:21558: pgcc -c -DNDEBUG -fast -Msignextend -tp p7-64 conftest.c >&5
configure:21564: $? = 0
configure:21582: result: restrict

So you only check using pgcc (not pgCC)?


The AC_C_RESTRICT test only checks the C compiler, yet. It's an Autoconf-builtin test; we didn't write it.

Odd that you get "restrict" and I get "__restrict".  Hrm.

Well, I suppose that one solution might be to disable those prototypes in the op.h header file when they're included in components.cc (that's a source file in the ompi_info executable; it shouldn't need the specific MPI_Op callback prototypes). Fortunately, we have very little C++ code in OMPI, so this isn't a huge issue (C++ is only used for the MPI C++ bindings -- of course -- and in some of the command line executables).

Let me see what I can cook up, and then let me see if I can convince George that it's the correct answer. ;-)


Please ignore if I am way off base here but....

Isn't this problem similar to what happens with Sun Studio? For Sun Studio, the C compiler recently added support for some of the restrict variants. However, the Sun Studio C++ compiler does not support them. This is handled by autoconf via a workaround targetted specifically at Sun Studio. Essentially, if you are Sun Studio C++, then #undef any restricts. This is from lib/autoconf/c.m4

#undef restrict
/* Work around a bug in Sun C++: it does not support _Restrict or
 __restrict__, even though the corresponding Sun C compiler ends up with
 "#define restrict _Restrict" or "#define restrict __restrict__" in the
 previous line.  Perhaps some future version of Sun C++ will work with
 restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define _Restrict
# define __restrict__
#endif])


We also had to make a change to opal_config_bottom.h so we could work with older versions of autoconf that did not have the restrict workaround.

From opal_config_bottom.h:
/*
 * The following is a workaround for a workaround in autoconf for the
 * Sun Studio C++ compiler.  The Sun Studio C++ compiler does not
 * support restrict whereas the Sun Studio C compiler does.  Initially,
 * Sun Studio C only supported _Restrict, but later version started
 * supporting __restrict__ also.  Currently, autoconf handles turning
 * off _Restrict but not __restrict__ for the Sun Studio C++ compiler.
 * Therefore, we are handling it here.  When autoconf gets fixed, this
 * code can be removed.
 */
#if defined __SUNPRO_CC && !defined __RESTRICT
# define __restrict__
#endif


--

=========================
rolf.vandeva...@sun.com
781-442-3043
=========================

Reply via email to