[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bgl-discuss] blrts_xlc and configure



At 01:38 AM 2/8/2005, Anthony Chan wrote:

I have similar problem with AC_CHECK_SIZEOF(), but the problem does
not seem to be related to autoconf.  When gcc or xlc are
used to configure without rts libraries, configure works fine.

The most likely problem is that blrts_xlc programs can't run on the login nodes; that is required for these tests (the program must write out the value since there is no compile-time only test for things like sizeof). Tools should handle the cross-compilation case; in MPICH2, we use environment variables CROSS_SIZEOF_INT etc. to allow the user to provide information that isn't available to configure. We've also provided for a "base" compiler, which is one that is the same as the full compiler, but is able to link runnable programs (e.g., xlc instead of blrts_xlc). For the tool developer, a good approach is to provide a list of such cross-compilation variables, along with a single program that can be run manually to create an sh script that sets and exports those variables.


Bill



Here are the offending configure lines that AC_CHECK_SIZEOF generates:

main ()
{

  FILE *f = fopen ("conftest.val", "w");
  if (! f)
    exit (1);
    ...


If you link the following program with rts libraries, e.g. blrts_xlc or ~balay/bin/mpicc.gnu

#include <stdio.h>
main()
{
    FILE *tmp_file = fopen( "tmp_file_txt", "w" );
    if ( ! tmp_file ) {
        fprintf( stderr, "fopen does not create any file.\n" );
        exit( 1 );
    }
    fprintf( tmp_file, "%s\n", "Hello" );
    fclose( tmp_file );
    exit( 0 );
}

chan/ts_C> a.out
fopen does not create any file.

Without linking with rts libraries, the above program works.  So the rts
libraries seems to modify fopen()'s behavior so fopen returns NULL.  It
seems to be it is a bug and/or the frontend does not run rts code....  You
may want to try cross-compilation to avoid AC_CHECK_SIZEOF if netCDF
supports it.

A.Chan

On Tue, 8 Feb 2005, Boyana Norris wrote:

> When I use the blrts_xlc script instead of xlc directly, configure is
> unable to determine the size of short (and crashes, I haven't had time
> to investigate which of the three abnormal exits happens). Has anyone
> run into this problem? The relevant ac macro is AC_CHECK_SIZEOF(short),
> and this particular configure is in netCDF 3.6.0, generated using
> autoconf version >= 2.59.
>
> Thanks,
> Boyana
>


William Gropp
http://www.mcs.anl.gov/~gropp


- --------------------------------------------------------------------
To add or remove yourself from this mailing list, use the 'notifyme'
command on any BGL machine. To remove: notifyme -n, to add: notifyme -y.