[lxml-dev] building lxml for OS X 10.4 on PPC?

Hello, I am desperately trying to build lxml on a Mac PPC with OS X 10.4. It is not the most current plattform, but I am stuck with it... I tried "STATIC_DEPS= true easy_install lxml", which works perfectly on all Intel machines I have access to. But unfortunately there seems to be a problem with libiconv on the PPC side. Has anyone else had success? I searched the archives for any hints on building with this combination, but didn't find a solution/suggestions. Should I try something similar to "./configure --without-iconv"? But how would I pass this to easy_install? Or maybe try a local static build including not only libxml2 and libxslt but libiconv as well? Any help is greatly appreciated! and sorry for bothering you with these newbee questions. Pascal

On Mon, 13 Jul 2009 22:56:00 +0200, Pascal Oberndoerfer <p.oberndoerfer@urheberrecht.org> wrote:
Hello,
I am desperately trying to build lxml on a Mac PPC with OS X 10.4. It is not the most current plattform, but I am stuck with it...
I tried "STATIC_DEPS= true easy_install lxml", which works perfectly on all Intel machines I have access to. But unfortunately there seems to be a problem with libiconv on the PPC side.
I built lxml several months ago on my Tiger G5 without any problems. What error do you get exactly? Kind regards, Michael

Michael Guntsche schrieb:
On Mon, 13 Jul 2009 22:56:00 +0200, Pascal Oberndoerfer <p.oberndoerfer@urheberrecht.org> wrote:
Hello,
I am desperately trying to build lxml on a Mac PPC with OS X 10.4. It is not the most current plattform, but I am stuck with it...
I tried "STATIC_DEPS= true easy_install lxml", which works perfectly on all Intel machines I have access to. But unfortunately there seems to be a problem with libiconv on the PPC side.
I built lxml several months ago on my Tiger G5 without any problems. What error do you get exactly?
I get the following "last lines" (below) during compiling libxml2, where I suppose the important bit is:
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning /usr/lib/libiconv.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
This is a PPC G5, 2Ghz, 1GB, 10.4.11, XCode 2.5. Maybe I got an incompatible libiconv installed by a previous version of Apple's DevTools? I am really wildly guessing here... Thanks a lot. Pascal <snip>
(cd .libs && rm -f testdso.la && ln -s ../testdso.la testdso.la) gcc -DHAVE_CONFIG_H -I. -I./include -I./include -D_REENTRANT -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -pedantic -W -Wformat - Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-alig n -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -c xmllint.c /bin/sh ./libtool --tag=CC --mode=link gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -pedantic -W -Wformat -Wunused -Wimplicit -W return-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wa ggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10 .4u.sdk -o xmllint xmllint.o ./libxml2.la -lpthread -lz -liconv -lm gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmiss ing-prototypes -Wnested-externs -Winline -Wredundant-decls -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o xmllint xmllint.o ./.libs/libxm l2.a -lpthread -lz /usr/lib/libiconv.dylib -lm /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: for architecture i386 /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning /usr/lib/libiconv.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch f lag: i386 (file not loaded) /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols: _libiconv _libiconv_close _libiconv_open collect2: ld returned 1 exit status lipo: can't open input file: /var/tmp//cc5Ydgsq.out (No such file or directory) make[2]: *** [xmllint] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/Current/bin/easy_install", line 8, in <module> load_entry_point('setuptools==0.6c9', 'console_scripts', 'easy_install')() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 1671, in main File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 1659, in with_ei_usage File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 1675, in <lambda> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 151, in setup dist.run_commands() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 974, in run_commands self.run_command(cmd) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 994, in run_command cmd_obj.run() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 211, in run File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 446, in easy_install File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 476, in install_item File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 655, in install_eggs File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 930, in build_and_install File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/command/easy_install.py", line 919, in run_setup File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/sandbox.py", line 27, in run_setup File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/sandbox.py", line 63, in run File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg/setuptools/sandbox.py", line 29, in <lambda> File "setup.py", line 115, in <module> File "/tmp/easy_install-O_UuTG/lxml-2.2.2/setupinfo.py", line 50, in ext_modules File "/tmp/easy_install-O_UuTG/lxml-2.2.2/buildlibxml.py", line 200, in build_libxml2xslt File "/tmp/easy_install-O_UuTG/lxml-2.2.2/buildlibxml.py", line 158, in call_subprocess Exception: Command "make" returned code 2

On Jul 16, 2009, at 19:59, Pascal Oberndoerfer wrote:
I get the following "last lines" (below) during compiling libxml2, where I suppose the important bit is:
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning /usr/lib/libiconv.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
Ok, I was able to reproduce the problem. I also have a quick fix but it's more a hack than anything else. First the problem. During the creation of the static libxml.a library libtool also creates an libxml2.la file. libtool finds /usr/lib/libiconv.la which defines /usr/lib/ libiconv.dylib above. Now this file is no fat-binary and just has the PCC architecture. As a workaround rename /usr/lib/libiconv.la or move it somewhere else, build lxml and move/rename the file back. This way the "correct" libiconv.dylib will be used. I think the most proper fix would be to build libiconv as part of the static-deps as well. Stefan what do you think? Kind regards, Michael

Michael Guntsche schrieb:
On Jul 16, 2009, at 19:59, Pascal Oberndoerfer wrote:
I get the following "last lines" (below) during compiling libxml2, where I suppose the important bit is:
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: warning /usr/lib/libiconv.dylib cputype (18, architecture ppc) does not match cputype (7) for specified -arch flag: i386 (file not loaded)
Ok, I was able to reproduce the problem. I also have a quick fix but it's more a hack than anything else. First the problem. During the creation of the static libxml.a library libtool also creates an libxml2.la file. libtool finds /usr/lib/libiconv.la which defines /usr/lib/libiconv.dylib above. Now this file is no fat-binary and just has the PCC architecture. As a workaround rename /usr/lib/libiconv.la or move it somewhere else, build lxml and move/rename the file back. This way the "correct" libiconv.dylib will be used.
I think the most proper fix would be to build libiconv as part of the static-deps as well. Stefan what do you think?
Kind regards, Michael
This allowed me to build on a G4 PPC and a G5 PPC Mac. Thanks! The very last step: "Building against libxml2/libxslt in the following directory: /private/tmp/easy_install-W57UyT/lxml-2.2.2/build/tmp/libxml2/lib" takes quite long. Is this expected behaviour? I will do some testing over the weekend. Please let me know if I can do some testing etc. Best regards & again: thanks! Pascal
participants (3)
-
Michael Guntsche
-
Pascal Oberndoerfer
-
Stefan Behnel