This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Steve Emmerson writes: > Brian, > > > To: address@hidden > > From: Brian Blanton <address@hidden> > > Subject: compiling of UDUNITS > > Organization: . > > Keywords: 199910041334.HAA12148 > > In the above message, you wrote: > > > I am trying to compile udunits on a Linux (2.2.5) machine with > > AbsoftProFortran. I set CC=gcc, CFLAGS=-DAbsoftProFortran, > > and FC=f77, do "configure", then "make", and get the following error > > message: > > > > ... > > > > make[1]: Entering directory `/root/UNIDATA/udunits-1.11.7/src/lib' > > ln -s ../port/misc/udalloc.c . > > ln -s ../port/misc/udalloc.h . > > gcc -ansi -c -DAbsoftProFortran -I../port/misc -I../port/cfortran > > -DUT_DEFAULT_PATH='"/usr/local/etc/udunits.dat"' utlib.c > > utlib.c:1882: parse error before `0' > > make[1]: *** [utlib.o] Error 1 > > make[1]: Leaving directory `/root/UNIDATA/udunits-1.11.7/src/lib' > > make: *** [lib/all] Error 1 > > > > I have also tried "#define AbsoftProFortran", but I'm not really > > sure where to put it. > > > > Unfortunately, we need this library to be compatable with Absoft. > > > > Have you seen this before? > > > > Thanks, > > > > Brian O. Blanton > > Department of Marine Sciences > > Ocean Processes Numerical Modeling Lab > > University of North Carolina @ Chapel Hill > > tel #: 919 962 0022 > > email: address@hidden > > http://www.opnml.unc.edu > > It looks like you did the right thing. > > I haven't seen this problem before -- but it looks tractable. > > I'll need to see the output from the C preprocessor. Would you please > do the following: > > 1. Go into the subdirectory "lib/". > > 2. Execute the command "make utlib.i". > > 3. Send me the function "utMake" (or "UTMAKE") from the file > "utlib.i". > > You guys recovered from Floyd yet? > > -------- > Steve Emmerson <http://www.unidata.ucar.edu> Thanks for the quick response. We (here in Chapel Hill) were relatively unaffected by the hurricane. But east of here is still a huge mess. Here's the diagnostic as per above. After hitting return on "make utlib, I get the following: gcc -E -I../port/misc -I../port/cfortran -DUT_DEFAULT_PATH='"/root/udunits-1.11. 7/etc/udunits.dat"' utlib.c > utlib.i In file included from utlib.c:29: ../port/cfortran/cfortran.h:153: #error "cfortran.h: Can't find your environmen t among:\ - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...) \ - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000 \ - VAX VMS CC 3.1 and FORTRAN 5.4. \ - Alpha VMS DEC C 1.3 and DEC FORTRAN 6.0. \ - Alpha OSF DEC C and DEC Fortran for OSF/1 AXP Version 1.2 \ - Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7. \ - CRAY \ - NEC SX-4 SUPER-UX \ - CONVEX \ - Sun \ - PowerStation Fortran with Visual C++ \ - HP9000s300/s700/s800 Latest test with: HP-UX A.08.07 A 9000/730 \ - LynxOS: cc or gcc with f2c. \ - VAXUltrix: vcc,cc or gcc with f2c. gcc or cc with f77. \ - f77 with vcc works; but missing link magic for f77 I/O. \ - NO fort. None of gcc, cc or vcc generate required names.\ - f2c : Use #define f2cFortran, or cc -Df2cFortran \ - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran \ - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran \ - Absoft Pro Fortran: Use #define AbsoftProFortran \ - Portland Group Fortran: Use #define pgiFortran" This is what I thought I was fixing by using -DAbsoftProFortran. But the above error message says I should be doing #define AbsoftProFortran, but I don't know where to put it. As for utlib.i, the only place utmake occurs is as follows: extern utUnit* utmake (void ) { utUnit* A0 ; A0 = utNew (); return A0; } This file (utlib.i) appears wierd in emacs, so I hope I got the part you need. If not, I'll send you the entire file. Thanks, Brian