Re: [OMPI devel] exit declaration in configure tests

2006-08-21 Thread Brian Barrett
On Mon, 2006-08-21 at 09:38 +0200, Ralf Wildenhues wrote:
> Revision 11268 makes me curious:
> 
> |M /trunk/config/ompi_setup_cxx.m4
> | 
> | Reorder the C++ compiler discovery stages. Check first the compiler vendor
> | before checking if we are able to compile the test program. This is required
> | for windows as the C++ conftest.c file generated by configure cannot be
> | compiled with the Microsoft cl.exe compiler (because of the exit function
> | prototype). So if we detect a vendor equal to microsoft we will assume
> | that the compiler is correctly installed (which is true on Windows most
> | of the time anyway).
> 
> I believe to have killed all problematic exit cases from the OpenMPI
> configury some time ago.  Did I miss any, or did the remaining ones
> come from some other package (so we can fix that one)?  Which Autoconf
> version was used (2.60 should not use any exit declarations itself any
> more)?

For one, I think I forgot to commit the patch you sent (shame on me!).
But I know George wasn't using AC 2.60 at the time.  He was going to try
that and see if it helped.

Brian




Re: [OMPI devel] OpenMPI not conforming with the C90 spec?

2006-08-21 Thread Ralph H Castain



On 8/21/06 6:58 AM, "Ralf Wildenhues"  wrote:

> * Ralph H Castain wrote on Mon, Aug 21, 2006 at 02:39:51PM CEST:
>> 
>> It sounds, therefore, like we are now C99 compliant and no longer C90
>> compliant at all?
> 
> Well, a compiler supporting C90 plus 'long long' as an extension would
> still be ok.  Surely, that's not "strictly C90".  But from glancing at
> the mpi.h file in my build tree, some declarations are commented out if
> HAVE_LONG_LONG is not set.  Your comments indicate that things still
> would not work with a strict C90 compiler.

True - we removed many of the HAVE_INT64 checks from within the code base
and hardcode int64_t declarations. So if int64_t is not defined and
supported (and I don't believe strict C90 does), we will barf during
compile.

Don't think it's a really big deal - just noting that the documentation may
require updating to reflect the new reality.

> 
>> I don't know how big a deal that is, but if true it is something possibly
>> worth noting on our web site and in our release notes. The code will
>> definitely NOT compile unless int64_t is defined and supported.
> 
> I think for Solaris 2.5.1 and Tru64 4.0, you would need a replacement
> definition, but I guess those systems aren't targets for OpenMPI either.

No idea - never heard it discussed, to be honest.

> 
>> PS to Ralf: actually, quite a few systems exist today that do not support
>> long long or int64_t. The majority of computers in the world, in fact, do
>> not do so - they are in embedded systems.
> 
> Right.  None of them is fully C99 compliant.  AFAIK, some allow (slow!)
> software emulations for long long types.
> 
>> We decided that we were tasked
>> with supporting high-performance computing systems instead, and those are
>> now built almost exclusively from systems that DO support such structures.
>> Just a point of correctness... :-)
> 
> Sure.  For practical matters, I would always go for C99 + extensions (as
> in gcc's -std=gnu99; you could use AC_PROG_CC_STDC from Autoconf-2.60
> for some sane choices).
> 
> Cheers,
> Ralf
> ___
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel




Re: [OMPI devel] OpenMPI not conforming with the C90 spec?

2006-08-21 Thread Ralf Wildenhues
* Ralph H Castain wrote on Mon, Aug 21, 2006 at 02:39:51PM CEST:
>
> It sounds, therefore, like we are now C99 compliant and no longer C90
> compliant at all?

Well, a compiler supporting C90 plus 'long long' as an extension would
still be ok.  Surely, that's not "strictly C90".  But from glancing at
the mpi.h file in my build tree, some declarations are commented out if
HAVE_LONG_LONG is not set.  Your comments indicate that things still
would not work with a strict C90 compiler.

> I don't know how big a deal that is, but if true it is something possibly
> worth noting on our web site and in our release notes. The code will
> definitely NOT compile unless int64_t is defined and supported.

I think for Solaris 2.5.1 and Tru64 4.0, you would need a replacement
definition, but I guess those systems aren't targets for OpenMPI either.

> PS to Ralf: actually, quite a few systems exist today that do not support
> long long or int64_t. The majority of computers in the world, in fact, do
> not do so - they are in embedded systems.

Right.  None of them is fully C99 compliant.  AFAIK, some allow (slow!)
software emulations for long long types.

> We decided that we were tasked
> with supporting high-performance computing systems instead, and those are
> now built almost exclusively from systems that DO support such structures.
> Just a point of correctness... :-)

Sure.  For practical matters, I would always go for C99 + extensions (as
in gcc's -std=gnu99; you could use AC_PROG_CC_STDC from Autoconf-2.60
for some sane choices).

Cheers,
Ralf


Re: [OMPI devel] OpenMPI not conforming with the C90 spec?

2006-08-21 Thread Ralph H Castain



On 8/21/06 1:14 AM, "Ralf Wildenhues"  wrote:

> 
>> Perhaps we should use int64_t instead.
> 
> No, that would not help: int64_t is C99, so it should not be declared
> either in C89 mode.  Also, the int64_t is required to have 64 bits, and
> could thus theoretically be smaller than 'long long' (no, I don't think
> any such systems exist today).
> 

Hmmm...this raises an interesting point. We had originally decided that we
would strictly be C90 compliant (I looked it up in the original planning
meeting minutes). However, over the last two years, at some point we decided
that we were abandoning all the checks in the code for HAVE_INT64, and just
hardcoding int64_t into the code base. I remember the discussion and the
feeling that we would only be supporting systems that have int64_t support.

It sounds, therefore, like we are now C99 compliant and no longer C90
compliant at all?

I don't know how big a deal that is, but if true it is something possibly
worth noting on our web site and in our release notes. The code will
definitely NOT compile unless int64_t is defined and supported.

PS to Ralf: actually, quite a few systems exist today that do not support
long long or int64_t. The majority of computers in the world, in fact, do
not do so - they are in embedded systems. We decided that we were tasked
with supporting high-performance computing systems instead, and those are
now built almost exclusively from systems that DO support such structures.
Just a point of correctness... :-)

Ralph




Re: [OMPI devel] OpenMPI not conforming with the C90 spec?

2006-08-21 Thread Jonathan Underwood

On 19/08/06, Adrian Knoth  wrote:

> Compiling a file with the gcc options -Wall and -pedantic gives the
> following warning:
> mpi.h:147: warning: ISO C90 does not support 'long long'
> Is this intentional, or is this a bug?

If you do not insist on using C90, you may compile with -std=c99
to get rid of this message ;)



Heh :)


I don't have the C90 (ANSI-C) at my fingertips, but I confirm it
does not support "long long".

Perhaps we should use int64_t instead.


I think that wouldn't solve the problem (see another post on that from
Ralf Wildenhaus).

I notice that the gcc documentation has this to say:

  The macro "__STRICT_ANSI__" is predefined when the -ansi option is
  used.  Some header files may notice this macro and refrain from
  declaring certain functions or defining certain macros that the ISO
  standard doesn't call for; this is to avoid interfering with any
  programs that might use these names for other things.

I wonder if it would be possible to #ifdef away non-C90 conforming
declarations in mpi.h when C90 conformance is requested. I am not sure
if __STRICT_ANSI__ is portable though.
If this is considered to be a worthwhile endeavour, I'm happy to cook
up a patch for it. OTOH, it may not really be worth it.

Best wishes,
Jonathan.


[OMPI devel] exit declaration in configure tests

2006-08-21 Thread Ralf Wildenhues
Revision 11268 makes me curious:

|M /trunk/config/ompi_setup_cxx.m4
| 
| Reorder the C++ compiler discovery stages. Check first the compiler vendor
| before checking if we are able to compile the test program. This is required
| for windows as the C++ conftest.c file generated by configure cannot be
| compiled with the Microsoft cl.exe compiler (because of the exit function
| prototype). So if we detect a vendor equal to microsoft we will assume
| that the compiler is correctly installed (which is true on Windows most
| of the time anyway).

I believe to have killed all problematic exit cases from the OpenMPI
configury some time ago.  Did I miss any, or did the remaining ones
come from some other package (so we can fix that one)?  Which Autoconf
version was used (2.60 should not use any exit declarations itself any
more)?

Cheers,
Ralf


Re: [OMPI devel] OpenMPI not conforming with the C90 spec?

2006-08-21 Thread Ralf Wildenhues
Hello Adrian, Jonathan,

* Adrian Knoth wrote on Sat, Aug 19, 2006 at 08:38:15PM CEST:
> On Thu, Aug 17, 2006 at 11:48:44PM +0100, Jonathan Underwood wrote:
>  
> > Compiling a file with the gcc options -Wall and -pedantic gives the
> > following warning:
> > mpi.h:147: warning: ISO C90 does not support 'long long'
> > Is this intentional, or is this a bug?
> 
> If you do not insist on using C90, you may compile with -std=c99
> to get rid of this message ;)

More precisely, the OpenMPI installation that provides this mpi.h file
was compiled with 'long long' support, which quite undoubtedly is a
feature rather than a bug.  Users should not compile their code with
strict C89 settings.

> I don't have the C90 (ANSI-C) at my fingertips, but I confirm it
> does not support "long long".

Yes.

> Perhaps we should use int64_t instead.

No, that would not help: int64_t is C99, so it should not be declared
either in C89 mode.  Also, the int64_t is required to have 64 bits, and
could thus theoretically be smaller than 'long long' (no, I don't think
any such systems exist today).

Cheers,
Ralf