“torizon/debian-cross-toolchain-arm64:3.3.0-bookworm” which is not finding openssl and giving following error
torizon/debian-cross-toolchain-ssh-arm64
I installed openssl by following command
RUN apt-get -q -y update &&
apt-get -q -y install
build-essential
software-properties-common
openssl
libssl-dev:arm64
cmake
…
ERROR Message:
Make Error at /usr/share/cmake-3.25/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: SSL Crypto) (found version
“3.0.14”)
Call Stack (most recent call first):
/usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.25/Modules/FindOpenSSL.cmake:613 (find_package_handle_standard_args)
CMakeLists.txt:36 (find_package)
– Configuring incomplete, errors occurred!
See also “/home/torizon/app/build-arm64/CMakeFiles/CMakeOutput.log”.
See also “/home/torizon/app/build-arm64/CMakeFiles/CMakeError.log”.
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
It looks like you’re encountering an issue where CMake cannot find the OpenSSL library even though it is installed. This is a common issue when the library paths are not correctly set or recognized by CMake. Here are a few steps you can take to resolve this:
Set the OPENSSL_ROOT_DIR Environment Variable:
You can explicitly set the OPENSSL_ROOT_DIR environment variable to point to the directory where OpenSSL is installed. You can do this in your Dockerfile or in your build script.
export OPENSSL_ROOT_DIR=/usr/lib/ssl
Specify OpenSSL Directories in CMake:
You can also specify the OpenSSL directories directly in your CMakeLists.txt file.
Check CMake Version Compatibility:
Ensure that the version of CMake you are using is compatible with the version of OpenSSL installed. Sometimes, newer versions of OpenSSL might not be fully supported by older versions of CMake.
If you follow these steps and still encounter issues, please provide more details about your environment and any additional error messages you receive. This will help in diagnosing the problem further.
CMakeLists.txt now targets C language and not CXX (maybe I didn’t need to remove CXX from the LANGUAGES )
Since I used torizonPackages.json to add my dependencies, I didn’t need to manually modify Dockerfile, Dockerfile.debug nor Dockerfile.sdk
I added the necessary libs [1] to CMakeLists.txt using target_link_libraries
I added "www.google.com" to the args of the Torizon ARMv8 task on the file launch.json, so the application executed on the module would have some hostname to work on.
The content of the main.c came from [2]. I just modified it to print to stdout instead of stderr.
Be aware that I have no idea how main.c works! I just copied it from the referred repository . I have never developed anything using OpenSSL.
But I hope that this project helps you, since it is building successfully and the resulting binary is successfully executing on the module (and on the computer as well, when compiled for AMD64).
Yes, I can. But I would like to first understand what you have tried.
Could you please share how you tried to build it on your side?
Which template did you use?
Which modifications you did to which template files?
Have you ever tried to build it native on your own computer (no cross-compilation embedded system involved)?
This is a very important step that will allow you to get acquainted to the process of building that specific repository and understand its process, so you can replicate it.
I can build paho library in Native Ubuntu and Torizon OS (Manually after going inside a docker container)
My objective is to use Paho library (C/C++ later Python) from each of our docker container
I tried below things
I am using “C++ CMake Console Application” as template
Initially I built Paho in Torizon. I want to use the artifacts (.so and include) files from that artifacts to use from Open-Ocpp project. (Open-Ocpp is building properly in torizon)
Please let me know if you have any more questions?
I did modification in Dockerfile.sdk Dockerfile.sdk (1.2 KB)
On top of that would you please check below is the proper way to add LD_LIBRARY_PATH to toolchain? docker-compose.yml (674 Bytes)