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

Re: Borland C++ for netCDF?



> Organization: University of Alaska
> Keywords: 199409130111.AA09287 netCDF Borland C++

Hi Mark,

> My name is Mark Conde and I have spent the last few days attempting to 
> build the netCDF and XDR libraries using Borland C++ version 3.1 on a PC 
> under the "huge" memory model.  I am having very little success.  I had 
> to extensively modify the "msoft.mk" makefiles and have encountered a 
> number of source-level problems that prevent the compiler from working.  
> For example, I get problems with a data type "off_t" not being defined 
> in borland C++ and problems with function prototypes for "malloc" and 
> "realloc".  The "msoft.mk" files also contain unix-like "rm" commands to 
> clean up after a make which cause problems on PC's which use the "del" 
> command instead.
> 
> I have modified the msoft.mk files such that they now compile the source 
> and build libraries (albeit with heaps of "call to function xxx with no 
> prototype" errors) but the nctest program invariably returns errors from 
> ncopen when I run it.
> 
> Has anyone built netcdf.lib and xdr.lib libraries with a borland C++ 
> compiler to your knowledge?  If so I'd like to contact them since I am 
> not making much progress at the moment.

Yes, Ken Prada of Woods Hole Oceanographic Institution built the libraries
and executable under Borland C++, and made the results available in 

    ftp://ftp.unidata.ucar.edu/pub/netcdf/contrib/borland/

I've appended the ORIGIN file from that directory that is Ken's description
of how he did it and what he made available.

--
Russ Rew                                                UCAR Unidata Program
address@hidden                                          P.O. Box 3000
http://www.unidata.ucar.edu/                          Boulder, CO 80307-3000

-----------------------------------------------------------------------
The libraries to support Borland Turbo C++ (and presumably Borland C++)
are available via ftp from isdl.whoi.edu (128.128.92.66).  They are in
the pub directory in tar format in the file tcc_libs.tar.  There are 
library versions to support small, medium, large, and huge memory models.
The read.me file defines the file names.

The libraries were generated using the following procedure and generated
errors and warnings as described below.  Changes made are also described.

The sources were derived from a version 2.3.2 directory on my workstation.
The files were transferred to a 486/66 PC using PC-NFS.  The program "flip"
was used to convert each file to MSDOS format (CR-LF).  Makefiles specific
to Turbo C++ were generated using the "msoft.mk' files as templates.  The
netcdf and xdr libraries were compiled and tested in large model.
Corrections were made where necessary (see below).  When all was correct,
the additional memory models were generated.

XDR

Several WARNINGS were issued during compilation of xdr.c.  These all related
to an always false conditional in several of the functions.  Generated code
is OK and works properly.

Several warnings were issued during compilation of xdrtest.c.  These 
related to a compiler interpretation of the code resulting from the 
assert macro.  However, the code compiles and runs just fine.  I tested
the macro in a separate test source and looked at the compiled output.
It is OK.

Xdrtest ran fine with proper results.

NETCDF

In var.c at line 187, changed dims[] to *dims to correct a warning.

In xdrposix.c, there is no definition for off_t in the Borland /sys/types.h.
I inserted a "typedef long off_t" and fixed this.  Two other warnings were
issued by the compiler.  These appear to be of a minor nature and should not
affect operation.

NCTEST

Nctest compiled, linked and ran without warnings or errors.  Results
compared perfectly.

NCDUMP

Ncdump was compiled and linked with these libraries.  Ncdump was then run
on several files of differing types and sizes from a variety of sources.
In all cases, the results looked proper.

CONCLUSIONS

These libraries should work fine for use with both Turbo C++ and Borland
C++ (separate and different products).  I will be happy to help out with
any problems that relate to their use.  I will also help with the proper
inclusion of Borland support with the formal distribution if necessary.

Only two corrections to source files were necessary to generate the libraries.
Other changes may be necessary to eliminate all warnings.

I ran the same compilations using Borland C++ 3.1. With similar conclusions.
The only noticeable difference is a large output of "no prototype" warnings
during compilation of the xdr sources.  I was not surprised at these.

I have been using prior versions of netcdf compiled with an older
version of Turbo C (2.0) successfully for several years.  However, I
would not recommend the use of that older version with the latest
versions of netcdf.  Those using that version should upgrade if at all
possible. The upgrade costs are low.

..ken
___________________________________________________________________________
            Ken Prada                 |
Applied Ocean Physics and Engineering |       (508) 457-2000 Ext 2711       
Woods Hole Oceanographic Institution  |          address@hidden
  Woods Hole, Massachusetts  02543    |