elsampsa / valkka-core

Valkka - Create video surveillance, management and analysis programs with PyQt
GNU Lesser General Public License v3.0
181 stars 35 forks source link

Compiling Live555 chokes on OpenSSL #17

Closed NeverOddOrEven closed 3 years ago

NeverOddOrEven commented 4 years ago

I am building on Linux Mint 19.3 (Ubuntu 18.04) with Python 3.8.2 in a virtual environment.

:ok_man: side note I did see the warnings about the numpy version being consistent across valkka-core and valkka-live. I figure since I am building from source and using the same venv for both, I should be fine. Famous last words!

Steps to reproduce

git clone https://github.com/elsampsa/valkka-core
cd valkka-core
./prepare-build.bash
./easy-build.bash

Diagnostic error

c++ -otestMP3Streamer -L. testMP3Streamer.o ../liveMedia/libliveMedia.a ../groupsock/libgroupsock.a ../BasicUsageEnvironment/libBasicUsageEnvironment.a ../UsageEnvironment/libUsageEnvironment.a 
../liveMedia/libliveMedia.a(SRTPCryptographicContext.o): In function `SRTPCryptographicContext::cryptData(SRTPCryptographicContext::derivedKeys&, unsigned long, unsigned int, unsigned char*, unsigned int)':
SRTPCryptographicContext.cpp:(.text+0x2bd): undefined reference to `AES_set_encrypt_key'
SRTPCryptographicContext.cpp:(.text+0x2ea): undefined reference to `AES_encrypt'
../liveMedia/libliveMedia.a(SRTPCryptographicContext.o): In function `SRTPCryptographicContext::deriveSingleKey(unsigned char const*, unsigned char const*, SRTPCryptographicContext::SRTPKeyDerivationLabel, unsigned int, unsigned char*)':
SRTPCryptographicContext.cpp:(.text+0x7af): undefined reference to `AES_set_encrypt_key'
SRTPCryptographicContext.cpp:(.text+0x80b): undefined reference to `AES_encrypt'
../liveMedia/libliveMedia.a(HMAC_SHA1.o): In function `sha1(unsigned char*, unsigned char const*, unsigned int, unsigned char const*, unsigned int)':
HMAC_SHA1.cpp:(.text+0x1d): undefined reference to `EVP_MD_CTX_new'
HMAC_SHA1.cpp:(.text+0x25): undefined reference to `EVP_sha1'
HMAC_SHA1.cpp:(.text+0x30): undefined reference to `EVP_DigestInit'
HMAC_SHA1.cpp:(.text+0x3d): undefined reference to `EVP_DigestUpdate'
HMAC_SHA1.cpp:(.text+0x50): undefined reference to `EVP_DigestUpdate'
HMAC_SHA1.cpp:(.text+0x5d): undefined reference to `EVP_DigestFinal'
HMAC_SHA1.cpp:(.text+0x73): undefined reference to `EVP_MD_CTX_free'
collect2: error: ld returned 1 exit status
Makefile:105: recipe for target 'testMP3Streamer' failed

I was able to get around this by copying the the config.linux-no-openssl packaged with the Live555 tarball over the existing ext/config.linux-generic. I also added the -fPIC flag to the COMPILE_OPTS after getting the subsequent build error :).

:ok_man: side note In case anyone else tries to compile this from within a virtual environment, make sure you revert the hard-coded path to your Python environment in the CMakeLists.txt file. It won't stop a successful compile, but it probably will prevent you from using it with Valkka Live.

Submit a PR?

I am happy to submit a PR with fixes but before I do, I'm curious to know if anyone else gets this same issue with OpenSSL?

ManhTK1911 commented 4 years ago

I am had the same issue with you

elsampsa commented 4 years ago

Weird.. never had this issue myself & unable to reproduce it in my Ubuntu 18.04 box.

I don't think that the solution is to compile without openssl. Could it be that you don't have openssl installed?

What does this say?

sudo dpkg -L openssl

You might also need to install the openssl development packages with:

sudo apt-get install libssl-dev

If that doesn't solve the issue, after running easy-build.bash etc, please go to ext/llive folder and do this:

cat Makefile > makefile.txt

and

make VERBOSE=1 > makefile_output.txt

Drag'n drop the text files into this ticket & we'll investigate further.

But as I said, I think it's just some missing package in your system.

elsampsa commented 3 years ago

Finally stumbled upon this myself. "Refreshing" live555 to the latest version reproduced this for me. It's now fixed it the lastest commit & "easy_build.bash" should work again.

elsampsa commented 3 years ago

..ah and remember to run "configure_live.bash" again before using easy_build