[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20030804: udunits on cygwin
- Subject: 20030804: udunits on cygwin
- Date: Mon, 04 Aug 2003 15:26:12 -0600
Connor,
>Date: Mon, 04 Aug 2003 14:11:36 -0700
>From: "Flynn, Connor J" <address@hidden>
>Organization: NOAA/PNL
>To: Steve Emmerson <address@hidden>
>Subject: RE: 20030804: udunits on cygwin
The above message contained the following:
> I've cc'd the developer (Jason Christy) working for me that actually
> understands what is going on (at least much better than I). Please
> include Jason on further contact because I'll soon be out of my depth.
...
> Well I'll be... I didn't believe you at first and proceeded to dig deep
> inside your make files and Cywgin bash and sh to prove it to myself.
> You're absolutely right.
>
> Anyway, I guess Cygwin users should be instructed to alter their
> environment space and change the input files. Instead of changing the
> configure script I also tried modifying src\port\master.mk.in file to
> reverse the test for C vs C++ (so the case-insensitive test defaults to
> C) as below:
>
> dummy_prog $(PROGRAM): $(OBJS)
> @if [ -r $@.f -o -r $@.F ]; then \
> ld='$(FC) -o $@ $(FFLAGS)'; \
> elif [ -r $@.c ]; then \
> ld='$(CC) -o $@ $(CFLAGS)'; \
> elif [ -r $@.cc -o -r $@.C ]; then \
> ld='$(CXX) -o $@ $(CXXFLAGS)'; \
> else \
> ld='$(CC) -o $@ $(CFLAGS)'; \
> fi; \
>
> This works too.
>
> At this point, the cygwin user need only add one environment variable
> (apparently any of the fortran flags) and make one change to the
> master.mk.in file above.
>
> Which brings me back to the Fortran flag. If UDUNITS doesn't use the
> fortran compiler, then why check for it? Can you please explain?
The UDUNITS package doesn't use a Fortran compiler, but it does build a
Fortran-callable interface from C code. Because the argument-passing
conventions used by Fortran are compiler-dependent, the C compiler must
be told what set of conventions to use. This is the reason for defining
a particular C macro in the CPPFLAGS environment variable from the
candidates in the file "cfortran.h".
If the Fortran interface of the UDUNITS package won't be used, then it
doesn't matter which C macro is defined -- only that one is. If the
Fortran interface will be used, then it is necessary to define the
appropriate C macro.
> Ciao for now!
> Connor
Regards,
Steve Emmerson