[pyicu-dev] setup.py? Eggs?
Jim Fulton
jim at zope.com
Wed Nov 30 10:00:06 PST 2005
Andi Vajda wrote:
>
> On Wed, 30 Nov 2005, Jim Fulton wrote:
>
>> Andi Vajda wrote:
>>
>>>
>> ...
>>
>>> The other kink is that there is a shared library being built that is
>>> not a python extension. The reason for it is that I couldn't find any
>>> other way for all the other python extensions in PyICU to share
>>> common code on the Mac. On Mac OS X, python extension are bundles and
>>> you cannot link a bundle with another bundle.
>>> Another option was to make all extensions be just one, and that is
>>> the way I started the project, but the SWIG generated C++ code just
>>> became too large.
>>
>>
>> Why does it matter how large the C++ code is?
>
>
> Because it eventually takes gcc wayyyy to long to compile the file (10
> minutes) and it may even have choked.
Hm. C++. Dang.
>> Is it feasible to statically link the common code into each
>> extension?
>
>
> This common code is define in common.cpp. There are few string
> conversion functions in there for which I'm pretty sure this would be
> possible.
> There also is a C++ exception defined in there that I don't know if it
> is possible to duplicate since I don't know how exception catching would
> work across modules with the same exception statically defined in
> multiple places (I reach my meagre C++ knowledge quite fast).
A nice way to share Python (and limited C) objects accross modules
is Python's own module system. One of your extensions could define the
exception and the other exceptions could then import this exception
from the extension that defined it. I think this would be much cleaner
than fooling with a shared library.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the pyicu-dev
mailing list