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

Re: 970529: OFFICE MEMO netcdf install



>To: "unidata ucar" <address@hidden>
>From: "Steve Mauget" <address@hidden>
>Organization: USDA
>Keywords: 199705291843.MAA11397

Hi Steve,

>       After downloading netcdf.tar.Z and reading through the INSTALL
> instructions, I recently installed netcdf on our SGI Indigo 2 running
> Irix 6.2. As far as post- install testing was concerned I ran "make
> test" (which appeared to detect some problems...results below in section
> VI), checked for and read the ncgen and ncdump man pages, and ncdumped
> an old netcdf file that I had generated on netcdf installed elsewhere
> (that worked). But when I tried to compile and link a program
> (wrnetcdf.f) with libnetcdf.a I ran into problems. Compiling seemed to
> go OK (we're using a NAG f90 compiler), but there were apparently
> problems with the loader/linker stage. The first sign of trouble seemed
> to be...
> 
> ld: WARNING 84: /usr/local/lib/libnetcdf.a is not used for resolving any
> symbol.

Evidently, you downloaded the netCDF version 2.4.3.  We recently
released version 3.3, which is what is in

    ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf.tar.Z 

The only Fortran compiler we used for testing either version on SGI/IRIX
platforms was f77.  We've recently tried f90 and discovered a problem
that will require some effort to fix.  The fix may be in the next minor
release, 3.3.1, probably available some time next week.

>       f90   wrnetcdf.f  -lnetcdf -o wrnetcdf
> Extension: wrnetcdf.f, line 12: Byte count on numeric data type
>            detected at *@2
> Extension: /usr/local/include/netcdf.inc, line 155: Byte count on numeric data
> type
>            detected at *@2
> Extension: /usr/local/include/netcdf.inc, line 156: Byte count on numeric data
> type
>            detected at *@1
> Extension: wrnetcdf.f, line 48: TAB format input

I think what's going on here is that your f90 compiler expects free
format Fortran for input by default, and all the Fortran source in our
package is in fixed form so it will work for f77 compilers.  If you use
whatever compiler option is necessary to specify fixed form, many of
these error messages will go away ...

> ld: WARNING 84: /usr/local/lib/libnetcdf.a is not used for resolving any
> symbol.
> ld: WARNING 84: /usr/lib/libm.so is not used for resolving any symbol.

Perhaps you didn't install the new library in the /usr/local/lib/ directory?

> Seems that the loader is unable to resolve all the netcdf subroutine
> calls in my program, which I assume are all in libnetcdf.a . On page
> 35 of the NetCDF User's Guide it states that, on some systems, you
> must specify an additional library after libnetcdf.a where the system
> XDR libraries are found. The InfoNav utility on our Indigo 2 and man
> XDR give no clue as to where these libraries are located. I tried:
> 
>       f90   wrnetcdf.f  -lnetcdf -lm -o wrnetcdf
> 
> which is how my grad program netcdf programs linked, but got same
> results as above.  Below is the information requested at the end of
> INSTALL for troubleshooting netcdf problems. If you need any other
> information I can be reached at:

Another advantage of netCDF 3.3 is that it no longer depends on any
vendor XDR libraries, so there is no need to supply another library on
the link line.

Nevertheless, none of the missing externals you got messages about would
have been in the XDR library; they are all netCDF Fortran subroutines.
Perhaps the netCDF library you have installed in
/usr/local/lib/libnetcdf.a contains only the C interfaces and none of
the Fortran interfaces.  It's possible to build the library this way by
specifying a null Fortran compiler (FC="") or if there is a failure in
compiling the Fortran interfaces.  In particular, the output from your
"make test" shows no test of the Fortran interface, which would indicate
that it was not built.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu