I installed the p4 library on my local archlinux machine and everything works smoothly. I was now trying to do the same on a couple of virtual machines (with same OS also 64 bits) but can't get it running...
The installation goes well and doesn't complain, but when I try to import it I get:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "P4.py", line 312, in <module>
import P4API
ImportError: /usr/lib/python2.7/site-packages/P4API.so: undefined symbol: TLSv1_method
If I look in the symbols with nm -A /usr/lib/python2.7/site-packages/P4API.so
I can see that in fact all the SSL-related symbols are undefined (while being defined on the working one), but why on earth? I have openssl installed and Python is installed in exactly the same way, I can't find any other library that should be useful.
Any idea?
EDIT: apparently the only difference is that in the wrong installation of P4 P4API.so is missing librt from the "ldd" output (and librt is actually there). Not sure how it would relate to the TLS problem, and trying to reinstall glibc and then p4python but no luck still..
Rebuilding the P4Python against the "rt" and "ssl" libraries fixes this.
tar xf the P4 API archivesetup.cfg to point to the P4API directoryEdit setup.py and go to line 120 and add "ssl" and "rt" so it looks like this
else: # Assume Linux
libraries = ["client", "rpc", "supp", "ssl", "rt"] # P4API libs
extra_compile_args = ["-DOS_LINUX", "-D%s" % p4_api_ver]
Do sudo python setup.py install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With