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

20020415: NetCDF 3.5 build errors on AIX under McIDAS



>From:  Dave Parker <address@hidden>
>Organization:  SSEC
>Keywords:  200204152102.g3FL2fa10111 McIDAS netCDF 3.5

Dave,

>We are trying to compile NetCDF 3.5.0 on AIX, but we are running into a
>few problems.  A standalone gcc compile of the package works fine, but
>when McIDAS tries to compile it, it fails.

Since I had not tried building netCDF 3.5 under McIDAS before, I had
no first-hand experience with this problem.  I have, however, just
setup a build environment for my 7.805 McIDAS distribution using the
netcdf-3.5.0.tar.Z distribution available by anonymous FTP in the
pub/netcdf directory on ftp.unidata.ucar.edu.  Unfortunately, I do not
have f2c installed on my AIX 4.3 platform, so I can't exactly replicate what I
think is your environment:

CC=gcc
FC=mcfc
etc.

I do, however, have gcc and g77, so I am building using them.  Here
are the environment variable settings from my .cshrc file that I am
using for this test:

# Defines needed for netCDF build using gcc/g77
setenv CC /usr/local/gnu/bin/gcc
setenv CPPFLAGS "-DNDEBUG -Df2cFortran"
setenv CFLAGS -O
setenv FC /usr/local/gnu/bin/g77
setenv FFLAGS "-O -Wuninitialized -fno-automatic"
setenv CXX

The CPPFLAGS definition will be the same for gcc/g77 as for gcc/f2c/mcfc.

>The compile commands are
>identical, although the ./configure is done after the McIDAS install
>script has set some environment  variables.  Have you seen an error like
>this before?  I did a 'diff' on the config.status between the standalone
>compile and the McIDAS compile, and there are
>quite a few differences, including lines that set NF_INT_IS_C_<TYPE> in
>the working compile that just arent getting picked up in the
>McIDAS-initiated configure of NetCDF.

I would suspect that the difference is in the environment variable settings
in one build versus the other.

>I did try recreating the
>McIDAS compile environment, and the standalone gcc compile failed when
>FC=mcfc was set in the environment, and worked when it was unset.

This is strange given that the configure portion of the netCDF build
simply tries to determine if one has a working "Fortran" compiler.
If the compiler is found to not work, the build of the Fortran interface
is bypassed.

>However, Im not sure what it is about mcfc that caused the error, so
>I dont really know where to go from here.

I will report the results of my test when the build gets past the
netCDF portion.  This can take awhile since my AIX 4.3 machine is slow.

<some time later>

OK, my build has successfully gone past the netCDF phase, so I am
confident that there is no show stopper when building netCDF 3.5
under McIDAS.

I also think that I may know why your build is failing.  Read on...

>Ive attached a list of the errors we are seeing:
>
>sh ./mcidas7.811.sh -gcc -noopt -s make
>.
>.
>.
>.
>
>Making `all' in directory /home1/mcidas/mcidas7.811/netcdf/fortran
>
>        gcc -c -O -I../libsrc  -DNDEBUG fort-attio.c

Here is where I think the problem can be seen.  The compilation of
this same module on my AIX 4.3 system looks like:

        /usr/local/gnu/bin/gcc -c -O -I../libsrc  -DNDEBUG -Df2cFortran 
fort-attio.c

The primary difference is the '-Df2cFortran' define.  I think,
therefore, that you need to make sure to set environment variables in
your session to parallel those I listed above especially insofar as
CPPFLAGS is concerned.  The FFLAGS definition above is for g77, so you
don't need to match it.

Please let me know if this fixes your problem.

Tom
--
+-----------------------------------------------------------------------------+
* Tom Yoksas                                             UCAR Unidata Program *
* (303) 497-8642 (last resort)                                  P.O. Box 3000 *
* address@hidden                                   Boulder, CO 80307 *
* Unidata WWW Service                             http://www.unidata.ucar.edu/*
+-----------------------------------------------------------------------------+