Обсуждение: 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/Makefile Tue 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), wesee 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 = yesendif 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=tapir&dt=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 jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
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/Makefile Tue 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/
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/Makefile Tue 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 jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
"Jim C. Nasby" <jim@nasby.net> 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
On Sun, Oct 15, 2006 at 06:19:12PM -0400, Tom Lane wrote: > "Jim C. Nasby" <jim@nasby.net> 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 jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)
Jim C. Nasby wrote: > On Sun, Oct 15, 2006 at 06:19:12PM -0400, Tom Lane wrote: > > "Jim C. Nasby" <jim@nasby.net> 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 bruce@momjian.us EnterpriseDB http://www.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
On 10/16/06, Bruce Momjian <bruce@momjian.us> 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
Вложения
Marko Kreen wrote: > On 10/16/06, Bruce Momjian <bruce@momjian.us> 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/