Hi everybody,
I'm trying to build lxml 3.3.5 with static deps on a CentOS 6.5 box, so far
without success.
CentOS 6.5 ships with libxml2 2.7.6 and libxslt 1.1.26.
I'd like to get the latest versions of both (libxml2 2.9.1 and libxslt
1.1.28).
After a lot of experiments, I came up with the following way to install
lxml:
CFLAGS="$CFLAGS -fPIC -lgcrypt -ldl -lgpg-error -lrt" STATIC_DEPS=true
pip2.7 install lxml
-fPIC: seems to be mandatory on x86_64 (build fails otherwise)
-lrt: fixes an issue with old versions of GCC (4.4.7 on CentOS 6.5), that
results in 'undefined symbol clock_gettime' on import.
-lgcrypt -ldl -lgpg-error: fixes similar import issues when libgcrypt is
installed on the system (it's the output of libgcrypt-config --libs).
But still, I get an error on import, that I couldn't be able to fix:
Python 2.7.7 (default, Jun 16 2014, 15:17:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import html
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/lxml/html/__init__.py", line
42, in <module>
from lxml import etree
ImportError: /usr/local/lib/python2.7/site-packages/lxml/etree.so:
undefined symbol: libiconv
>>>
Is there some safe way to get static deps installed with lxml on a CentOS
6.5 system? Am I on the right track or am I totally missing something?
Should I maybe just use the system libs (their versions seems not to be
recommended by the docs...)?
I'm using CPython 2.7.7.
Thanks for your help!
--
Fabio Sangiovanni