[lxml-dev] lxml build problem

Hi, I am trying to build lxml from the latest svn build on a Suse10.0 based computer with GCC4.02 and I seem to be getting gcc related errors when compiling etree. python setup.py build_ext -i running build_ext building 'lxml.etree' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -fmessage-length=0 -Wall -D_FORTI FY_SOURCE=2 -g -fPIC -I/usr/include/python2.4 -c src/lxml/etree.c -o build/temp. linux-x86_64-2.4/src/lxml/etree.o -w -I/usr/include/libxml2 src/lxml/etree.c: In function ‘__pyx_f_5etree_12_ElementTree_parse’: src/lxml/etree.c:921: error: invalid lvalue in assignment src/lxml/etree.c:932: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree__newElementTree’: src/lxml/etree.c:1858: error: invalid lvalue in assignment src/lxml/etree.c:1884: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree__elementFactory’: src/lxml/etree.c:4135: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree__commentFactory’: src/lxml/etree.c:4522: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree__attribFactory’: src/lxml/etree.c:5591: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree__xsltResultTreeFactory’: src/lxml/etree.c:8377: error: invalid lvalue in assignment src/lxml/etree.c: In function '__pyx_f_5etree_22XPathDocumentEvaluator___init__’ : src/lxml/etree.c:8473: error: invalid lvalue in assignment src/lxml/etree.c:8478: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree_21XPathElementEvaluator___init__’: src/lxml/etree.c:9256: error: invalid lvalue in assignment src/lxml/etree.c: In function ‘__pyx_f_5etree_changeDocumentBelowHelper’: src/lxml/etree.c:13105: error: invalid lvalue in assignment error: command 'gcc' failed with exit status 1 make: *** [inplace] Error 1 Is anyone able to assist with resolving this? Cheers, -- Allan

Allan Curtis a écrit :
This is a konwn problem: your version of Pyrex does not support gcc4 as explained on the installation page of lxml: http://codespeak.net/lxml/installation.html Pyrex 0.9.3.1 does not fix the problem entirely. You can download a patch above or you can directly 'svn co' a prepatched version of pyrex here for instance: http://svn.nuxeo.org/pub/vendor/Pyrex/tags/0.9.3-gcc4-patched/ Best, -- Olivier

On Monday 27 February 2006 22:14, Olivier Grisel wrote: Olivier, Thanks for your very quick response. <snip>
I thought that v0.9.3.1 of Pyrex was patched. Anyway, I have progress but get further errors: running build_ext building 'lxml.etree' extension Traceback (most recent call last): File "setup.py", line 29, in ? cmdclass = {'build_ext': build_pyx} File "/usr/lib64/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib64/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib64/python2.4/distutils/command/install.py", line 511, in run self.run_command('build') File "/usr/lib64/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib64/python2.4/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/lib64/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib64/python2.4/distutils/command/build_ext.py", line 279, in run self.build_extensions() File "/usr/lib64/python2.4/distutils/command/build_ext.py", line 405, in build _extensions self.build_extension(ext) File "/usr/lib64/python2.4/distutils/command/build_ext.py", line 442, in build _extension sources = self.swig_sources(sources, ext) TypeError: swig_sources() takes exactly 2 arguments (3 given) I am new to Python, but this error appears to be a Python rather than assembler issue. Any guidance would be much appreciated. Kind Regards -- Allan Curtis

Allan Curtis a écrit :
After googling a bit it looks like the 0.9.3 + gcc4 patch does not work with python 2.4 (except on my machine, why?). This has been fixed in 0.9.3.1. Thus you need use the 0.9.3.1 version and apply the missing part of the patch manually. Or you can fix offending line by hand: site-packages/Pyrex/Distutils/build_ext.py 35c35 < def swig_sources (self, sources): ---
def swig_sources (self, sources, extension=None):
http://lists.copyleft.no/pipermail/pyrex/2005-July/001256.html -- Olivier

On Monday 27 February 2006 22:56, Olivier Grisel wrote: Olivier, <snip>
Oh, dear. Patched that line and now get back the same gcc compile errors as before. If you have the 0.9.3 patch working, what distro are you using and is it for a 64 bit CPU? Maybe I should talk to the Pyrex developer, Greg Ewing (he is at my old university and is in the same time zone). Kind Regards, -- Allan Curtis

Allan Curtis wrote:
If you have the 0.9.3 patch working, what distro are you using and is it for a 64 bit CPU?
I have patched versions of the SRPM/RPM for SuSE 10. I'll send them to you (but not to the list). You can also find the patches in the SVN version of lxml. There will soon be a new release that will contain the generated etree.c so that people will no longer need to install Pyrex to compile lxml. Stefan

Allan Curtis a écrit :
This is a konwn problem: your version of Pyrex does not support gcc4 as explained on the installation page of lxml: http://codespeak.net/lxml/installation.html Pyrex 0.9.3.1 does not fix the problem entirely. You can download a patch above or you can directly 'svn co' a prepatched version of pyrex here for instance: http://svn.nuxeo.org/pub/vendor/Pyrex/tags/0.9.3-gcc4-patched/ Best, -- Olivier

On Monday 27 February 2006 22:14, Olivier Grisel wrote: Olivier, Thanks for your very quick response. <snip>
I thought that v0.9.3.1 of Pyrex was patched. Anyway, I have progress but get further errors: running build_ext building 'lxml.etree' extension Traceback (most recent call last): File "setup.py", line 29, in ? cmdclass = {'build_ext': build_pyx} File "/usr/lib64/python2.4/distutils/core.py", line 149, in setup dist.run_commands() File "/usr/lib64/python2.4/distutils/dist.py", line 946, in run_commands self.run_command(cmd) File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib64/python2.4/distutils/command/install.py", line 511, in run self.run_command('build') File "/usr/lib64/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib64/python2.4/distutils/command/build.py", line 112, in run self.run_command(cmd_name) File "/usr/lib64/python2.4/distutils/cmd.py", line 333, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.4/distutils/dist.py", line 966, in run_command cmd_obj.run() File "/usr/lib64/python2.4/distutils/command/build_ext.py", line 279, in run self.build_extensions() File "/usr/lib64/python2.4/distutils/command/build_ext.py", line 405, in build _extensions self.build_extension(ext) File "/usr/lib64/python2.4/distutils/command/build_ext.py", line 442, in build _extension sources = self.swig_sources(sources, ext) TypeError: swig_sources() takes exactly 2 arguments (3 given) I am new to Python, but this error appears to be a Python rather than assembler issue. Any guidance would be much appreciated. Kind Regards -- Allan Curtis

Allan Curtis a écrit :
After googling a bit it looks like the 0.9.3 + gcc4 patch does not work with python 2.4 (except on my machine, why?). This has been fixed in 0.9.3.1. Thus you need use the 0.9.3.1 version and apply the missing part of the patch manually. Or you can fix offending line by hand: site-packages/Pyrex/Distutils/build_ext.py 35c35 < def swig_sources (self, sources): ---
def swig_sources (self, sources, extension=None):
http://lists.copyleft.no/pipermail/pyrex/2005-July/001256.html -- Olivier

On Monday 27 February 2006 22:56, Olivier Grisel wrote: Olivier, <snip>
Oh, dear. Patched that line and now get back the same gcc compile errors as before. If you have the 0.9.3 patch working, what distro are you using and is it for a 64 bit CPU? Maybe I should talk to the Pyrex developer, Greg Ewing (he is at my old university and is in the same time zone). Kind Regards, -- Allan Curtis

Allan Curtis wrote:
If you have the 0.9.3 patch working, what distro are you using and is it for a 64 bit CPU?
I have patched versions of the SRPM/RPM for SuSE 10. I'll send them to you (but not to the list). You can also find the patches in the SVN version of lxml. There will soon be a new release that will contain the generated etree.c so that people will no longer need to install Pyrex to compile lxml. Stefan
participants (3)
-
Allan Curtis
-
Olivier Grisel
-
Stefan Behnel