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.
Ruth, >Date: Mon, 29 Sep 2003 15:42:54 -0400 >From: Ruth Platner <address@hidden> >Organization: University of Rhode Island >To: Steve Emmerson <address@hidden> >Subject: Re: 20030926: udunits and fortran Mac OSX 10.2. The above message contained the following: > I tried setenv CXX gcc2, setenv CXX gcc, and setenv CXX cc and they > all ended in the same compiler error. cc, gcc and gcc2 are all > symbolically linked so trying all of them was silly, but I thought I > should try everything. Again I've included the logs again and env.log > is the output of env in case you're curious about my environment. > > Ruth ... > filename="make.log" ... > making `all' in directory /udunits-1.11.7/src/udunits > > cc -c -O -I../lib -I../port/misc -Df2cFortran udunits.c > @CXX@ -o udunits udunits.o -L/udunits-1.11.7/src/lib -ludunits > -L/udunits-1.11.7/src/port/misc -ludport -ly > /bin/sh: @CXX@: command not found > make[2]: *** [udunits] Error 1 > make[1]: *** [program] Error 2 > make: *** [udunits/all] Error 1 My fault. The configure script doesn't look for a C++ compiler, so it wouldn't matter how the environment variable CXX was set. Try this: 1. Go to the "udunits/" subdirectory 2. Edit the file "Makefile": change dummy_prog $(PROGRAM): $(OBJS) @if [ -r $@.f -o -r $@.F ]; then \ ld='$(FC) -o $@ $(FFLAGS)'; \ elif [ -r $@.cc -o -r $@.C ]; then \ ld='$(CXX) -o $@ $(CXXFLAGS)'; \ else \ ld='$(CC) -o $@ $(CFLAGS)'; \ fi; \ cmd="$$ld $(LDFLAGS) $(OBJS) $(LIBS)"; \ echo $$cmd; \ $$cmd \ || (rm -f $@; exit 1) to dummy_prog $(PROGRAM): $(OBJS) $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) Mind the existance of tab characters. Use the other rules as examples. 3. Execute the command "make" in the subdirectory. 4. If that succeeds, then go up one directory and execute the command "make". Please let me know if this helps. Regards, Steve Emmerson