Gnuradio crash after installing own block - c++

i am trying to install a own Block for gnuradio. I go through this(http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_C++) tutorial. But in Step 5, Installing, I get some problems.
I installed it, but i didnt see the Block in gnuradio-companion.
I added the path:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages/
export GRC_BLOCKS_PATH=/usr/local/share/gnuradio/grc/blocks/
Now i can see the Block: But if I want to use it, the gnuradio-companion crash.
^[[A^[[BFatal Python error: PyThreadState_Get: no current thread
Abort trap: 6
Gnuradio Version: 3.7.10.1
OS: OS X El Capitan
What could be the problem? Wrong/Missing path? Mistake in the program?
/edit2: To add a Block, writen in python works fine(With the tutorial: http://gnuradio.org/redmine/projects/gnuradio/wiki/Guided_Tutorial_GNU_Radio_in_Python)
/edit: When I install it, I get many warnings when i use cmake:
-- Build type not specified: defaulting to release.
-- Boost version: 1.59.0
-- Found the following Boost libraries:
-- filesystem
-- system
Checking for GNU Radio Module: RUNTIME
* INCLUDES=/opt/local/include
* LIBS=/opt/local/lib/libgnuradio-runtime.dylib;/opt/local/lib/libgnuradio-pmt.dylib
GNURADIO_RUNTIME_FOUND = TRUE
CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property should not be read from target "test-tutorialCPP".
Use the target name directly with add_custom_command, or use the generator
expression $<TARGET_FILE>, as appropriate.
Call Stack (most recent call first):
lib/CMakeLists.txt:77 (GR_ADD_TEST)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Using install prefix: /usr/local
-- Building for version: v1.0-compat-xxx-xunknown / 1.0.0git
--
-- Checking for module SWIG
-- Found SWIG version 3.0.10.
CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
Policy CMP0026 is not set: Disallow use of the LOCATION target property.
Run "cmake --help-policy CMP0026" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The LOCATION property should not be read from target
"gnuradio-tutorialCPP". Use the target name directly with
add_custom_command, or use the generator expression $<TARGET_FILE>, as
appropriate.
Call Stack (most recent call first):
python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target
"/opt/local/bin/python2.7".
Call Stack (most recent call first):
python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at cmake/Modules/GrTest.cmake:45 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property. Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target
"/Users/abc/dev/gnuradio/modul/gr-tutorialCPP/python/qa_my_qpsk_demod_cb.py".
Call Stack (most recent call first):
python/CMakeLists.txt:44 (GR_ADD_TEST)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/abc/dev/gnuradio/modul/gr-tutorialCPP/build

This happens when GNU Radio and your module are linked against different Python libraries.
On OSX, there is usually a system installation and another one from Homebrew or MacPorts. Try linking everything against the Homebrew/MacPorts libraries.
You seem to have a Python installation in /opt/local. Use cmake to reconfigure your module and point PYTHON_LIBRARY and PYTHON_INCLUDE_DIR to the installation in /opt.

Related

How to use CMake to compile SharkML library? [duplicate]

I am trying to build ripple by following the build guide on GitHub, but boost is continuously throwing some unknown error. Boost is installed and running. I installed boost_1_71_0 as described by the build guide.
/home/usman/Downloads/clion-2020.1.2/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/usman/Desktop/ripple/rippled
-- Using 4 cores for ExternalProject builds.
-- rippled version: 1.6.0
-- NIH-EP cache path: /home/usman/Desktop/ripple/rippled/.nih_c/unix_makefiles/GNU_9.3.0/Debug
-- using [01bd5a2646cda78ee09d2067c287c8f89872736d] as build container tag...
-- docker local user id: 1000
-- docker local group id: 1000
-- BOOST_ROOT: /usr/local
-- BOOST_LIBRARYDIR: /usr/local/lib/
CMake Error at /usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:117 (find_package):
Found package configuration file:
/usr/local/lib/cmake/boost_chrono-1.71.0/boost_chrono-config.cmake
but it set boost_chrono_FOUND to FALSE so package "boost_chrono" is
considered to be NOT FOUND. Reason given by package:
No suitable build variant has been found.
The following variants have been tried and rejected:
* libboost_chrono.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)
* libboost_chrono.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)
Call Stack (most recent call first):
/usr/local/lib/cmake/Boost-1.71.0/BoostConfig.cmake:182 (boost_find_component)
Builds/CMake/deps/FindBoost.cmake:273 (find_package)
Builds/CMake/deps/Boost.cmake:50 (find_package)
CMakeLists.txt:43 (include)
-- Configuring incomplete, errors occurred!
See also "/home/usman/Desktop/ripple/rippled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/usman/Desktop/ripple/rippled/cmake-build-debug/CMakeFiles/CMakeError.log".
[Finished]
There is a similar question here, but your issue appears to be the opposite case.
The important section of the error is here:
No suitable build variant has been found.
The following variants have been tried and rejected:
* libboost_chrono.so.1.71.0 (shared, Boost_USE_STATIC_LIBS=ON)
* libboost_chrono.a (shared runtime, Boost_USE_STATIC_RUNTIME=ON)
It shows you what libraries were found, and even gives the reason why they were rejected. All of the libraries found on your machine are shared libraries. However, your CMake configuration indicates you do not want to use shared libraries (Boost_USE_STATIC_LIBS=ON and Boost_USE_STATIC_RUNTIME=ON). To fix the error, you have two options:
Set Boost_USE_STATIC_LIBS to OFF and Boost_USE_STATIC_RUNTIME to OFF:
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost ... )
Build the static Boost libraries also, so not only the shared libraries are available on your machine.

How to avoid update checks with CMake FetchContent?

all.
I decided to use the new cmake macro to download external dependencies.
I took the sample code from the documentation for the Catch2 library.
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.4
)
FetchContent_GetProperties(Catch2)
if(NOT Catch2_POPULATED)
FetchContent_Populate(Catch2)
add_subdirectory(${catch2_SOURCE_DIR} ${catch2_BINARY_DIR})
endif()
The solution works great, except for the ability to restart the cmake when I am offline (no wifi and mobile network only me and my laptop).
I get the following error:
[0/7] Performing update step for 'catch2-populate'
fatal: «https://github.com/catchorg/Catch2.git/» недоступно: Could not resolve host: github.com
CMake Error at /Users/evgeny.proydakov/repository/ihft/build/_deps/catch2-subbuild/catch2-populate-prefix/tmp/catch2-populate-gitupdate.cmake:97 (execute_process):
execute_process failed command indexes:
1: "Child return code: 128"
FAILED: catch2-populate-prefix/src/catch2-populate-stamp/catch2-populate-update
cd /Users/evgeny.proydakov/repository/ihft/build/_deps/catch2-src && /usr/local/Cellar/cmake/3.20.1/bin/cmake -P /Users/evgeny.proydakov/repository/ihft/build/_deps/catch2-subbuild/catch2-populate-prefix/tmp/catch2-populate-gitupdate.cmake
ninja: build stopped: subcommand failed.
CMake Error at /usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1012 (message):
Build step for catch2 failed: 1
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1141:EVAL:2 (__FetchContent_directPopulate)
/usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1141 (cmake_language)
/usr/local/Cellar/cmake/3.20.1/share/cmake/Modules/FetchContent.cmake:1184 (FetchContent_Populate)
.cmake/icmake.cmake:46 (FetchContent_MakeAvailable)
CMakeLists.txt:10 (include)
-- Configuring incomplete, errors occurred!
Is it possible to download dependency one time, check revision and don't try to connect each time to remote server?
The documentation for FetchContent_Populate says you can get exactly what you want with the FETCHCONTENT_UPDATES_DISCONNECTED cache variable:
FETCHCONTENT_UPDATES_DISCONNECTED
... This ... disables the
update stage. Therefore, if content has not been downloaded
previously, it will still be downloaded when this option is enabled.
This can speed up the configure stage... It is OFF by default.
So set this one to ON globally, or for Catch2 only, set the variable FETCHCONTENT_UPDATES_DISCONNECTED_Catch2 to ON.

Aseprite build does not go past the cmake stage on MacOs Catalina

I was trying to install and compile aseprite on mi MacBookPro with macOs Catalina 10.15.6. I installed everything needed for the build, xcode, cmake, ninja, etc. I also skipped the step to build skia by installing it directly from the GitHub and unzipping the macOs build to my $HOME/deps/skia. This is an image showing where the install is
The folder organization
Then, I typed the following commands independetly of each other on my terminal using zsh, Iterm2.
cd aseprite
mkdir build
cd build
cmake \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk \
-DUSE_ALLEG4_BACKEND=OFF \
-DUSE_SKIA_BACKEND=ON \
-DSKIA_DIR=$HOME/deps/skia \
-DWITH_HarfBuzz=OFF \
-G Ninja \
..
ninja aseprite (Could not do this command as previous cmake stage fails)
Do keep in mind that I changed OSX_SYSROOT to where my mac os sdk is which is at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
The problem is that this is the output that that command gives me
simonb#MacBook-Pro-de-Simon build % cmake \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 \
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk \
-DUSE_ALLEG4_BACKEND=OFF \
-DUSE_SKIA_BACKEND=ON \
-DSKIA_DIR=$HOME/deps/skia \
-DWITH_HarfBuzz=OFF \
-G Ninja \
..
CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
The OLD behavior for policy CMP0046 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.
-- Symbol prefix:
-- Could NOT find Threads (missing: Threads_FOUND)
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework
-- Adding -lm flag.
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)
-- Performing Test WEBP_HAVE_FLAG_SSE41
-- Performing Test WEBP_HAVE_FLAG_SSE41 - Failed
-- Performing Test WEBP_HAVE_FLAG_SSE41
-- Performing Test WEBP_HAVE_FLAG_SSE41 - Success
-- Performing Test WEBP_HAVE_FLAG_SSE2
-- Performing Test WEBP_HAVE_FLAG_SSE2 - Success
-- Performing Test WEBP_HAVE_FLAG_MIPS32
-- Performing Test WEBP_HAVE_FLAG_MIPS32 - Failed
-- Performing Test WEBP_HAVE_FLAG_MIPS32
-- Performing Test WEBP_HAVE_FLAG_MIPS32 - Failed
-- Performing Test WEBP_HAVE_FLAG_MIPS_DSP_R2
-- Performing Test WEBP_HAVE_FLAG_MIPS_DSP_R2 - Failed
-- Performing Test WEBP_HAVE_FLAG_MIPS_DSP_R2
-- Performing Test WEBP_HAVE_FLAG_MIPS_DSP_R2 - Failed
-- Performing Test HAS_COMPILE_FLAG
-- Performing Test HAS_COMPILE_FLAG - Success
-- Performing Test WEBP_HAVE_FLAG_NEON
-- Performing Test WEBP_HAVE_FLAG_NEON - Failed
-- Performing Test WEBP_HAVE_FLAG_NEON
-- Performing Test WEBP_HAVE_FLAG_NEON - Failed
-- Performing Test WEBP_HAVE_FLAG_MSA
-- Performing Test WEBP_HAVE_FLAG_MSA - Failed
-- Performing Test WEBP_HAVE_FLAG_MSA
-- Performing Test WEBP_HAVE_FLAG_MSA - Failed
-- Found GLUT: /System/Library/Frameworks/GLUT.framework
-- Performing Test HAS_NO_DEPRECATED
-- Performing Test HAS_NO_DEPRECATED - Success
-- curl version=[7.21.6]
-- LDAP_H not found CURL_DISABLE_LDAP set ON
CMake Warning (dev) at third_party/curl/CMakeLists.txt:562 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "HAVE_FCNTL_O_NONBLOCK" will no longer be
dereferenced when the policy is set to NEW. Since the policy is not set
the OLD behavior will be used.
Call Stack (most recent call first):
third_party/curl/CMakeLists.txt:664 (curl_internal_test)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at third_party/curl/CMakeLists.txt:594 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "HAVE_GLIBC_STRERROR_R_COMPILE" will no longer be
dereferenced when the policy is set to NEW. Since the policy is not set
the OLD behavior will be used.
Call Stack (most recent call first):
third_party/curl/CMakeLists.txt:673 (curl_internal_test_run)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at third_party/curl/CMake/CurlCheckCSourceCompiles.cmake:16 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "curl_cv_recv" will no longer be dereferenced when
the policy is set to NEW. Since the policy is not set the OLD behavior
will be used.
Call Stack (most recent call first):
third_party/curl/CMake/OtherTests.cmake:31 (curl_check_c_source_compiles)
third_party/curl/CMakeLists.txt:792 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at third_party/curl/CMake/OtherTests.cmake:89 (message):
Unable to link function recv
Call Stack (most recent call first):
third_party/curl/CMakeLists.txt:792 (include)
-- Configuring incomplete, errors occurred!
See also "/Users/simonb/aseprite/build/CMakeFiles/CMakeOutput.log".
See also "/Users/simonb/aseprite/build/CMakeFiles/CMakeError.log".
I have tried for all day to solve this problem. If somebody can help me compile it would be great!
Both Cmake output logs can be found here: https://gist.github.com/NotVeryGoodAtCodingButOk/d929c2f0c76c8290cb98d6875f832104
Folder Organization is the following

Issue: No package 'libcrypto' found

I saw this issue "No package 'libcrypto' found". The same error I fixed multiple months ago was to follow this solution: https://github.com/scipr-lab/libsnark/issues/99
I tried this solution today however it doesn't work anymore. (I also tried"brew install openssl, brew info openssl") No luck.
Have you seen this before? Would you help take a look?
-- Checking for module 'libcrypto'
-- No package 'libcrypto' found
CMake Error at /usr/local/Cellar/cmake/3.15.4/share/cmake/Modules/FindPkgConfig.cmake:458 (message):
A required package was not found
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.15.4/share/cmake/Modules/FindPkgConfig.cmake:637 (_pkg_check_modules_internal)
PlaylistParser/src/CMakeLists.txt:2 (pkg_check_modules)
-- Configuring incomplete, errors occurred!
brew info openssl says the following: (for me, might be different for you if your version is different)
openssl#1.1 is keg-only, which means it was not symlinked into /usr/local,
because openssl/libressl is provided by macOS so don't link an incompatible version.
If you need to have openssl#1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl#1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
For pkg-config to find openssl#1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig"
Since your CMake script seems to use pkg-config, you only need to execute the last statement before you run cmake.
When I run ./install_prereq install-unpackaged command, I'd got the following error.
configure: error: Package requirements (libcrypto >= 1.0.1) were not
met:
No package 'libcrypto' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables crypto_CFLAGS and
crypto_LIBS to avoid the need to call pkg-config. See the pkg-config
man page for more details.
Then I run the following command and the problem was solved;
yum install openssl-devel

Cmake fails in compiling Caffe with lmdb.h

Windows 10 Visual Studio 14
I am trying to build a c++ code based on this github page. However, when I try to generate lib files in Cmake I get this error:
I don't know what's wrong with lmdb.h file. Should I build lmdb from scratch?
There are 2 error messages:
CMake Warning (dev) at cmake/Dependencies.cmake:46 (find_package):
Policy CMP0074 is not set: find_package uses _ROOT
variables. Run "cmake --help-policy CMP0074" for policy details.
Use the cmake_policy command to set the policy and suppress this
warning.
Environment variable HDF5_ROOT is set to:
C:\Program Files\HDF_Group\HDF5\1.10.3
For compatibility, CMake is ignoring the variable. Call Stack (most
recent call first): CMakeLists.txt:49 (include) This warning is for
project developers. Use -Wno-dev to suppress it.
CMake Error at cmake/Utils.cmake:105 (if): Syntax error in cmake
code at
C:/Project/RCNN/Faster RCNN/caffe-faster-rcnn-dev/cmake/Utils.cmake:105
when parsing string
C:\Project\RCNN\Faster RCNN\Packages\lmdb-mdb.master\libraries\liblmdb/lmdb.h
Invalid escape sequence \P Call Stack (most recent call first):
cmake/Modules/FindLMDB.cmake:25 (caffe_parse_header)
cmake/Dependencies.cmake:52 (find_package) CMakeLists.txt:49
(include)
1: https://github.com/D-X-Y/caffe-faster-rcnn/tree/dev [2]:
https://i.stack.imgur.com/hc30J.png
Also the paths for GLOG, GFLAGS, and PROTOBUF are not found.