OpenSSl and another Library¶
Table of Contents
OpenSSL: 1.1.0 - BitShares now supports OpenSSL 1.1.0
OpenSSL: 1.0.x series
If your system OpenSSL version is newer than OpenSSL 1.1.0, then you will have to manually provide an older version of OpenSSL and specify it to CMake using
cmake -DOPENSSL_INCLUDE_DIR=/usr/include/openssl-1.0 -DOPENSSL_SSL_LIBRARY=/usr/lib/openssl-1.0/libssl.so -DOPENSSL_CRYPTO_LIBRARY=/usr/lib/openssl-1.0/libcrypto.so .
In BitShares-Core, the OpenSSL is linked statically. One of reasons, when we distribute binaries (Windows and also macOS), the libraries need to be statically linked.
We received a question “Is there any reason for not linking the openssl dynamically? The openssl is linked statically which is causing us troubles when building witness_node for an embedded Linux (RPi).”
Finding: in order to force dynamic linking on Linux systems which allow both static and dynamic linking, CMAKE_FIND_LIBRARY_SUFFIXES must set correct order like this:
SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a) - in original CMakeLists.txt it is
SET(CMAKE_FIND_LIBRARY_SUFFIXES “.a;.so”) that’s why the libs are tried to link statically first.