static building lxml

well  it is not really straightforward..

 

when building with static deps like python setup.py build --static_deps

 

you may see two possible errors

 

1: when you saw crc iconv.xx error, you can modify buildlibxml.py

 

check def download_libiconv and change 

version_re = re.compile(r'^libiconv-([0-9.]+[0-9]).tar.gz$')

as

version_re = re.compile(r'^libiconv-(1.14).tar.gz$')

 

2: importing lxml.etree sometimes may experience "undefined symbol clock_gettime"

 

the reason is some gcc version (4.6.x) may fail to link librt properly, so you can edit 

setupinfo.py

find 

def libraries()

add rt like:

libs = ['z', 'm', 'rt']

 

it can solve the problem.

你可能感兴趣的:(static)