error in CMake Cyclone DDS, cannot find openssl - cmake

How can i fix this error,
while doing Cmake, it cant find Openssl, im trying to install cycloneDDS in windows
rkpsr#Rahul MINGW64 ~
$ cd cyclonedds
rkpsr#Rahul MINGW64 ~/cyclonedds (master)
$ cd build
rkpsr#Rahul MINGW64 ~/cyclonedds/build (master)
$ cmake -G "Eclipse CDT4 - MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=/user -DBUILD_EXAMPLES=ON ..-- Eclipse version is set to 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
-- Building without OpenSSL support
-- Feature rusage disabled
-- Feature netstat disabled
CMake Error at C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find BISON (missing: BISON_EXECUTABLE) (Required is at least
version "3.0.4")
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.20/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.20/Modules/FindBISON.cmake:306 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/idl/CMakeLists.txt:17 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/rkpsr/cyclonedds/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/rkpsr/cyclonedds/build/CMakeFiles/CMakeError.log".
rkpsr#Rahul MINGW64 ~/cyclonedds/build (master)
I have included Openssl in Path variable as
Openssl Environment Variable
OpenSSL
Openssl verification

It can't find OpenSSL, true, but that means it simply builds without any features requiring OpenSSL. The error that causes the build to fail is because I can't find "bison", which is one of the prerequisites listed in the README.
Besides that, MinGW has its own quirks. I know other people have run into some issues building with it, but they seem to have made it through the CMake stage without trouble.
We currently only check that it builds with Visual Studio. In part that is because of limited resources, but in part it is also because you can easily use one built using VS in MinGW, so it is not like it forces you to build everything with VS.
Anyway, any patches that make it play nice with MinGW are most welcome.

Related

got error can not find openssl while building although I have installed openssl

when I build my program I get this error:I have installed openssl and the error shows me that can not find the appropriate openssl , should I install something else or installing openssl somewhere else?
I am using ubuntu 22.04
BUILD_TYPE not set, using debug
RUNNING SCRIPT build
Re-using content of build directory
Passing the following script args to command
Building debug without unit tests.
-- Running cmake version 3.22.1
-- CMAKE_MODULE_PATH is /home/proj/src/cmake
-- MySQL 8.0.27
-- Source directory /home/proj/src/
-- Binary directory /home/proj/src/build-debug
-- CMAKE_GENERATOR: Ninja
-- SIZEOF_VOIDP 8
-- Packaging as: mysql-8.0.27-Linux-x86_64
-- Found /usr/local/include/boost/version.hpp
-- BOOST_VERSION_NUMBER is #define BOOST_VERSION 107300
-- BOOST_INCLUDE_DIR /usr/local/include
-- NUMA library missing or required version not available
-- ZLIB_VERSION (bundled) is 1.2.11
-- ZSTD_LEGACY_SUPPORT not defined!
-- ZSTD_VERSION (bundled) is 1.5.0
-- OPENSSL_INCLUDE_DIR = /usr/include
-- OPENSSL_LIBRARY = /usr/lib/x86_64-linux-gnu/libssl.so
-- CRYPTO_LIBRARY = /usr/lib/x86_64-linux-gnu/libcrypto.so
-- OPENSSL_MAJOR_VERSION =
-- OPENSSL_MINOR_VERSION =
-- OPENSSL_FIX_VERSION =
-- Looking for SHA512_DIGEST_LENGTH
-- Looking for SHA512_DIGEST_LENGTH - found
--
Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),
</path/to/custom/openssl/installation>
CMake Error at cmake/ssl.cmake:61 (MESSAGE):
Please install the appropriate openssl developer package.
Call Stack (most recent call first):
cmake/ssl.cmake:319 (FATAL_SSL_NOT_FOUND_ERROR)
CMakeLists.txt:1613 (MYSQL_CHECK_SSL)
-- Configuring incomplete, errors occurred!
while I have installed openssl before in usr/include as when I run the command whereis openssl it shows me that it has installed before.
whereis openssl
openssl: /usr/include/openssl /usr/share/man/man1/openssl.1ssl.gz

Cross-compile tensorflow c library for mips64 failed

I found a problem when trying to cross-compile tensorflow c library for mips64 with mips64 cross-compile toolchains using cmake way. I want to deploy a small speech model on the mips64 board.
My steps:
I clone docker env and crooss compile using cmake way.
docker run -d -v /home/hart/Desktop/workspace/toolchains:/toochains --name=cmake_tflite tensorflow/tensorflow:latest-devel tail -f /dev/null
cmake cmds: `ARMCC_FLAGS="-Wall -O3"
ARMCC_PREFIX=/toochains/t31a/mips-gcc472-glibc216-64bit/bin/mips-linux-gnu-
cmake -DCMAKE_C_COMPILER=${ARMCC_PREFIX}gcc
-DCMAKE_CXX_COMPILER=${ARMCC_PREFIX}g++
-DCMAKE_C_FLAGS="${ARMCC_FLAGS}"
-DCMAKE_CXX_FLAGS="${ARMCC_FLAGS}"
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-DCMAKE_SYSTEM_NAME=Linux
../tensorflow_src/tensorflow/lite/c
Error found when running CMake cmds above:
Setting build type to Release, for debug builds use'-DCMAKE_BUILD_TYPE=Debug'.
CMake Warning at /build_t31a/abseil-cpp/absl/copts/AbseilConfigureCopts.cmake:30 (message):
Value of CMAKE_SYSTEM_PROCESSOR (mips) is unknown and cannot be used to set
ABSL_RANDOM_RANDEN_COPTS
Call Stack (most recent call first):
/build_t31a/abseil-cpp/CMake/AbseilHelpers.cmake:18 (include)
/build_t31a/abseil-cpp/CMakeLists.txt:85 (include)
CMake Error at /build_t31a/eigen/CMakeLists.txt:119 (message):
Can't link to the standard math library. Please report to the Eigen
developers, telling them about your platform.
-- Configuring incomplete, errors occurred!
See also "/build_t31a/CMakeFiles/CMakeOutput.log".
See also "/build_t31a/CMakeFiles/CMakeError.log".
What's wrong with my cross-compile steps? Is MIPS64 not supported?
I also leave this message on tensorflow github.
I will appreciate any reply.
enter link description here

CMake can't find BLAS on MSYS2

I am trying to compile this software in the MSYS2 environment on Windows. This is the line looking for the packages:
FIND_PACKAGE(BLAS REQUIRED)
FIND_PACKAGE(LAPACK REQUIRED)
SET(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
I have installed the BLAS/LAPACK dependencies using
pacman -S make msys/cmake msys/gcc-fortran mingw64/mingw-w64-x86_64-openblas64
but I get the error messages:
CMake Error at /usr/share/cmake-3.22.1/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find BLAS (missing: BLAS_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.22.1/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.22.1/Modules/FindBLAS.cmake:1337 (find_package_handle_standard_args)
CMakeLists.txt:403 (FIND_PACKAGE)
You may find the modified CMakeLists.txt file here (I have commented out all the MPI, MMG, MKL, and APPLE-related entries), and the complete output can be seen here.
I can probably specify the locations explicitly as described here and here
SET(BLAS_LIBRARIES /c/tools/msys64/mingw64/lib/libopenblas_64.a)
SET(LAPACK_LIBRARIES /c/tools/msys64/mingw64/lib/libopenblas_64.a)
but I want CMake to find these dependencies automatically. I would appreciate it if you could help me know what is the canonical way to get BLAS/LAPACK libraries installed under MSYS2 and get CMAKE to find them automatically with the FIND_PACKAGE() functions or otherwise.

Cmake when building LLVM

Trying to build llvm project LLVM Project with CMake, it gives me an error that I can't solve by my own.
For doing this, I am using an Ubuntu Virtual Machine (version 18.04) and I am trying to build the project with "ninja".
I have tried to build this with the following commands (which the LLVM Builder Guide says to use, https://llvm.org/docs/GettingStarted.html)
git clone https://github.com/llvm/llvm-project.git
cd llvm-project/
mkdir build && cd build
cmake -DLLVM_ENABLE_PROJECTS='all' -DCMAKE_BUILD_TYPE=Release -G 'Ninja' ../llvm
At the last command, I use the first flag to download all the projects and the second because I do not need the Debug tools.
The last command gives me the following error several times with different targets:
CMake Error at /usr/share/cmake-3.10/Modules/ExternalProject.cmake:2759 (get_property):
get_property could not find TARGET llgo. Perhaps it has not yet been
created.
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/ExternalProject.cmake:3032 (_ep_add_configure_command)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:200 (externalproject_add)
/home/enrique/Escritorio/llvm-project/llgo/CMakeLists.txt:219 (add_libgo_variant)
And this library error:
-- LLD version: 10.0.0
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find LibEdit (missing: libedit_INCLUDE_DIRS libedit_LIBRARIES)
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/FindLibEdit.cmake:54 (find_package_handle_standard_args)
/home/enrique/Escritorio/llvm-project/lldb/cmake/modules/LLDBConfig.cmake:104 (find_package)
/home/enrique/Escritorio/llvm-project/lldb/CMakeLists.txt:21 (include)
-- Configuring incomplete, errors occurred!
See also "/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeOutput.log".
See also "/home/enrique/Escritorio/llvm-project/build/CMakeFiles/CMakeError.log".
I had the same issue, tried uninstalling the golang compiler (because I don't need llvm support for go); to no avail. I'm not an LLVM expert so this might not be the canonical solution but here's how I solved it:
I replaced
-DLLVM_ENABLE_PROJECTS='all'
by
-DLLVM_ENABLE_PROJECTS="proj1;proj2;proj3"
where I built the list "proj1;proj2;proj3" by grepping project is enabled$ in cmake output and removed the llgo project. I got a list like:
-- clang project is enabled
-- clang-tools-extra project is enabled
-- compiler-rt project is enabled
-- debuginfo-tests project is enabled
-- libclc project is enabled
-- libcxx project is enabled
-- libcxxabi project is enabled
-- libunwind project is enabled
-- lld project is enabled
-- lldb project is enabled
-- llgo project is enabled
-- openmp project is enabled
-- parallel-libs project is enabled
-- polly project is enabled
-- pstl project is enabled
and then built the following list with some vim macros/whatever you master (note: no llgo in there):
clang;clang-tools-extra;compiler-rt;debuginfo-tests;libclc;libcxx;libcxxabi;libunwind;lld;lldb;openmp;parallel-libs;polly;pstl
Then compiling llvm succeeded \o/

cross compile azure iot sdk

I try to crosscompile the Azure IoT C SDK (https://github.com/azure/azure-iot-sdk-c) for a BeagleBoard Black.
I did setup a Debian GNU/Linux 8.7 (jessie) Machine and installed the toolchain as described here: http://exploringbeaglebone.com/chapter7/.
Then i followed the steps here:
https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/SDK_cross_compile_example.md and Created a Toolchain file:
INCLUDE(CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Linux) # this one is important
SET(CMAKE_SYSTEM_VERSION 1) # this one not so much
# this is the location of the amd64 toolchain targeting the Raspberry Pi
SET(CMAKE_C_COMPILER /usr/bin/arm-linux-gnueabihf-gcc)
SET(CMAKE_FIND_ROOT_PATH /usr/lib/arm-linux-gnueabihf)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
i call the Buildscript of the azure-sdk using:
./build.sh --toolchain-file toolchain-bb.cmake -cl --sysroot=/usr/lib/arm-linux-gnueabihf
The following Error Occures
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.0/Modules/FindOpenSSL.cmake:328 (find_package_handle_standard_args)
c-utility/CMakeLists.txt:141 (find_package)
i tried to install openssl using:
sudo apt-get install openssl:armhf
but the error remains, if i build the source for arm64 (using just the build.sh file of the azure-iot-sdk) everything works fine.
if i clone openssl and build it targeting arm i get the following error:
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found
version "1.1.1")
If you have Openssl present in your tool chain then you simply need to add a couple of additional lines to your cmake toolchain file. This will help cmake find your libraries and headers. Something like this:
SET(OPENSSL_ROOT_DIR /path/to/openssl/lib)
SET(OPENSSL_INCLUDE_DIR /path/to/openssl/include/)
If it is not present then you will need to cross compile openssl for your target and install it into your toolchain. Typically into /<sysroot>/usr/lib and /<sysroot>/usr/include.
Alternatively if openssl is on your device but not in your toolchain then you can simply copy it from the device. There is an example of copying dependencies to the toolchain in the Raspberry Pi demo here: https://github.com/Azure/azure-iot-sdk-c/blob/master/doc/SDK_cross_compile_example.md