open-quantum-safe / liboqs-python

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

Dockerfile fails to build #89

Closed loganaden closed 3 months ago

loganaden commented 3 months ago

This is the error currently faced with the latest version of Ubuntu.

CMake Error at /usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found
suitable version "3.0.13", minimum required is "1.1.1")
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.28/Modules/FindOpenSSL.cmake:668 (find_package_handle_standard_args)
CMakeLists.txt:135 (find_package)

-- Configuring incomplete, errors occurred!
The command '/bin/sh -c cmake -S liboqs -B liboqs/build -DBUILD_SHARED_LIBS=ON && cmake --build liboqs/build --parallel 4 && cmake --build liboqs/build --target install' returned a non-zero code: 1

baentsch commented 3 months ago

Thanks for this bug report, @loganaden . It reminds me of a problem I think @SWilson4 worked around somewhere else, so asking for his input/suggestions here.

loganaden commented 3 months ago

@SWilson4 any suggestions ?

baentsch commented 3 months ago

Ahhh--I think I rememver it has to do with a bug in cmake. Can you try building&using a later Version than the one in Ubuntu by default @loganaden ?

SWilson4 commented 3 months ago

This is an issue we've encountered before with newer versions of CMake. See this comment for details. To get the command to work as is, I had to downgrade CMake. An easier workaround is to explicitly set OPENSSL_ROOT_DIR, as described in that comment. I haven't tested newer versions of CMake to see if they fix the issue.

Come to think of it, it would probably be a good idea to file a bug report with CMake... I'll get on that.

SWilson4 commented 3 months ago

I have a (hopeful) fix up: see https://github.com/open-quantum-safe/liboqs/issues/1748#issuecomment-2256628489 and https://github.com/open-quantum-safe/liboqs/pull/1873.

loganaden commented 3 months ago

Tested and it fixes the issue.

Successfully built liboqs-python Installing collected packages: nose2, liboqs-python Successfully installed liboqs-python-0.10.0 nose2-0.15.1 Removing intermediate container 7563a817b7d0 ---> 73e2688dcb34 Successfully built 73e2688dcb34 Successfully tagged oqs-python:latest

`liboqs version: 0.10.2-dev liboqs-python version: 0.10.0 Enabled KEM mechanisms: ['BIKE-L1', 'BIKE-L3', 'BIKE-L5', 'Classic-McEliece-348864', 'Classic-McEliece-348864f', 'Classic-McEliece-460896', 'Classic-McEliece-460896f', 'Classic-McEliece-6688128', 'Classic-McEliece-6688128f', 'Classic-McEliece-6960119', 'Classic-McEliece-6960119f', 'Classic-McEliece-8192128', 'Classic-McEliece-8192128f', 'HQC-128', 'HQC-192', 'HQC-256', 'Kyber512', 'Kyber768', 'Kyber1024', 'ML-KEM-512-ipd', 'ML-KEM-512', 'ML-KEM-768-ipd', 'ML-KEM-768', 'ML-KEM-1024-ipd', 'ML-KEM-1024', 'sntrup761', 'FrodoKEM-640-AES', 'FrodoKEM-640-SHAKE', 'FrodoKEM-976-AES', 'FrodoKEM-976-SHAKE', 'FrodoKEM-1344-AES', 'FrodoKEM-1344-SHAKE']

Key encapsulation details: {'claimed_nist_level': 1, 'is_ind_cca': True, 'length_ciphertext': 768, 'length_public_key': 800, 'length_secret_key': 1632, 'length_shared_secret': 32, 'name': 'Kyber512', 'version': 'https://github.com/pq-crystals/kyber/commit/74cad307858b61e434490c75f812cb9b9ef7279b'}

Shared secretes coincide: True

SWilson4 commented 3 months ago

Closing as fixed by open-quantum-safe/liboqs#1873.