From owner-freebsd-python@FreeBSD.ORG Fri Mar 5 02:14:13 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C8F916A4CE; Fri, 5 Mar 2004 02:14:13 -0800 (PST) Received: from miffy.openlook.org (openlook.org [211.236.182.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id B554543D48; Fri, 5 Mar 2004 02:14:12 -0800 (PST) (envelope-from perky@miffy.openlook.org) Received: by miffy.openlook.org (Postfix, from userid 1000) id 0033AA9C2; Fri, 5 Mar 2004 19:18:37 +0900 (KST) Date: Fri, 5 Mar 2004 19:18:37 +0900 From: Hye-Shik Chang To: python@FreeBSD.org Message-ID: <20040305101837.GA78274@i18n.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Accept-Language: ko, en User-Agent: Mutt/1.5.5.1i cc: John Hay cc: Dima Dorfman Subject: Python patch to install a shared library X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2004 10:14:13 -0000 Hello, Per requested by many people, I made a patch to make python port to install not only static library but also shared library and its interpreter frontend. This obsoletes BUILD_SHARED option and the port doesn't build PIC binary or library even for amd64 and ia64 anymore. This means that you need to change linking with not static but shared library if you need to embed python into your shared library. Please test this patch on your platform: http://people.freebsd.org/~perky/pyshared.diff Any comments are very welcome. Regards, Hye-Shik From owner-freebsd-python@FreeBSD.ORG Fri Mar 5 03:47:33 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 923C016A4CE for ; Fri, 5 Mar 2004 03:47:33 -0800 (PST) Received: from phalanx.trit.org (phalanx.trit.org [63.198.170.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5C11A43D6D for ; Fri, 5 Mar 2004 03:47:33 -0800 (PST) (envelope-from dima@trit.org) Received: by phalanx.trit.org (Postfix, from userid 406) id F386165C0EC; Fri, 5 Mar 2004 11:47:32 +0000 (UTC) Received: from harpoon.trit.org (harpoon-wifi.trit.org [192.168.4.243]) by phalanx.trit.org (Postfix) with ESMTP id 20D6E65C0EB; Fri, 5 Mar 2004 11:47:30 +0000 (UTC) Received: from harpoon.trit.org (localhost [127.0.0.1]) by harpoon.trit.org (8.12.11/8.12.9) with ESMTP id i25BlTd0017232; Fri, 5 Mar 2004 11:47:29 GMT (envelope-from dima@trit.org) Received: (from dima@localhost) by harpoon.trit.org (8.12.11/8.12.11/Submit) id i25BlNOL017231; Fri, 5 Mar 2004 11:47:23 GMT (envelope-from dima@trit.org) X-Authentication-Warning: harpoon.trit.org: dima set sender to dima@trit.org using -f Date: Fri, 5 Mar 2004 11:47:23 +0000 From: Dima Dorfman To: Hye-Shik Chang Message-ID: <20040305114723.GD15971@trit.org> References: <20040305101837.GA78274@i18n.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040305101837.GA78274@i18n.org> User-Agent: Mutt/1.4i X-PGP-Key: 69FAE582 (http://www.trit.org/~dima/dima.asc) X-PGP-Fingerprint: B340 8338 7DA3 4D61 7632 098E 0730 055B 69FA E582 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on phalanx.trit.org X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.61 cc: John Hay cc: python@FreeBSD.org Subject: Re: Python patch to install a shared library X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2004 11:47:33 -0000 Hye-Shik Chang wrote: > Per requested by many people, I made a patch to make python port > to install not only static library but also shared library and its > interpreter frontend. This obsoletes BUILD_SHARED option and the > port doesn't build PIC binary or library even for amd64 and ia64 > anymore. This means that you need to change linking with not static > but shared library if you need to embed python into your shared > library. This looks good to me, thanks! (I'll try it tomorrow.) I mentioned this in my previous message, but maybe someone else on the list has comments. The normal Python distribution puts libpython.so into $PREFIX/lib/pythonX.Y/config, and that's where some packages expected it to be (e.g., PostgreSQL's PL/Python (I made a port for it) normally expects it to be there). It's easy enough to change those packages to look in $PREFIX/lib, but I think a symlink from the config directory to the real libpython.so might be a good idea. I don't insist on this--just an idea :-). Thanks again! Dima. From owner-freebsd-python@FreeBSD.ORG Fri Mar 5 09:48:49 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 30F9116A4CE for ; Fri, 5 Mar 2004 09:48:49 -0800 (PST) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.46]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCF5043D1F for ; Fri, 5 Mar 2004 09:48:48 -0800 (PST) (envelope-from cswiger@mac.com) Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (8.12.6/MantshX 2.0) with ESMTP id i25HmmRu026265; Fri, 5 Mar 2004 09:48:48 -0800 (PST) Received: from [10.1.1.193] ([199.103.21.225]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 3.0) with ESMTP id i25HmkDZ029452; Fri, 5 Mar 2004 09:48:47 -0800 (PST) In-Reply-To: <20040305101837.GA78274@i18n.org> References: <20040305101837.GA78274@i18n.org> Mime-Version: 1.0 (Apple Message framework v612) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <65B66A6C-6ECD-11D8-BB2A-003065ABFD92@mac.com> Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Fri, 5 Mar 2004 12:49:06 -0500 To: Hye-Shik Chang X-Mailer: Apple Mail (2.612) cc: python@FreeBSD.org Subject: Re: Python patch to install a shared library X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2004 17:48:49 -0000 On Mar 5, 2004, at 5:18 AM, Hye-Shik Chang wrote: > Please test this patch on your platform: > http://people.freebsd.org/~perky/pyshared.diff Thank you for the work on this. The patch applies cleanly, and the resulting Python binaries seem OK (ia32 running 4.9 & 5.2.1)-- they pass "make test" and Mailman has been working fine when I restarted it to run using the new binary. -- -Chuck From owner-freebsd-python@FreeBSD.ORG Fri Mar 5 14:42:37 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0390A16A4D3; Fri, 5 Mar 2004 14:42:37 -0800 (PST) Received: from smaug.vex.net (smaug.vex.net [66.246.136.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF7FD43D41; Fri, 5 Mar 2004 14:42:36 -0800 (PST) (envelope-from x@xxvii.net) Received: from bee.vii.net (69-90-55-67.fastdsl.ca [69.90.55.67]) by smaug.vex.net (Postfix) with ESMTP id A9CF125910; Fri, 5 Mar 2004 17:42:34 -0500 (EST) Received: by bee.vii.net (Postfix, from userid 1000) id 933A7BEB8; Fri, 5 Mar 2004 17:42:27 -0500 (EST) From: Tim Middleton Organization: xxvii.net To: python@freebsd.org Date: Fri, 5 Mar 2004 17:42:26 -0500 User-Agent: KMail/1.6 References: <20040305101837.GA78274@i18n.org> In-Reply-To: <20040305101837.GA78274@i18n.org> X-Whee: Yes, Please. MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200403051742.26067.x@Vex.Net> cc: John Hay cc: Hye-Shik Chang cc: Dima Dorfman Subject: Re: Python patch to install a shared library X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Mar 2004 22:42:37 -0000 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. 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. 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. Nice work. -- Tim Middleton | Cain Gang Ltd | Then suddenly, for no apparent reason, the x@veX.net | www.Vex.Net | unpittying orchestra struck up a polka. -D From owner-freebsd-python@FreeBSD.ORG Fri Mar 5 17:34:38 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 036B516A4CE for ; Fri, 5 Mar 2004 17:34:38 -0800 (PST) Received: from miffy.openlook.org (openlook.org [211.236.182.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1FA343D2F for ; Fri, 5 Mar 2004 17:34:37 -0800 (PST) (envelope-from perky@miffy.openlook.org) Received: by miffy.openlook.org (Postfix, from userid 1000) id 13B58A96C; Sat, 6 Mar 2004 10:39:06 +0900 (KST) Date: Sat, 6 Mar 2004 10:39:06 +0900 From: Hye-Shik Chang To: python@FreeBSD.org Message-ID: <20040306013906.GA35278@i18n.org> References: <20040305101837.GA78274@i18n.org> <200403051742.26067.x@Vex.Net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403051742.26067.x@Vex.Net> X-Accept-Language: ko, en User-Agent: Mutt/1.5.5.1i Subject: Re: Python patch to install a shared library X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2004 01:34:38 -0000 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 From owner-freebsd-python@FreeBSD.ORG Fri Mar 5 17:34:38 2004 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0841916A4CF; Fri, 5 Mar 2004 17:34:38 -0800 (PST) Received: from miffy.openlook.org (openlook.org [211.236.182.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 85AA343D1F; Fri, 5 Mar 2004 17:34:37 -0800 (PST) (envelope-from perky@miffy.openlook.org) Received: by miffy.openlook.org (Postfix, from userid 1000) id AD8A9A966; Sat, 6 Mar 2004 10:23:03 +0900 (KST) Date: Sat, 6 Mar 2004 10:23:03 +0900 From: Hye-Shik Chang To: Tim Middleton Message-ID: <20040306012303.GA34589@i18n.org> References: <20040305101837.GA78274@i18n.org> <200403051742.26067.x@Vex.Net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200403051742.26067.x@Vex.Net> X-Accept-Language: ko, en User-Agent: Mutt/1.5.5.1i cc: John Hay cc: python@freebsd.org cc: Dima Dorfman Subject: Re: Python patch to install a shared library X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2004 01:34:38 -0000 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