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

960125: building netCDF applications on SunOS



>From: address@hidden (Mike Notaro)
>Organization: SUNY Albany
>Keywords: 199601242045.AA14821 netCDF

Mike,

>Hello.  Let me further explain what I am doing.  I have a data set from
>NCAR which I wish to convert to netcdf format so that VCS ( visualization
>and computations system ) can read it in and display it.  My data converting
>fortran program needs to read the data set in the NCAR format and then 
>change it into netcdf format, which means that netcdf subroutines will be
>used.

Ok, this should not be a problem.

>This requires, I assume, a netcdf library.  

Yes.

>I am using a Sun workstation.
>WHen I run my program, it states that it can't open the file lnetcdf and
>errno=2 ( file processing errors ).  How can I fix this problem?  

Here is where I get confused by what you are doing.  The netCDF library
is built as a static library during the netCDF installatino.  This means
that the externals contained in libnetcdf.a should be relocated into
your executable at compile/link time.  When you run your program, there
should be no reason to look for the modules since they are already
contained in your executable.

I assume, therefore, that you are seeing this error when you try to
build your executable.  The makefile for the netCDF has several examples
of how to specify the netCDF (and xdr) library in a link line.  Basically,
the compile line should look like:

cc -o name name.c -L/wherever_your_netcdf_library_exists -lnetcdf ...

The -L flag specifies a directory to search for the library; the -lnetcdf
specifies the library to search.

Please let me know if I am off the mark in understanding your problem.  If
I am, please send back a listing of how you build your executable and
the output when you try to run it.

Tom Yoksas