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


[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] A few notes on IPv6 status

2006-08-21 Thread Adrian Knoth
On Sat, Aug 19, 2006 at 11:07:26PM +0200, Adrian Knoth wrote:

> Hi,

Hi!

> Do you agree with a resulting URL like tcp://[2001:6f8::1]:port or
> do you think it should be tcp6://?

I've changed this to tcp6://, because orte/mca/oob/tcp/oob_tcp.c
contains the following lines:

/* setup the IP address for storage */
tmp = mca_oob.oob_get_addr();
tmp2 = strrchr(tmp, '/') + 1;
tmp3 = strrchr(tmp, ':');
if(NULL == tmp2 || NULL == tmp3) {

The old way (tcp://[IPv6]) would require code to remove
'[' and ']' iff af_family == AF_INET6.

tcp6:// does not need any special treatment.

> IPv6 interface discovery (talking about opal/util/if.c again)
> needs special treatment on some systems. Right now, I have
> -DLINUX_IPV6 and I'd probably need to catch more (at least
> HPUX defines SIOCGLIFADDR which is also present on OpenBSD).
> 
> If I'd have something like -DLINUX, I wouldn't need to
> introduce more defines (like -DLINUX_IPV6 oder -DBSD_IPV6).

I'm now using the compiler defines:

#ifdef __linux__
#endif



-- 
mail: a...@thur.de  http://adi.thur.de  PGP: v2-key via keyserver

Fighting for peace is like fucking for virginity!


Re: [OMPI devel] exit declaration in configure tests

2006-08-21 Thread George Bosilca
With autoconf 2.59 every C++ test generated by autoconf include the wrong 
prototype of exit. I did patch my autoconf to add the missing exit 
prototype (the one compatible with cl.exe) but next time I upgrade my 
system, my modifications vanished. Between autoconf and libtool I spend a 
fair amount of time handling Windows & Cygwin issues, at one point the 
simplest solution was to basically remove all C++ tests from configure. 
This approach went pretty well for a while, until the automatic C++ 
compiler test was added few weeks ago, as this test is there even if C++ 
support was disabled.


Anyway, for those not living on the edge, this commit will allow them to 
configure and eventually compile Open MPI on Windows...


  Thanks,
george.

On Mon, 21 Aug 2006, 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)?


"We must accept finite disappointment, but we must never lose infinite
hope."
  Martin Luther King



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.


Re: [OMPI devel] exit declaration in configure tests

2006-08-21 Thread Ralf Wildenhues
Hello George,

Thanks for explaining.

* George Bosilca wrote on Mon, Aug 21, 2006 at 11:38:21AM CEST:
> With autoconf 2.59 every C++ test generated by autoconf include the wrong 
> prototype of exit.

Yes, presumably because Autoconf did not try the exit declaration that
would please that MSVC version.  It's incredible the developers have
managed to use at least 4 different, incompatible declarations of a
standardized function, changing it for almost every release.

This is why Autoconf-2.60 does not try to find one any more.

> Anyway, for those not living on the edge, this commit will allow them to 
> configure and eventually compile Open MPI on Windows...

I would _really_ recommend using 2.60 only for doing work with MSVC.

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 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 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] 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