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
>