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

[UDUNITS #SIM-440751]: [Fwd: udunits-1.12.4_g77 compilation problem]



=?UTF-8?Q?Ga=C5=A1per_=C5=A0tifter?=,

> i am trying to compile udunits on my Ubuntu Dapper system with g77
> compiler. I tried with
> 
> ./configure CPPFLAGS=-Df2cFortran CC=gcc CFLAGS=-O FC=g77 FFLAGS=-O
> 
> I tried to compile netcdf too and it doesn't compile eighter. It would
> be very usefull to heve precompiled binaries for most common
> distributions, my other colegues also complained that it is really hard
> to compile netcdf from your site.
> 
> Could you please help me to solve the problem.
> 
> Thank you in advance.
> 
> I always get:
> 
> make CPPFLAGS=-Df2cFortran CC=gcc CFLAGS=-O FC=g77 FFLAGS=-O
> 
> making `all' in directory /home/gaso/udunits-1.12.4/src/port
> 
> make[1]: Entering directory `/home/gaso/udunits-1.12.4/src/port'
> 
> making `all' in directory /home/gaso/udunits-1.12.4/src/port/misc
> 
> make[2]: Entering directory `/home/gaso/udunits-1.12.4/src/port/misc'
> ar rcuv libudport.a uddummy.o
> case "" in \
> '') ;; \
> *)  ar rucv libudport.a ;; \
> esac
> ranlib libudport.a
> make[2]: Leaving directory `/home/gaso/udunits-1.12.4/src/port/misc'
> 
> returning to directory /home/gaso/udunits-1.12.4/src/port
> 
> 
> making `all' in directory /home/gaso/udunits-1.12.4/src/port/cfortran
> 
> make[2]: Entering directory
> `/home/gaso/udunits-1.12.4/src/port/cfortran'
> make[2]: Nothing to be done for `all'.
> make[2]: Leaving directory `/home/gaso/udunits-1.12.4/src/port/cfortran'
> 
> returning to directory /home/gaso/udunits-1.12.4/src/port
> 
> make[1]: Leaving directory `/home/gaso/udunits-1.12.4/src/port'
> 
> returning to directory /home/gaso/udunits-1.12.4/src
> 
> 
> making `all' in directory /home/gaso/udunits-1.12.4/src/lib
> 
> make[1]: Entering directory `/home/gaso/udunits-1.12.4/src/lib'
> ar rcuv libudunits.a utlib.o utparse.o utscan.o udalloc.o
> case "" in \
> '') ;; \
> *)  ar rucv libudunits.a ;; \
> esac
> ranlib libudunits.a
> make[1]: Leaving directory `/home/gaso/udunits-1.12.4/src/lib'
> 
> returning to directory /home/gaso/udunits-1.12.4/src
> 
> 
> making `all' in directory /home/gaso/udunits-1.12.4/src/udunits
> 
> make[1]: Entering directory `/home/gaso/udunits-1.12.4/src/udunits'
> make[2]: Entering directory `/home/gaso/udunits-1.12.4/src/udunits'
> gcc -o udunits -O udunits.o -L/home/gaso/udunits-1.12.4/src/lib
> -ludunits -L/home/gaso/udunits-1.12.4/src/port/misc -ludport
> /home/gaso/udunits-1.12.4/src/lib/libudunits.a(utlib.o): In function
> `decomp':utlib.c:(.text+0x73a): undefined reference to `fmod'
> /home/gaso/udunits-1.12.4/src/lib/libudunits.a(utlib.o): In function
> `dectime':utlib.c:(.text+0x98b): undefined reference to `floor'
> /home/gaso/udunits-1.12.4/src/lib/libudunits.a(utlib.o): In function
> `utRaise':utlib.c:(.text+0x11b5): undefined reference to `pow'
> /home/gaso/udunits-1.12.4/src/lib/libudunits.a(utlib.o): In function
> `utPrint':utlib.c:(.text+0x20c4): undefined reference to `log10'
> :utlib.c:(.text+0x20cc): undefined reference to `ceil'
> collect2: ld returned 1 exit status
> make[2]: *** [udunits] Error 1
> make[2]: Leaving directory `/home/gaso/udunits-1.12.4/src/udunits'
> make[1]: *** [program] Error 2
> make[1]: Leaving directory `/home/gaso/udunits-1.12.4/src/udunits'
> make: *** [udunits/all] Error 1

The build failed because the C compiler couldn't resolve the references to the 
standard mathematical C functions.  The solution is to define an environment 
variable that tells the C compiler where to find the functions.  For example:

    $ make distclean
    ...
    $ ./configure CPPFLAGS=-Df2cFortran CC=gcc CFLAGS=-O LD_MATH=-lm
    ...
    $ make

In the above example, I assume that the standard C mathematical functions are 
in the "m" library.

Regards,
Steve Emmerson

Ticket Details
===================
Ticket ID: SIM-440751
Department: Support UDUNITS
Priority: Normal
Status: Closed