[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: netCDF in CodeWarrior
- Subject: Re: netCDF in CodeWarrior
- Date: Mon, 03 Mar 2003 09:09:46 -0700
>To: address@hidden
>From: "John A. Dutton" <address@hidden>
>Subject: Re: 20030228: netCDF in CodeWarrior
>Organization: College of Earth and Mineral Sciences, The Pennsylvania State
>University
>Keywords: 200303010330.h213Uj302362
Hi John,
> After a long delay, I got the folks at Metrowerks to tell me that the
> present version of Mac OS X requires that I use a Mach-O project for
> the libraries to be accessible.
>
> That done, I can now include the libnetcdf.a library along with the
> netcdf.h header file.
>
> But compiling I get two link errors about undefined code from the library:
>
> _moddi3 (code) from page size
>
> and
>
> _divdi3 (codce) from add_to_NCList.
>
> Since it seems we are getting warm, I would appreciate any hints on
> how to complete this compilation.
There are no explicit calls to any "_moddi3" or "_divdi3" functions in
any of the netCDF sources and I hadn't heard of these before.
Searching with Google, these appear to be part of a BSD kernel library
to support 128-bit integer division. Since netCDF doesn't even
provide any support for 64-bit integers and doesn't do any dividing in
the referenced "pagesize" or "add_to_NCList" functions in
libsrc/posixio.c and libsrc/nc.c respectively, I'm not sure why these
functions are needed.
I suspect what may be going on is an attempt to link objects compiled
with one compiler (/usr/bin/cc in Mac OS X, for example, which is a
version of gcc) with objects or libraries compiled with another
compiler (CodeWarrior) and the latter compiler can't find the run-time
support functions used by the objects compiled with the former
compiler.
In support of this theory, I notice that on Mac OS X, the library
/usr/lib/libgcc.a contains _moddi3.o and _divdi3.o:
$ nm "/usr/lib/libgcc.a(_moddi3.o)" "/usr/lib/libgcc.a(_divdi3.o)"
/usr/lib/libgcc.a(_moddi3.o):
000006e8 s _EH_unwind_info
U ___clz_tab
00000000 T ___moddi3
00000118 t ___udivmoddi4
000006fc S __moddi3.eh
00000724 s __udivmoddi4.eh
/usr/lib/libgcc.a(_divdi3.o):
000006e4 s _EH_unwind_info
U ___clz_tab
00000000 T ___divdi3
00000114 t ___udivmoddi4
000006f8 S __divdi3.eh
00000720 s __udivmoddi4.eh
so you might get around the problems by just including the library
/usr/lib/libgcc.a in your link line, or add
-L/usr/lib/libgcc.a -lgcc
to the link line, which is the same thing. Please let me know if
this works.
--Russ
_____________________________________________________________________
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu