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

970611: MS-DOS support for netCDF



Cyril,

>Date: Tue, 10 Jun 1997 22:56:27 -0400 (EDT) 
>From: address@hidden
>Organization: KEO Consultants
>To: address@hidden
>Subject: netCDF for DOS problems cont... 
>Keywords: 199705081559.JAA25699

In the above message, you wrote:

> I had been talking with you about trying to implement the netCDF libraries
> under the DOS environment and was having no luck with the djgpp environment
> make files.
> 
> You had suggested trying to compile the netcdf version 3.3 package under
> Visual C (Microsoft) and I have been having more success with this route.
>  There are some unresolved problems that I was wondering if you could help me
> with.
> 
> First of all, I have the following unresolved/undefined funtions:
> 
> In file ncx.c:
>    get_ix_float
>    put_ix_float
>    get_ix_double
>    put_ix_double

The above functions should be defined in file libsrc/ncx.c.

> 
> In file putget.c:
>    NC_fill_int

The above function should be defined in file libsrc/putget.c.

There are several variants of the functions in the files -- depending on
the values for certain conditional compilation C preprocessor macros.
You'll need to investigate what values these macros should have on your
system and ensure that they are appropriately set.  Most of them are set
in the file libsrc/ncconfig.h, which the "configure" script creates from
libsrc/ncconfig.in.

> 
> Where would these functions be defined?
> 
> I couldn't figure out how to get the ncconfig.in file to work once I changed
> it to ncconfig.h.  The settings didn't seem to affect the following problems
> which I know are related:
> 
> uchar definitions:
>       I just manually changed all "uchar" definitions to "unsigned char".  I
> assume that this should work fine.

Setting "uchar" to "unsigned char" in libsrc/ncconfig.h should also work.

> 
> ssize_t definitions:
>      I just manually changed all "ssize_t" definitions to "size_t".  I am not
> so sure this is acceptable, because I couldn't find any references to what
> ssize_t actually is, but at least things compile now!

"ssize_t" is the signed counterpart of "size_t" (e.g. "long" if "size_t"
is an "unsigned long").  Setting it appropriately for you system in
libsrc/ncconfig.h should suffice.

> 
> #error directives:
>     all of the #error preprocessor directives gave me fatal errors,

They're supposed to.

> and I
> couldn't figure out why.  I just commented these statements out to enable me
> to actually compile the library.

The "#error" directives are designed to handle the "last resort" case in
a sequence of conditional compilation alternatives when the C
preprocessor macros haven't been appropriately set.  I would work on
setting the macros appropriately rather than remove the only directive
that tells you that there's problem.

> 
> With the above, I am able to compile the library from the libsrc files, but
> it doesn't work because of the unresolved externals mentioned above.  But I
> feel I made some progress!
> 
> There were another 42 warnings either:
>    "signed/unsigned mismatch"
>    "conversion between different data types"
> 
> I wasn't sure whether this was acceptable or not,

Typically, this is acceptable (expected, even).  This is because the
netCDF-3 package is designed to handle conversion between types.

> but thought that this can
> wait until the above are resolved.
> 
> Would you suggest that I keep on this tract?

I'd work on getting the C preprocessor macros right for your system and
leave the code as intact as possible.

We're currently working on porting the netCDF-3 package to a Win32
system.  It'll probably be ready next week.

--------
Steve Emmerson   <address@hidden>