Re: [HACKERS] Threaded python on FreeBSD
On 10/16/06, Bruce Momjian [EMAIL PROTECTED] wrote: Jim C. Nasby wrote: On Sun, Oct 15, 2006 at 06:19:12PM -0400, Tom Lane wrote: I suspect the problem here is that the backend isn't linked with -lpthread. We aren't going to let libpython dictate whether we do so, either... Fix config test to report this earlier. -- marko pybsd.diff Description: Binary data ---(end of broadcast)--- TIP 4: Have you searched our list archives? http://archives.postgresql.org
Re: [HACKERS] Threaded python on FreeBSD
Marko Kreen wrote: On 10/16/06, Bruce Momjian [EMAIL PROTECTED] wrote: Jim C. Nasby wrote: On Sun, Oct 15, 2006 at 06:19:12PM -0400, Tom Lane wrote: I suspect the problem here is that the backend isn't linked with -lpthread. We aren't going to let libpython dictate whether we do so, either... Fix config test to report this earlier. Fixed. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 5: don't forget to increase your free space map settings
[HACKERS] Threaded python on FreeBSD
Currently, the FreeBSD ports make the following change when building python: --- src/pl/plpython/Makefile.orig Fri Nov 19 20:23:01 2004 +++ src/pl/plpython/MakefileTue Dec 28 23:32:16 2004 @@ -9,7 +9,7 @@ # shared library. Since there is no official way to determine this # (at least not in pre-2.3 Python), we see if there is a file that is # named like a shared library. -ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*)) +ifneq (,$(wildcard $(python_libdir)/../../libpython*$(DLSUFFIX)*)) shared_libpython = yes endif If that's not in-place, plpython won't build if the python that's installed is multi-threaded: http://pgbuildfarm.org/cgi-bin/show_log.pl?nm=tapirdt=2006-10-14%2017:32:41 I'm turning off threading in my python for now, but ISTM it'd be good to allow for building plpython from source. (This is python2.5 and FreeBSD 6.1). I looked around the config files but didn't see a clean way to handle this (and maybe the issue is actually with autoconf...) -- Jim Nasby[EMAIL PROTECTED] EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) ---(end of broadcast)--- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq
Re: [HACKERS] Threaded python on FreeBSD
Jim C. Nasby wrote: Currently, the FreeBSD ports make the following change when building python: --- src/pl/plpython/Makefile.orig Fri Nov 19 20:23:01 2004 +++ src/pl/plpython/MakefileTue Dec 28 23:32:16 2004 @@ -9,7 +9,7 @@ # shared library. Since there is no official way to determine this # (at least not in pre-2.3 Python), we see if there is a file that is # named like a shared library. -ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*)) +ifneq (,$(wildcard $(python_libdir)/../../libpython*$(DLSUFFIX)*)) shared_libpython = yes endif Since python_libdir is /usr/local/lib on this platform, this would look for libpython in /usr, which makes no sense. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster
Re: [HACKERS] Threaded python on FreeBSD
On Sun, Oct 15, 2006 at 10:39:49PM +0200, Peter Eisentraut wrote: Jim C. Nasby wrote: Currently, the FreeBSD ports make the following change when building python: --- src/pl/plpython/Makefile.orig Fri Nov 19 20:23:01 2004 +++ src/pl/plpython/MakefileTue Dec 28 23:32:16 2004 @@ -9,7 +9,7 @@ # shared library. Since there is no official way to determine this # (at least not in pre-2.3 Python), we see if there is a file that is # named like a shared library. -ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*)) +ifneq (,$(wildcard $(python_libdir)/../../libpython*$(DLSUFFIX)*)) shared_libpython = yes endif Since python_libdir is /usr/local/lib on this platform, this would look for libpython in /usr, which makes no sense. Take a look at the failure output... ERROR: could not load library /home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so: dlopen (/home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so) failed: /usr/local/lib/python2.5/config/libpython2.5.so: Undefined symbol pthread_attr_destroy For some reason, it's thinking that the lib directory is /usr/local/lib/python2.5/config (there's a symlink of libpython2.5.so in there). Looking at the python port, I don't see anything that indicates this is a FreeBSD-ism, either... -- Jim Nasby[EMAIL PROTECTED] EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [HACKERS] Threaded python on FreeBSD
Jim C. Nasby [EMAIL PROTECTED] writes: Take a look at the failure output... ERROR: could not load library /home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so: dlopen (/home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so) failed: /usr/local/lib/python2.5/config/libpython2.5.so: Undefined symbol pthread_attr_destroy I suspect the problem here is that the backend isn't linked with -lpthread. We aren't going to let libpython dictate whether we do so, either... regards, tom lane ---(end of broadcast)--- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match
Re: [HACKERS] Threaded python on FreeBSD
On Sun, Oct 15, 2006 at 06:19:12PM -0400, Tom Lane wrote: Jim C. Nasby [EMAIL PROTECTED] writes: Take a look at the failure output... ERROR: could not load library /home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so: dlopen (/home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so) failed: /usr/local/lib/python2.5/config/libpython2.5.so: Undefined symbol pthread_attr_destroy I suspect the problem here is that the backend isn't linked with -lpthread. We aren't going to let libpython dictate whether we do so, either... Isn't that what --enable-thread-safety does? I know I've made at least one test with that enabled (though it may not be the failure I linked up-thread). -- Jim Nasby[EMAIL PROTECTED] EnterpriseDB http://enterprisedb.com 512.569.9461 (cell) ---(end of broadcast)--- TIP 6: explain analyze is your friend
Re: [HACKERS] Threaded python on FreeBSD
Jim C. Nasby wrote: On Sun, Oct 15, 2006 at 06:19:12PM -0400, Tom Lane wrote: Jim C. Nasby [EMAIL PROTECTED] writes: Take a look at the failure output... ERROR: could not load library /home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so: dlopen (/home/buildfarm/buildfarm/HEAD/inst/lib/postgresql/plpython.so) failed: /usr/local/lib/python2.5/config/libpython2.5.so: Undefined symbol pthread_attr_destroy I suspect the problem here is that the backend isn't linked with -lpthread. We aren't going to let libpython dictate whether we do so, either... Isn't that what --enable-thread-safety does? I know I've made at least one test with that enabled (though it may not be the failure I linked up-thread). --enable-thread-safety doesn't add threading to the backend, only libpq and ecpg. -- Bruce Momjian [EMAIL PROTECTED] EnterpriseDBhttp://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. + ---(end of broadcast)--- TIP 2: Don't 'kill -9' the postmaster