open-quantum-safe / liboqs-python

Python 3 bindings for liboqs
https://openquantumsafe.org/
MIT License
106 stars 36 forks source link

Could not load liboqs shared library in fedora 36 #51

Closed evil-user closed 2 years ago

evil-user commented 2 years ago

@vsoftco @dstebila @baentsch I followed the instructions in liboqs python wrapper to install as a shared library (make -GNinja -DBUILD_SHARED_LIBS=ON ..). Then I cloned liboqs-python and setup a venv called test inside. I then installed setup.py. I then tried to run the kem example with python3 examples/kem.py but the code breaks because it could not load the liboqs library. I have tried multiple variants of liboqs shared library command but I have not gotten any of them to work. Am I doing something wrong or missing a step?

i am using fedora 36 with openssl-devel package instead of libssl-dev , everything compiles really well and checked env and followed all precaution measures in issue #28

evil-user commented 2 years ago

i am having openssl 3.0.3 and python3 setup.py gives warnings :-

zipsafe flag not set analyzing contents. usr/1ib/python3.16/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip an | other standards-based tools.

usr/1ib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy install command is deprecated. Use build and pip and other standards-based tools.

baentsch commented 2 years ago

To better understand your issue, could you please provide output of these commands on your installation:

ls $PYTHONPATH
ls $LD_LIBRARY_PATH
ldd $LD_LIBRARY_PATH/liboqs.so
evil-user commented 2 years ago

@baentsch output of above commands: -

ls $PYTHONPATH displays contents of liboqs-python folder and additionally build , dist , liboqs-python.egg-info folders

ls $LD_LIBRARY_PATH displays ls: cannot access ':/usr/local/lib': no such file or directory

ldd $LD_LIBRARY_PATH/liboqs.so displays ldd: :/usr/local/lib/liboqs.so': no such file or directory

baentsch commented 2 years ago

Well, then you have the answer to your question: You did not install liboqs, i.e., did not run ninja install as per https://github.com/open-quantum-safe/liboqs-python#pre-requisites.

Alternatively, find the location of liboqs.so on your machine and point LD_LIBRARY_PATH to that directory.

evil-user commented 2 years ago

thank you.