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

20020924: Unsatisfied UDUNITS symbols when linking readgeneral.f



Hans-Juergen,

>Date: Tue, 24 Sep 2002 11:08:15 +0200 (METDST)
>From: Hans-Juergen Panitz <address@hidden>
>Organization: Institut =?iso-8859-1?Q?f=FCr?= Meteorologie und Klimaforschung
>To: address@hidden
>Subject: Re: 20020923: Unsatisfied UDUNITS symbols when linking readgeneral.f
>Keywords: 200209231227.g8NCRs103672

The above message contained the following:

> thank you for your quick answer. I performed the command you suggested
> for all unsatisfied symbols (The result of the nm command for the
> whole library is attached). The result was:
> 
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i uttime
> uttime_             |      4760|extern|entry  |$CODE$
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i utcaltime
> utcaltime_          |     19120|extern|entry  |$CODE$
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i utopen   
> utopen_             |     11736|extern|entry  |$CODE$
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i utfree
> utfree_             |     19520|extern|entry  |$CODE$
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i utdec 
> utdec_              |     12432|extern|entry  |$CODE$
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i utcaltime
> utcaltime_          |     19120|extern|entry  |$CODE$
> $ nm -g /opt/udunits/lib/libudunits.a |grep -i utmake   
> utmake_             |     19368|extern|entry  |$CODE$
> 
> All symbols are defined it the library but all with an underscore at the end.
> Thus I included the underscore whenever the routines appear in the FORTRAN 
> program.
> 
> Then I performed the following f90-command:
> 
> f90 -o readgeneral  readgeneral.f -L/opt/netcdf/lib -lnetcdf 
> -L/opt/udunits/lib 
> -ludunits
> 
> that lead to the following result:
> 
> readgeneral.f
>    main program 
>    external subroutine GRIDREAD
>    external subroutine UNPACK
>    external subroutine TIMEINDEX
>    external subroutine XHOUR
>    external subroutine UDPARSE
>    external subroutine UDUERR
>    external function NBLEN
> 
> 4069 Lines Compiled
> /usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (readgeneral.o) 
> was 
> detected. The linked output may not run on a PA 1.x system.
> /usr/ccs/bin/ld: Unsatisfied symbols:
>    ceil (code)
>    floor (code)
>    log10 (code)
>    pow (code)
>    fmod (code)

The above symbols are the names of functions in the Standard C math
library.  They are used by the UDUNITS library.

Try adding a reference to the math library to your link-command.
Typically, the reference is "-lm".  For example

    f90 -o readgeneral  readgeneral.f -L/opt/netcdf/lib -lnetcdf 
-L/opt/udunits/lib -ludunits -lm

Please let me know if this helps.

Regards,
Steve Emmerson   <http://www.unidata.ucar.edu>


NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.