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

20020501: netCDF installation trouble on SGI (cont.)



>From: "Kristin"
>Organization: Lockheed Martin Space Operations
>Keywords: 200204302300.g3UN0Za25954 netCDF SGI compiler license

Kristin,

>Your previous diagnosis of the problem being that my C compiler is unusable 
>is incorrect. The C compiler whines about liscensing every time it is used 
>but the programs it is fed get compiled correctly. If you look in the 
>configure.log file, you will see that the configure script had many problems 
>of its own:
>
>checking size of short... 0
>checking size of int... 0
>checking size of long... 0
>checking size of float... 0
>checking size of double... 0
>checking size of off_t... 0
>checking size of size_t... 0

I apologize for having been misled by the seemingly "easy" solution.

>These should not all be zero. Also, I had to remove 8 '#include "confdefs.h"' 
>lines from configure to get it to stop giving me errors.

This indicates that there is something wrong in your development
environment.  Exactly what the problem may be can not be known by the
information we have in hand right now.

It would be useful to see the contents of macos.make.  This contains
the values of environment variables at the time configure is run.  You
will find this in the top level directory of the netCDF distribution
after configure has run successfully (it gets created by configure from
macros.make.in).  If this file does not exist (it should, but...),
please send the output from 'env'.

What we can do to try and and figure out what is wrong with your
development environment (other than there being no license for your C
compiler) is look at the contents of confdefs.h at the point of failure
to determine the size of a 'short'.  We will be able to learn alot by
you editing the configure script and have it stop right after the
attempt to determine the length of a short.

What I have in mind is you starting with an unaltered copy of configure
(not the copy where you have deleted the includes of confdefs.h) and do
the following:

change (about line 3698, and note that I am including two spaces at the
beginning of each line in this email to make the section more readable):

  echo $ac_n "checking size of short""... $ac_c" 1>&6
  echo "configure:3700: checking size of short" >&5
  if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    if test "$cross_compiling" = yes; then
      { echo "configure: error: can not run test program while cross compiling" 
1>
  &2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
  #line 3708 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  main()
  {
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    fprintf(f, "%d\n", sizeof(short));
    exit(0);
  }
  EOF
  if { (eval echo configure:3719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& t
  est -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_sizeof_short=`cat conftestval`
  else
    echo "configure: failed program was:" >&5
    cat conftest.$ac_ext >&5
    rm -fr conftest*
    ac_cv_sizeof_short=0
  fi
  rm -fr conftest*
  fi
  
  fi
  echo "$ac_t""$ac_cv_sizeof_short" 1>&6
  cat >> confdefs.h <<EOF
  #define SIZEOF_SHORT $ac_cv_sizeof_short
  EOF

to:

  echo $ac_n "checking size of short""... $ac_c" 1>&6
  echo "configure:3700: checking size of short" >&5
  if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    if test "$cross_compiling" = yes; then
      { echo "configure: error: can not run test program while cross compiling" 
1>
  &2; exit 1; }
  else
    cat > conftest.$ac_ext <<EOF
  #line 3708 "configure"
  #include "confdefs.h"
  #include <stdio.h>
  main()
  {
    FILE *f=fopen("conftestval", "w");
    if (!f) exit(1);
    fprintf(f, "%d\n", sizeof(short));
    exit(0);
  }
  EOF
  if { (eval echo configure:3719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } 
&& t
  est -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  then
    ac_cv_sizeof_short=`cat conftestval`
  else
    echo "configure: failed program was:" >&5
    cat conftest.$ac_ext >&5
    #rm -fr conftest*
    ac_cv_sizeof_short=0
  fi
  # rm -fr conftest*
  fi
  
  fi
  echo "$ac_t""$ac_cv_sizeof_short" 1>&6
  cat >> confdefs.h <<EOF
  #define SIZEOF_SHORT $ac_cv_sizeof_short
  EOF
  
  exit


The changes are:

1) comment out 'rm -fr conftest*' in two places
2) add an exit just after the EOF where the definition of the size of a
   short is added to the end of confdefs.h

This will tell us:

1) the contents of confdefs.h up to this point
2) the contents of conftestval _if_ it gets created
3) whether or not the conftest executable got created

Neither 2) or 3) should exist since the error indicated in your
config.log says that compilation failed.  We may learn enough from the
contents of confdefs.h to figure out what is going on.

>Have you been able to correct these errors on other IRIX64 machines?

We do not see these errors on other IRIX64 machines.  We have one in
our office that we use in testing builds of all of the software that we
support (I have recently built both netCDF 3.4 and 3.5 under IRIX64 6.5
using SGI compilers with no problems).

Since the interplay with macros in C header files can be quite complex,
it is possible that by simply changing from use of 'c89' to 'cc' would
allow the netCDF to be built successfully.  The environment I used in
my latest builds of netCDF (3.4 and 3.5) on IRIX64 6.5 was:

# C shell defines for netCDF build
setenv CC "/bin/cc -n32"
setenv CPPFLAGS -DNDEBUG
setenv CFLAGS -O
setenv FC "/bin/f77 -n32"
setenv FFLAGS -O
setenv CXX

(since I was not going to use the C++ interface, I caused it to not be
created by defining CXX to be blank).

Tom