[Zope-Perl] Zope-Perl install requires Python or Perl (?) compiled with thread support

Gisle Aas gisle@ActiveState.com
07 Aug 2000 09:07:14 +0200


"Scott Langley" <langles@nwlink.com> writes:

> I found out during my installation of Zope-Perl that the Python you have in
> your path must be installed with thread support - at least on my system:
> 
> Linux Mandrake 7.1 on Intel
> Python1.5.2 with the patch applied to Python/importdl.c and the DistUtils
> v0.9 module installed
> Perl built from the latest development sources at:
> ftp://ftp.linux.activestate.com/perl-current/ (built without thread support)
> 
> If you built Python without enabling thread support - that is, you didn't
> specify '--with-thread' when you ran 'configure', then the 'make' for
> Python-Object will give this error:
> 
> Object.xs:  In function 'XS_Python__Err_Raise':
> Object.xs:697: 'PYTHON_LOCK' undeclared (first use in this function)
> 
> After I rebuilt Python with thread support, the Zope-Perl installation went
> smoothly.

The perl/python integration was supposed to work nicely without thread
support.  It should actually work much better since we avoid
releasing/aquiring locks multiple times when making calls between the
languages.  It looks like there has been some time since I last tried
to build it this way, though :-(

This patch ought to fix it:

Index: lang_lock.h
===================================================================
RCS file: /home/cvs/activestate/bifrost/lang_lock.h,v
retrieving revision 1.7
diff -u -p -u -r1.7 lang_lock.h
--- lang_lock.h	2000/07/25 10:09:16	1.7
+++ lang_lock.h	2000/08/07 06:59:11
@@ -182,6 +182,7 @@ extern int python_lock_held;
 #define PERL_LOCK
 #define PERL_UNLOCK
 #define PYTHON_UNLOCK
+#define PYTHON_LOCK
 
 #endif
 
But I think Zope itself require a Python with thread support, so this
only applies if you want to use perl stuff from python in other
contexts.

> This apparently has to do with the macros in lang_lock.h making PYTHON_LOCK
> undefined if WITH_THREAD is undefined.  From the comments at the bottom at
> the bottom of lang_lock.h, it appears that it might still work if your Perl
> installation is compiled with thread support (which mine isn't).  Is that
> the case?

I hope so after you apply the patch above.

Regards,
Gisle