Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Mar 2004 10:39:06 +0900
From:      Hye-Shik Chang <perky@i18n.org>
To:        python@FreeBSD.org
Subject:   Re: Python patch to install a shared library
Message-ID:  <20040306013906.GA35278@i18n.org>
In-Reply-To: <200403051742.26067.x@Vex.Net>
References:  <20040305101837.GA78274@i18n.org> <200403051742.26067.x@Vex.Net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 05, 2004 at 05:42:26PM -0500, Tim Middleton wrote:
> On Friday 05 March 2004 05:18, Hye-Shik Chang wrote:
> > Please test this patch on your platform:
> >  http://people.freebsd.org/~perky/pyshared.diff
> 
> It's been quite a while since i tried BUILD_SHARED on a -CURRENT box (I had 
> problems with it last time I tried... quite a long time ago, if i recall 
> correctly). I always BUILD_SHARED on -STABLE boxes these days though, and it 
> works great.
> 
> I've built with this patch on the -CURRENT box i'm now typing on (ordinary 
> i386), and it appears to be working nicely so far. Looks good to me.
> 

Thanks for the testing.

> I wonder if the BUILD_SHARED knob should not be kept though. It seems this
> patched port installs static as bin/python[2.3] ... along with
> bin/python-shared[2.3]. But people who are used to BUILD_SHARED probably
> won't expect bin/python now to be a non-shared version, which they then will
> have to overwrite with the shared version manually.

Because static one is faster than shared because of PIC optimization
and some others. See:

% python /usr/local/lib/python2.3/test/pystone.py
Pystone(1.1) time for 50000 passes = 2.67188
This machine benchmarks at 18713.5 pystones/second
% python-shared /usr/local/lib/python2.3/test/pystone.py
Pystone(1.1) time for 50000 passes = 3.27344
This machine benchmarks at 15274.5 pystones/second

I think python-shared isn't useful as libpython2.3.so and the only
case when python-shared is useful will be this:

 python-shared -> xyzmodule.so extension module -> libxyz.so -> libpython2.3.so
 (where libxyz.so is doing both of extending and embedding)

> Perhaps if BUILD_SHARED is specified then bin/python will be the shared
> binary; and bin/python-static[2.3] would also be placed. But this is starting
> to get confusing... maybe it should always install python-static and
> python-shared ... and the knob just control which is copied to plain
> bin/python.
>
> Well, just my observations anyhow. Doesn't really matter to me.

Yes. It's too confusing. If anyone really wants to make his bin/python
as shared binary, I will consider this again then. :)

Thanks!

Regards,
Hye-Shik



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040306013906.GA35278>