Fail endianess test when building project with CMAKE (macOS Catalina) - c++

I am working on a project that is written in C++ so we build it with CMAKE. I was working on it on a CentOS machine and everything was fine. However, now I've switched to macOS (I have the latest Catalina update) and first I cloned the repo from github, installed cmake and I tried to build it, but it fails due to the ENDIANESS TEST so the project doesn't finish building.Here is the repo that I'm trying to work on btw. I also use some additional flags, but that shouldn't be the issue. Any ideas how to fix this?
Here is the command that I use for trying to build:
/usr/local/bin/cmake -D ZLIB_INCLUDE_DIR=/Users/basavyr/Downloads/zlib-1.2.11/ -D OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl#1.1/1.1.1d/include/ -D OPENSSL_SSL_LIBRARY=/usr/local/Cellar/openssl#1.1/1.1.1d/lib/libssl.dylib -D OPENSSL/CRYPTO_LIBRARY=/usr/local/Cellar/openssl#1.1/1.1.1d/lib/libcrypto.1.1.dylib -D CMAKE_INSTALL_PREFIX=../tarball/xrootd ../
And here is the error I'm getting (ignore the other ones, those apparently do not affect the failing):
CMake Deprecation Warning at CMakeLists.txt:13 (cmake_policy):
The OLD behavior for policy CMP0054 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Could NOT find systemd (missing: SYSTEMD_INCLUDE_DIRS SYSTEMD_LIBRARIES)
-- Could NOT find Macaroons (missing: MACAROONS_INCLUDES MACAROONS_LIB)
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
[I] Determining version from git
-- crc32c submodule update
-- Check if the system is big endian
-- Searching 16 bit integer
CMake Error at /usr/local/Cellar/cmake/3.16.2/share/cmake/Modules/TestBigEndian.cmake:50 (message):
no suitable type found
Call Stack (most recent call first):
external/crc32c/CMakeLists.txt:67 (test_big_endian)
-- Configuring incomplete, errors occurred!
See also "/Users/basavyr/Pipeline/DevWorkspace/Github/xrootd/build/CMakeFiles/CMakeOutput.log".
See also "/Users/basavyr/Pipeline/DevWorkspace/Github/xrootd/build/CMakeFiles/CMakeError.log".
I've tried to search through those two files but I couldn't find anything useful to be honest. I've also tried to search this issue online but without any success.

Related

Ubuntu OpenCV not compiling

I'm trying to compile OpenCV 3.2 with contributions with the following commands:
1.
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/ -DOPENCV_EXTRA_MODULES_PATH=/home/matteo/Desktop/Xilinx/OpenCV/source/opencv_contrib/modules/ /home/matteo/Desktop/Xilinx/OpenCV/source/opencv-3.2.0/
2.
make -j7 # runs 7 jobs in parallel
3.
sudo make install
Can you explain why I get
...
........
...........
........................
-- VTK is not found. Please set -DVTK_DIR in CMake to VTK build directory, or to VTK install subdirectory with VTKConfig.cmake file
-- Caffe: NO
-- Protobuf: NO
-- Glog: NO
-- Downloading ...
CMake Error at cmake/OpenCVUtils.cmake:1043 (file):
file DOWNLOAD cannot open file for write.
Call Stack (most recent call first):
../opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
../opencv_contrib/modules/dnn/CMakeLists.txt:5 (include)
CMake Error at cmake/OpenCVUtils.cmake:1047 (message):
Failed to download . Status=
Call Stack (most recent call first):
../opencv_contrib/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download)
../opencv_contrib/modules/dnn/CMakeLists.txt:5 (include)
-- Configuring incomplete, errors occurred!
I'm working with Ubuntu 16.04 . I already had OpenCV on the system: maybe I unistall it in the wrong way? I remember to compile OpenCV 3.2 with the same command used above.
You must have matching versions of the opencv_contrib and the opencv itself.
Under the opencv github, go to the OpenCV releases and download the 3.2.0 (it should be the same in the master branch).
Now, go to https://github.com/opencv/opencv_contrib/releases and download the 3.2.0. Then you will have both versions matching.
After that all the cmake commands found on the README.md at opencv_contrib master branch should work fine.
I get the same error, that exact error, around the protobuf. There's another error on the xfeatures2d module, too, if your delete the dnn modules (so they don't get configured/built). My problem is, I need the "non-free" xfeatures2d module. :(
The problem appears to be in the opencv_contrib, in the DNN and xfeatures2d modules, but I'm not sure how to fix it. the call to ocv_download seems to be having empty inputs, even though the dnn and xfeatures2d cmake files are passing in arguments. I am not even a novice with cmake, so I'm not sure how to troubleshoot further.
I get this error on both Mac configuring for XCode and on Windows configuring for Visual Studio, using the latest version of cmake-gui, 3.8.0-rc3.
EDIT: I think I've found the issue, though. I opened an issue in the opencv_contrib github. There is a call to ocv_download in the dnn and xfeatures2d cmake files that uses FILENAME as the first parameter, but should be using PACKAGE instead. When I changed the parameters to PACKAGE, CMake successfully configured opencv with the opencv_contrib modules.
Hope this helps! :)
You might not use the same version of opencv and opencv_contrib
https://github.com/opencv/opencv_contrib/archive/<version>.zip
https://github.com/opencv/opencv/archive/<version>.zip
like master or 3.2.0
SHORT
You need to have the same version in opencv and opencv_contrib (.../opencv_contrib/modules/... belongs to an independent repo).
Either the same release or the last commit in BOTH repositories.
Check which version you have and move the other. In your case, I guess you have to change the version of opencv_contrib, then move to the release with git or download it from github.
git checkout <number_opencv_version i.e. 3.2.0>
LONG
I guess as Ken Lee, that you do not have the same version in the repositories.
As Matt referenced in the opened issue, there is a problem with the call of ocv_download because the version is not the one that was used when opencv-3.1, therefore it fails because the parameter is not the expected one.
It happens to me when I was using opencv 3.1.0 and the last version of opencv_contrib. You could change the cmake files one by one, but it is easier to take the correct version in each repo.
There is a right conflict in your build folder (may result from your previous sudo make install). I don't remember how I fixed it, but you can try recursively chown to both source and build folders (or chmod to 777).

Installing the SFGUI with Cmake

I've been trying to install SFGUI library with Cmake tool with instructions given here: SFGUI Install Tutorial . Still got many problems in major with Cmake, which couldn't find few files from SFGUI directory, for example
CMake Error: The source "D:/SFGUI-master/CMakeLists.txt" does not match the source "D:/SFGUI-0.3.0/CMakeLists.txt" used to generate cache. Re-run cmake with a different source directory.
Restarting didn't help. Could anyone write how to install this in simple steps? Regards.
cmake is telling you that the files it has generated in it's cache from a previous run don't match the source files you are currently using. I would imagine that you ran cmake, then switched git branches or tags and tried to run cmake again. You can just rm -r CMakeFiles in your build directory to remove the cache. Then you should be able to run cmake again without errors.
Thanks! It moved a little bit, but stopped actually at error:
CMake Error at cmake/Modules/FindSFML.cmake:306 (message):
Could NOT find SFML (missing: SFML_GRAPHICS_LIBRARY SFML_WINDOW_LIBRARY
SFML_SYSTEM_LIBRARY)
Call Stack (most recent call first):
CMakeLists.txt:21 (find_package)
Configuring incomplete, errors occurred!
See also "C:/Users/admin/Documents/Visual Studio 2015/Projects/sfml1/sfml1/CMakeFiles/CMakeOutput.log".
To be honest, I will write down steps I did: 1.Configured SFML in VS15 in Windows 8.1 2. I installed the newswet version of CMake 3. Installed also newest SFGUI from Github. 4.In Cmake GUI as a build I choose my project in VS and as a source - SFGUI directory. 5.In CMake Configure and there are the errors. Did I missed something?

lemon install SOPLEX, COIN and ILOG libraries

I was trying to install Lemon on Ubuntu 14.04. I was going as per the instructions in their documentation. On the "cmake .." command, I got an error as the following
aniket#aniket-Lenovo-G50-45:~/lemon-1.3.1/build$ cmake ..
CMake Error at CMakeLists.txt:3 (CMAKE_POLICY):
Policy "CMP0048" is not known to this version of CMake.
-- Could NOT find ILOG (missing: ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR)
-- Could NOT find COIN (missing: COIN_INCLUDE_DIR COIN_CBC_LIBRARY COIN_CBC_SOLVER_LIBRARY COIN_CGL_LIBRARY COIN_CLP_LIBRARY COIN_COIN_UTILS_LIBRARY COIN_OSI_LIBRARY COIN_OSI_CBC_LIBRARY COIN_OSI_CLP_LIBRARY)
-- Could NOT find SOPLEX (missing: SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR)
-- Configuring incomplete, errors occurred!
See also "/home/aniket/lemon-1.3.1/build/CMakeFiles/CMakeOutput.log".
See also "/home/aniket/lemon-1.3.1/build/CMakeFiles/CMakeError.log".
I tried to update and upgrade Cmake just in case. But, it didn't help. So, is this about the libraries not being installed (COIN, ILOG, etc)? How do I install them?
No, I've just succeeded in installation by commenting third line in CMakeLists.txt:
#CMAKE_POLICY(SET CMP0048 OLD)
So, the problem is not in COIN, ILOG, etc.
It's not a library problem, rather than a CMAKE_POLICY problem. I was having the same issue, as my cmake was not recognizing the following policy:
CMAKE_POLICY(SET CMP0048 OLD)
Turned out that my cmake version (2.8.xx) was too old. After upgrading to cmake 3.0.2, this issue was fixed.

Gruel required to compile myblock

So I was following the gnuradio tutorial on building an OOT. However i got into trouble with boost so i followed a solution that made me install boost and export by the command:
export LD_LIBRARY_PATH=$BOOST_PREFIX/lib
I did that and got into another error after running cmake (below)
$cmake ../
-- Build type not specified: defaulting to release.
-- Boost version: 1.53.0
-- Found the following Boost libraries:
-- filesystem
-- system
-- checking for module 'gruel'
-- package 'gruel' not found
-- Could NOT find GRUEL (missing: GRUEL_LIBRARIES GRUEL_INCLUDE_DIRS)
-- checking for module 'gnuradio-core'
-- package 'gnuradio-core' not found
-- Could NOT find GNURADIO_CORE (missing: GNURADIO_CORE_LIBRARIES GNURADIO_CORE_INCLUDE_DIRS)
-- checking for module 'cppunit'
-- package 'cppunit' not found
-- Could NOT find CPPUNIT (missing: CPPUNIT_INCLUDE_DIRS)
CMake Error at CMakeLists.txt:91 (message):
Gruel required to compile newblock
-- Configuring incomplete, errors occurred!
please can any one help me solve this problem and add blocks to gnu radio
You're missing the cppunit development headers; please install them.
The errors about Gruel indicate that you're trying to use a OOT template that was made for an older version of GNU Radio. Gruel was part of old versions of GNU Radio, and has been merged into other parts of GNU Radio, and is not available anymore.
The correct way of generating a module is using gr_modtool, which comes with GNU Radio, and automatically will only generate valid OOTs. This is rather nicely documented in the official Guided Tutorials, gr_modtool nm my_module_name, see Tutorial 3.
Best regards,
Marcus

CMake error when compiling out of tree model in gnu radio

I have a problem and I can't seem to find a solution to it. I am building a project using gnuradio and in the process of building an OOT module i always get the following error after $cmake ../ (I followed the instruction from the GNU site though)
$ cmake ../
-- Build type not specified: defaulting to release.
-- Could NOT find Boost
CMake Error at CMakeLists.txt:63 (message):
Boost required to compile trial
-- Configuring incomplete, errors occurred!
Please any help will be deeply appreciated (And please I am a noob so kindly have it easy on me).
Enable the debug output for the FindBoost module when invoking cmake, it'll help you pinpoint which packages are missing:
$ cmake -DBoost_DEBUG=ON ../
Here's a similar problem on kubuntu 14.04: https://github.com/antoinet/gr-acars2/issues/2.
The solution was to install the missing libboost-filesystem-dev and libboost-system-dev packages.
The basic issue is that 1 or more Boost components (e.g., system, threads, filesystem) is/are not being found, so you need to get it/them installed. How you do the install depends on your OS. So ... what OS are you trying to do this on?
Also, how did you install GNU Radio in the first place? Any package manager with its salt will make sure dependencies are installed correctly along with the actual package. If you used MacPorts or apt-get or yum to install GNU Radio, Boost should have been installed.
Related: Have you considered signing up for the GNU Radio discussion email list? This question would be quickly answered there. https://lists.gnu.org/mailman/listinfo/discuss-gnuradiosome