Re: [O-MPI devel] PGI configure failure..

2005-12-03 Thread Ralf Wildenhues
Wow, several bugs for the price of one report.  :)

* Jeff Squyres wrote on Sat, Nov 26, 2005 at 08:24:33PM CET:
> On Nov 25, 2005, at 4:03 PM, Galen M. Shipman wrote:
> 
> > On a fresh co of the trunk, after a successful autogen.sh I get the
> > following error with this configure:
> >
> >   ./configure CC=pgcc CXX=pgCC F77=pgf77 FC=pgf90 --disable-io-romio -
> > with-mvapi=/usr/local/ib --enable-static --disable-shared --prefix=/u/
> > gshipman/myapps
> >
> > *** Initialization, setup
> > configure: builddir: /u/gshipman/ompi_pgi
> > configure: srcdir: /u/gshipman/ompi_pgi
> > checking build system type... Invalid configuration 
> > `x86_64-unknown-linux-': machine `x86_64-unknown-linux' not recognized
> > configure: error: /bin/sh ./config/config.sub x86_64-unknown-linux- failed

> > Not sure what is going on here, Jeff fixed this for me one other time
> > but I am not sure what magic he did, this is occurring on odin.
>
> All I did was re-run autogen for you with my own copies of the Auto 
> tools.  I think the difference was that I had the most most most recent 
> version of Libtool (i.e., I don't use the system-installed auto tools 
> on odin).

I stumbled over this myself now.  It's due to an old version of
`config.guess'.  With a current version of the config.* scripts[1],
things seem to work, but the underlying bugs are merely not exposed
any longer, not fixed.  In any case, I'd recommend updating the systems'
various copies of the config.* scripts (the installed ones date
2005-03-24).


Detailed analysis (so I can point to it in a mail to config-patches at
gnu.org):

First, in some cases, config.guess executes
  eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`

with $dummy.c containing this (modulo leading white space):
  #include 
  #ifdef __ELF__
  # ifdef __GLIBC__
  #  if __GLIBC__ >= 2
  LIBC=gnu
  #  else
  LIBC=gnulibc1
  #  endif
  # else
  LIBC=gnulibc1
  # endif
  #else
  #ifdef __INTEL_COMPILER
  LIBC=gnu
  #else
  LIBC=gnuaout
  #endif
  #endif
  #ifdef __dietlibc__
  LIBC=dietlibc
  #endif

Now the eval line above contains two flaws: First, it may screw up the
newlines in the output of the command substitution: the eval will
evaluate something like

  # 1 "a.c" # 1 "" # 1 ... LIBC=gnu

(abbreviated output with GCC)

and thus $LIBC will not be set.  This may be fixed by double-quoting the
`...` part.

Second, the preprocessor has the right to introduce spacing at token
boundaries, and pgcc will do just that:
  # 1 "a.c"
  # 1 "/usr/include/features.h"
  ...
  LIBC = gnuaout

An earlier version of the script correctly included provision for this:
| eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`

We may remove the grep, and fix the quoting issue, although not strictly
necessary any more in this version, arriving at
  eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/LIBC/{s: ::g;p;}'`"

(Several occasions of the same bugs exist in the script.)


Third, and this can be seen from the output of the second version, there
is another bug looming with pgcc: it will output gnuaout, wrongly.  Now,
this is because pgcc doesn't predefine __ELF__.  This may be handled
similarly to the Intel compiler case:

  #if defined(__INTEL_COMPILER) || defined(__PGI)
  LIBC=gnu
  #else

The reason why newer config.guess scripts do not exhibit the issue (on
the x86_64 system in question) is that, for x86_64 the `eval' command is
not executed any more.  However, AFAIK the 32bit version of pgcc does
not define __ELF__ either, so potentially on x86 this issue may still be
open.

The issue may be worked around by passing
  --build=x86_64-unknown-linux-gnu
to the configure invocation.

Cheers,
Ralf


[1] wget \
http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/config/config/config.sub \
http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/config/config/config.guess


Re: [O-MPI devel] PGI configure failure..

2005-12-03 Thread Jeff Squyres

On Dec 3, 2005, at 10:30 AM, Ralf Wildenhues wrote:


snipped


Most excellent analysis.  Thanks!

Are you going to report these bugs to the config.* maintainers?


[1] wget \
http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/config/config/ 
config.sub \
http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/config/config/ 
config.guess


FWIW, we actually do this during "make dist" so that our distribution  
tarballs always have the latest/greatest config.[sub|guess].


--
{+} Jeff Squyres
{+} The Open MPI Project
{+} http://www.open-mpi.org/



Re: [O-MPI devel] PGI configure failure..

2005-12-03 Thread Ralf Wildenhues
Hi Jeff,

* Jeff Squyres wrote on Sat, Dec 03, 2005 at 05:02:45PM CET:
> 
> Most excellent analysis.  Thanks!

Thanks.

> Are you going to report these bugs to the config.* maintainers?

Already done.  I don't know of a public archive of their email --
if you really care I could repost here what I wrote to them.

> On Dec 3, 2005, at 10:30 AM, Ralf Wildenhues wrote:
> > [1] wget \
> > http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/config/config/ 
> > config.sub \
> > http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/config/config/ 
> > config.guess
> 
> FWIW, we actually do this during "make dist" so that our distribution  
> tarballs always have the latest/greatest config.[sub|guess].

That's always a good idea IMHO -- the autotools do similarly.

Cheers,
Ralf


[O-MPI devel] mailing list web archive oddity

2005-12-03 Thread Ralf Wildenhues
When looking at
http://www.open-mpi.org/community/lists/devel/2005/12/0573.php for
example, the "previous message" link points to
http://www.open-mpi.org/mailman/private.cgi/devel/2005/11/0572.php
which is inaccessible without a password.

This seems to be some mailing list configuration error, as the real
previous message may be found by browsing the overview of the previous
month, at
http://www.open-mpi.org/community/lists/devel/2005/11/0572.php

Links crossing months seem all to exhibit this behavior.

Cheers,
Ralf


Re: [O-MPI devel] PGI configure failure..

2005-12-03 Thread Jeff Squyres

On Dec 3, 2005, at 11:11 AM, Ralf Wildenhues wrote:


Are you going to report these bugs to the config.* maintainers?


Already done.  I don't know of a public archive of their email --
if you really care I could repost here what I wrote to them.


Nah.  We trust you.  :-)

--
{+} Jeff Squyres
{+} The Open MPI Project
{+} http://www.open-mpi.org/



Re: [O-MPI devel] mailing list web archive oddity

2005-12-03 Thread Jeff Squyres

Weird.  Thanks for pointing it out!

I filed a ticket with our sysadmin to fix.


On Dec 3, 2005, at 11:24 AM, Ralf Wildenhues wrote:


When looking at
http://www.open-mpi.org/community/lists/devel/2005/12/0573.php for
example, the "previous message" link points to
http://www.open-mpi.org/mailman/private.cgi/devel/2005/11/0572.php
which is inaccessible without a password.

This seems to be some mailing list configuration error, as the real
previous message may be found by browsing the overview of the previous
month, at
http://www.open-mpi.org/community/lists/devel/2005/11/0572.php

Links crossing months seem all to exhibit this behavior.

Cheers,
Ralf
___
devel mailing list
de...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/devel