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

Re: 970514: problems Compiling NetCDF 2.4.3



>cc: address@hidden
>From: Warren Taylor <address@hidden>
>Subject: Compiling NetCDF 2.4.3
>Organization: Old Dominion University
>Keywords: 199705141517.JAA00303 netCDF 2.4.3

Hi Warren,

> I'm having a problem getting netCDF 2.4.3 to compile, specifically the
> c++ interface to it.  Everything else appears to working fine, using gcc
> 2.7.2.1 and g++ 2.7.2.1 as the compilers, but when I actually get in to
> the xcc directory I get the following:
> 
> g++ -c  -I../libsrc  netcdf.cc
> In file included from netcdf.hh:16,
>                  from netcdf.cc:12:
> ncvalues.hh:13: generic.h: No such file or directory
> ncvalues.hh:14: iostream.h: No such file or directory
> ncvalues.hh:18: strstream.h: No such file or directory
> 
> I've checked very thoroughly and I can say for certain that these files
> did not come with the distribution of netCDF, nor do they exist on my
> system in any fashion.

This means g++ is unable to locate some standard include files that
should be installed with any C++ compilation system.  From the above,
your g++ compiler probably won't even be able to compile the following
standard 2-line program:

#include <iostream.h>
main() {cout << "Hello, world\n"; }

You can either find out what's needed to get the g++ compiler to compile
and link the above program first (probably installing libg++ and the
associated include files in a place where g++ can find them) or just
disable the compilation and testing of the netCDF C++ interface by
setting

CXX=""

in your CUSTOMIZE file before invoking the configure script.  The C and
Fortran part of the library will still work fine without the C++
interface.

> I've also tried installing the pre-compiled bundle of netCDF 2.4.3 from
> your site, but when I try to compile nctools I get a lot of XDR errors. 
> When I'm compiling netCDF 2.4.3 I have watched the output and it doesn't
> appear to really *do* anything in the xdr directory -- do you have any
> hints there, as well????

If you are running on a Sun under Solaris, you may need to add the
loader flag "-lnsl" to get the Solaris XDR libraries.  Other platforms
may have the XDR libraries in other places (sometimes -lrpc), but you
can tell by looking at the loader flags used to link ncdump, ncgen, or
nctest.  An easy way to see these is to just change to the ncdump
directory, for example, remove the ncdump executable (but nothing else),
then run "make" again in that directory and see what flags and libraries
are used to link it.

If you can wait a day or so, you might also try the new netCDF-3
release, because it's written to be independent of vendor XDR libraries;
all the XDR stuff is included in the rewritten netCDF library.  There
will be an announcement about this to the netcdfgroup mailing list in
the next day or two, and it will also appear on the netCDF "What's New"
page at

    http://www.unidata.ucar.edu/packages/netcdf/whatsnew.html

--Russ

_____________________________________________________________________

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