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

Re: Windows NT netCDF question



>From: address@hidden
>Organization: ?
>Keywords: 199511091934.AA05147 netCDF 2.4-beta2

Hi Tom,

>      I am trying to compile the netCDF library and support programs, but I
>      seem to be missing some files.  I have the same setup as listed in the 
>      INSTALL document:
>      
>      On a Windows NT system:
>      
>             The netCDF package has been tested on Windows NT 3.51 using 
>      Visual C++ 2.2 and Fortran Powerstation 1.0.  The '*.mak' files 
>      provided are for use within these systems.  Build in the 
>      subdirectories in the order util, xdr, libsrc, nctest, fortran, 
>      ncdump, ncgen.
>      
>      Except that I am not using Fortran, and the "util" directory is not 
>      included in the release.

Oops, you're right, and you're the first one to point out this problem.  The
only thing in the util directory is C source for getopt.c, which I've
appended.  I'll have to put together a beta3 that has the util/ directory.
I'll let you know when it's available, but it probably won't be until
Monday.

>                                As far as I can tell, the only things 
>      missing have to do with specific modifications needed for NT systems.
>      Could you please send me the missing files?  Or if you do not have 
>      them, could you send me the email address of the person who did the 
>      port to NT?

We still aren't set up here to test the NT port, so I can't tell what else
is missing.  If you know some file names, please let me know.  The person
who did the port is

    Donald Denbo, Pacific Northwest Laboratory
    address@hidden

I would prefer it if you could try the beta3 version I'll put up by Monday
before contacting Denbo, because I'm trying to return his favor for donating
the changes by not forwarding too many Windows NT support questions to him.

Thanks.

______________________________________________________________________________

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

-------------------- util/getopt.c -------------------------------
/*LINTLIBRARY*/
#include "winnt_io.h"
#define NULL    0
#define EOF     (-1)
#define ERR(s, c)       if(opterr){\
        extern int strlen(), write();\
        char errbuf[2];\
        errbuf[0] = c; errbuf[1] = '\n';\
        (void) write(2, argv[0], strlen(argv[0]));\
        (void) write(2, s, strlen(s));\
        (void) write(2, errbuf, 2);}

extern int      strcmp();
extern char    *strchr();

int             opterr = 1;
int             optind = 1;
int             optopt;
char           *optarg;

int
getopt(argc, argv, opts)
    int             argc;
    char          **argv, *opts;
{
    static int      sp = 1;
    register int    c;
    register char  *cp;

    if (sp == 1)
        if (optind >= argc ||
            argv[optind][0] != '-' || argv[optind][1] == '\0')
            return (EOF);
        else if (strcmp(argv[optind], "--") == NULL) {
            optind++;
            return (EOF);
        }
    optopt = c = argv[optind][sp];
    if (c == ':' || (cp = strchr(opts, c)) == NULL) {
        ERR(": unknown option, -", c);
        if (argv[optind][++sp] == '\0') {
            optind++;
            sp = 1;
        }
        return ('?');
    }
    if (*++cp == ':') {
        if (argv[optind][sp + 1] != '\0')
            optarg = &argv[optind++][sp + 1];
        else if (++optind >= argc) {
            ERR(": argument missing for -", c);
            sp = 1;
            return ('?');
        }
        else
            optarg = argv[optind++];
        sp = 1;
    }
    else {
        if (argv[optind][++sp] == '\0') {
            sp = 1;
            optind++;
        }
        optarg = NULL;
    }
    return (c);
}