gnuradio out of tree module Compiling and Installing the Block problem - gnuradio-companion

when I Compiling and Installing the GNURadio OOT module Block it display
up-to-date: /usr/local/lib/cmake/faf/__init__.py
up-to-date: /usr/local/include/faf/api.h
updating gnuradio-companion

Related

mapbox-gl-native not compiling with XCode 12

I downloaded the master for mapbox-gl-native, installed needed dependencies, followed instructions, then tried to build with "cmake --build build" but I get a lot of errors.
This is the first error:
[ 8%] Building CXX object CMakeFiles/mbgl-core.dir/src/mbgl/layermanager/circle_layer_factory.cpp.o
In file included from /Users/imac/Work/GitHub/mapbox-gl-native/src/mbgl/layermanager/circle_layer_factory.cpp:1:
In file included from /Users/imac/Work/GitHub/mapbox-gl-native/include/mbgl/layermanager/circle_layer_factory.hpp:3:
In file included from /Users/imac/Work/GitHub/mapbox-gl-native/include/mbgl/layermanager/layer_factory.hpp:3:
In file included from /Users/imac/Work/GitHub/mapbox-gl-native/include/mbgl/style/layer.hpp:3:
In file included from /Users/imac/Work/GitHub/mapbox-gl-native/include/mbgl/style/conversion.hpp:3:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:504:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string_view:175:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:642:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility:199:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:283:5: error: static_assert failed due to
requirement '0UL < sizeof...(_Types)' "tuple_element index out of range"
static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
^ ~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple:457:43: note: in instantiation of template class
'std::__1::tuple_element<0, std::__1::__tuple_types<> >' requested here
typedef _LIBCPP_NODEBUG_TYPE typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:1007:10: note: in instantiation of template class
'std::__1::tuple_element<0, std::__1::tuple<> >' requested here
typename tuple_element<_Ip, tuple<_Tp...> >::type&
^
/Users/imac/Work/GitHub/mapbox-gl-native/include/mbgl/util/indexed_tuple.hpp:38:16: note: while substituting deduced template arguments into function template 'get'
[with _Ip = 0, _Tp = <>]
return std::get<TypeIndex<I, Is...>::value, Ts...>(*this);
^
/Users/imac/Work/GitHub/mapbox-gl-native/src/mbgl/layout/circle_layout.hpp:20:59: note: in instantiation of function template specialization
'mbgl::IndexedTuple<mbgl::TypeList<mbgl::style::CircleSortKey>, mbgl::TypeList<mbgl::style::PropertyValue<float> > >::get<mbgl::style::CircleSortKey>'
requested here
const bool sortFeaturesByKey = !unevaluatedLayout.get<style::CircleSortKey>().isUndefined();
^
This is the result for: "gcc --version"
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
This is the result for: "cmake . -B build"
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- The C compiler identification is AppleClang 12.0.0.12000032
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring GL-Native with OpenGL renderer backend
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2")
-- Checking for one of the modules 'glfw3'
-- Not building node bindings, dependencies not found. Run 'npm update'.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/imac/Work/GitHub/mapbox-gl-native/build
NOTE: I have an older version of mapbox environment (July 2019) that was perfectly compiling with XCode (compiling inside XCode) but as soon as I installed XCode 12 I started to have the same error.

Macos Could NOT identify C/C++ compiler because compilation failed

I am getting this error when trying to compile on drake macos 10.14.6. I have ran the setup script.
Bazel: 2.0.0
Drake 0.11.0
lawn-143-215-113-3:drake tdogb$ bazel build //...
INFO: Call stack for the definition of repository 'cc' which is a cc_repository (rule definition at /Users/tdogb/drake/tools/workspace/cc/repository.bzl:147:1
7):
- /Users/tdogb/drake/tools/workspace/default.bzl:110:9
- /Users/tdogb/drake/WORKSPACE:10:1
ERROR: An error occurred during the fetch of repository 'cc':
attribute : Could NOT identify C/C++ compiler because compilation failed.
ERROR: no such package '#cc//': attribute : Could NOT identify C/C++ compiler because compilation failed.
INFO: Elapsed time: 0.221s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
currently loading: attic/util ... (145 packages)
lawn-143-215-113-3:drake tdogb$
From the https://drake.mit.edu/release_notes/release_notes.html list of dependencies over time, Drake 0.11.0 is probably not compatible with Bazel 2.0.0. Try Bazel 1.1.0 or 1.0.0 instead.

undefined reference to `cv::xfeatures2d::SURF::create(double, int, int, bool, bool)' during runtime

I am creating an app on the nvidia jetson nano (under ubuntu 18.04 LTS) using Qt-creator. To do so I create my own library (named recolib) which uses opencv (version 3.4.6) and then in my Qt app project I include my library.
The library compiles fine, but when I tried compiling the app it reaches 100% and then I get the following error: undefined reference to `cv::xfeatures2d::SURF::create(double, int, int, bool, bool)'.
Note that the class where this function is called is part of my library "recolib".
I have build opencv with cmake, I have enabled non-free modules and gave the right path to it and opencv built and installed fine.
Moreover, the app works well on mac and on an ubuntu virtual machine.
Here are samples of the Cmakelist.txt of the app:
cmake_minimum_required(VERSION 3.0)
# Add folder where are supportive functions
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11 -pthread -lm")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -pthread -lm")
...
find_package(OpenCV REQUIRED)
if(OPENCV_XFEATURES2D_FOUND)
message("xfeatures2d found")
endif()
...
SET(RECOLIB_DIR "${PROJECT_SOURCE_DIR}/libs/recotracking-recolib")
include_directories("${RECOLIB_DIR}/include")
if(WIN32)
link_directories("${RECOLIB_DIR}/build/Debug")
else()
link_directories("${RECOLIB_DIR}/build/")
endif()
SET(RECOLIB_LIBRARY recolib)
include_directories(${OPENCV_INCLUDE_DIRS})
...
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
FILE(GLOB_RECURSE RES_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qrc")
FILE(GLOB_RECURSE SRC_FILES "${SRC_FOLDER}/*.cpp")
FILE(GLOB_RECURSE UI_FILES "${SRC_FOLDER}/*.ui")
FILE(GLOB_RECURSE HDR_FILES "${HDR_FOLDER}/*.h")
link_directories(${OpenCV_LIBRARY_DIRS})
message("opencv libs: ${OpenCV_LIBRARIES}")
add_executable(${execName} ${OS_BUNDLE}# Expands to WIN32 or MACOS_BUNDLE depending on OS
${RES_FILES} ${SRC_FILES} ${UI_FILES} ${HDR_FILES} ${META_FILES_TO_INCLUDE}
)
...
# Add the Qt5 Widgets for linking
if (APPLE)
target_link_libraries(${execName}
${OpenCV_LIBRARIES}
${AppKit}
${CoreAudio}
${AudioToolbox}
Qt5::Core
Qt5::Gui
Qt5::QuickControls2
Qt5::MultimediaWidgets
Qt5::Multimedia
Qt5::MultimediaPrivate
Qt5::Widgets
Qt5::Sql
${RECOLIB_LIBRARY})
else()
target_link_libraries(${execName}
${OpenCV_LIBRARIES}
Qt5::Core
Qt5::Gui
Qt5::QuickControls2
Qt5::MultimediaWidgets
Qt5::Multimedia
#Qt5::MultimediaPrivate
Qt5::Widgets
Qt5::Sql
${RECOLIB_LIBRARY})
endif()
And the output I get executing it under Qt-creator is the following:
Running "/usr/bin/cmake -E server --pipe=/tmp/cmake-Bg9h0e/socket --experimental" in /home/bookbeo-novatech/build-recotracking-app-Desktop-Release.
Starting to parse CMake project, using: "-DCMAKE_BUILD_TYPE:STRING=Release", "-DCMAKE_CXX_COMPILER:STRING=/usr/bin/g++", "-DCMAKE_C_COMPILER:STRING=/usr/bin/gcc", "-DCMAKE_PREFIX_PATH:STRING=/usr", "-DQT_QMAKE_EXECUTABLE:STRING=/usr/lib/qt5/bin/qmake".
-std=c++11 -pthread -lm
The C compiler identification is GNU 7.4.0
The CXX compiler identification is GNU 7.4.0
Check for working C compiler: /usr/bin/gcc
Check for working C compiler: /usr/bin/gcc -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: /usr/bin/g++
Check for working CXX compiler: /usr/bin/g++ -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
Looking for pthread.h
Looking for pthread.h - found
Looking for pthread_create
Looking for pthread_create - not found
Looking for pthread_create in pthreads
Looking for pthread_create in pthreads - not found
Looking for pthread_create in pthread
Looking for pthread_create in pthread - found
Found Threads: TRUE
Found CUDA: /usr/local/cuda (found suitable exact version "10.0")
Found OpenCV: /usr/local (found version "3.4.6")
xfeatures2d found
opencv libs: opencv_calib3d;opencv_core;opencv_cudaarithm;opencv_cudabgsegm;opencv_cudacodec;opencv_cudafeatures2d;opencv_cudafilters;opencv_cudaimgproc;opencv_cudalegacy;opencv_cudaobjdetect;opencv_cudaoptflow;opencv_cudastereo;opencv_cudawarping;opencv_cudev;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_cvv;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_fuzzy;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto
Configuring done
Generating done
CMake Warning:
Manually-specified variables were not used by the project:
QT_QMAKE_EXECUTABLE
CMake Project was parsed successfully.
So as you can see, except for some issues with pthread (but it seems unrelated to the main problem), the cmake configuration appears to be good. Opencv is found and xfeatures2d too.
But when I build the app, at the end of the compilation I get:
[ 94%] Building CXX object CMakeFiles/recotracking-app.dir/recotracking-app_autogen/mocs_compilation.cpp.o
[ 97%] Building CXX object CMakeFiles/recotracking-app.dir/recotracking-app_autogen/EWIEGA46WW/qrc_resources.cpp.o
[100%] Linking CXX executable recotracking-app
/home/bookbeo/recotracking-app/libs/recotracking-recolib/build/librecolib.a(PCB.cpp.o): In function `reco::PCB::load(cv::Mat const&, cv::Mat const&, cv::Mat const&, std::vector<reco::RecoPoi, std::allocator<reco::RecoPoi> >)':
CMakeFiles/recotracking-app.dir/build.make:1045: recipe for target 'recotracking-app' failed
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/recotracking-app.dir/all' failed
Makefile:83: recipe for target 'all' failed
/home/bookbeo-novatech/recotracking-app/libs/recotracking-recolib/src/PCB.cpp:47: undefined reference to `cv::xfeatures2d::SURF::create(double, int, int, bool, bool)'
collect2: error: ld returned 1 exit status
make[2]: *** [recotracking-app] Error 1
make[1]: *** [CMakeFiles/recotracking-app.dir/all] Error 2
make: *** [all] Error 2
10:51:49: Le processus "/usr/bin/cmake" s'est terminé avec le code 2.
Erreur lors de la compilation/déploiement du projet recotracking-app (kit : Desktop)
When executing step "CMake Build"
10:51:49: Temps écoulé : 06:59.
I already tried re-building opencv, it didn't change anything, and the module xfeatures2d seems to be found so I don't know where this error is coming from.
If you have any idea, I would really appreciate it.
Thanks in advance.

Error installing Blurilly gem on OSX 10.12.4

When installing the blurrily gem, I get the following issue.
For reference I'm using:
rvm 1.29.1
ruby 2.1.7p400
rails 3.2.22.5
And I'm trying to install Blurrily 1.0.2.
The error:
/Users/jonkeenan/.rvm/rubies/ruby-2.1.7/bin/ruby -r ./siteconf20170525-
62993-1jexk35.rb extconf.rb
creating Makefile
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7#introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR=" clean
current directory: /Users/jonkeenan/.rvm/gems/ruby-
2.1.7#introhive/gems/blurrily-1.0.2/ext/blurrily
make "DESTDIR="
compiling map_ext.c
compiling search_tree.c
compiling storage.c
storage.c:283:43: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
if (haystack->refs) blurrily_refs_free(&haystack->refs);
^~~~~~~~~~~~~~
storage.c:405:24: error: taking address of packed member 'refs' of
class or structure 'trigram_map_t' may result in an unaligned pointer
value [-Werror,-Waddress-of-packed-member]
blurrily_refs_new(&haystack->refs);
^~~~~~~~~~~~~~
2 errors generated.
make: *** [storage.o] Error 1
make failed, exit code 2
It looks like a c compile issue, but I'm not sure.
I'm running a version of xcode that's using Apple LLVM version 8.1.0 (clang-802.0.42) if that helps.
Unfortunately, it appears that this is a known issue that the gem maintainers have not yet addressed.
As a workaround, it might be worthwhile to switch to a Vagrant/Docker development workflow until this is addressed upstream.

QT Creator links different library than command line

I have a problem I am unable to understand.
I am trying to code a project using openCV 3.1. I want to code inside the QT Creator Environment, because I'm used to that. I do not necessarily need any QT specific features at the moment, I'm working with Ubuntu 14.04.
The problem is, that whenever I try to build inside the QT Creator, it does not build with the following error, but it works if I build from the command line.
10:57:36: Starting: "/usr/bin/cmake" --build . --target all
Linking CXX executable arucoTest
CMakeFiles/arucoTest.dir/PoseEstimator.cpp.o: In function `PoseEstimator::generateMarkers(std::string, int)':
PoseEstimator.cpp:(.text+0x56): undefined reference to `cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME)'
PoseEstimator.cpp:(.text+0xb7): undefined reference to `cv::aruco::drawMarker(cv::Ptr<cv::aruco::Dictionary>&, int, int, cv::_OutputArray const&, int)'
PoseEstimator.cpp:(.text+0x1a9): undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
CMakeFiles/arucoTest.dir/PoseEstimator.cpp.o: In function `cv::String::~String()':
PoseEstimator.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to `cv::String::deallocate()'
CMakeFiles/arucoTest.dir/PoseEstimator.cpp.o: In function `cv::String::String(std::string const&)':
PoseEstimator.cpp:(.text._ZN2cv6StringC2ERKSs[_ZN2cv6StringC5ERKSs]+0x69): undefined reference to `cv::String::allocate(unsigned long)'
collect2: error: ld returned 1 exit status
make[2]: *** [arucoTest] Error 1
make[1]: *** [CMakeFiles/arucoTest.dir/all] Error 2
make: *** [all] Error 2
10:57:36: The process "/usr/bin/cmake" exited with code 2.
So it is some kind of linker error. When I inspect my cmake file and output, I see this:
Running "/usr/bin/cmake /XYZ/arucoTest '-GCodeBlocks - Unix Makefiles'" in /XYZ/arucoTest/testbuild.
-- OpenCV library status:
-- version: 2.4.8
-- libraries: opencv_videostab;opencv_video;opencv_ts;opencv_superres;opencv_stitching;opencv_photo;opencv_ocl;opencv_objdetect;opencv_ml;opencv_legacy;opencv_imgproc;opencv_highgui;opencv_gpu;opencv_flann;opencv_features2d;opencv_core;opencv_contrib;opencv_calib3d
-- include path: /usr/include/opencv;/usr/include
-- Configuring done
-- Generating done
-- Build files have been written to: /XYZ/arucoTest/testbuild
As you can see, it only finds openCV 2.4.8, which I still need because of old ROS Indigo projects. However, if I execute the exact same cmake file and build from the commandline, it works perfectly:
username#pc:/XYZ/arucoTest/build$ cmake ..
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- OpenCV library status:
-- version: 3.1.0
-- libraries: opencv_xphoto;opencv_xobjdetect;opencv_ximgproc;opencv_xfeatures2d;opencv_tracking;opencv_text;opencv_surface_matching;opencv_structured_light;opencv_stereo;opencv_saliency;opencv_rgbd;opencv_reg;opencv_plot;opencv_optflow;opencv_line_descriptor;opencv_fuzzy;opencv_face;opencv_dpm;opencv_dnn;opencv_datasets;opencv_ccalib;opencv_bioinspired;opencv_bgsegm;opencv_aruco;opencv_viz;opencv_videostab;opencv_videoio;opencv_video;opencv_superres;opencv_stitching;opencv_shape;opencv_photo;opencv_objdetect;opencv_ml;opencv_imgproc;opencv_imgcodecs;opencv_highgui;opencv_flann;opencv_features2d;opencv_core;opencv_calib3d
-- include path: /usr/local/include/opencv;/usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /XYZ/arucoTest/build
veith#roethlinLT:/XYZ/arucoTest/build$ make
Scanning dependencies of target arucoTest
[100%] Building CXX object CMakeFiles/arucoTest.dir/PoseEstimator.cpp.o
Linking CXX executable arucoTest
[100%] Built target arucoTest
As you can see I'm building in 2 different folders, because I found that if I cmake in the same folder, it does not work, even if I remove everything in that folder and cmake again from the command line. Also notice, that it finds 2 different include paths depending on where I start the cmake from.
My makefile looks like this (not very crazy), I'm using this exact same file for both cases.
project(arucoTest)
cmake_minimum_required(VERSION 2.8)
find_package(OpenCV REQUIRED)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
set(HEADER_LIST PoseEstimator.h)
set(SRC_LIST PoseEstimator.cpp)
add_executable(${PROJECT_NAME} ${SRC_LIST})
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
Using ccmake and the QT build in inspection window, I see that the OpenCV_DIR variable is set to 2 different things: On command line:
OpenCV_DIR /usr/local/share/OpenCV
In QT Creator:
OpenCV_DIR /ust/share/OpenCV
How do I set this to automatically select the right folder inside QT Creator as well? I really have no idea what could cause this!
Thanks!
Cache variable OpenCV_DIR is set by searching with command find_package (in config mode). While search mechanism is fully deterministic (it is described in the doc), it uses some envorinment variables which may differ under your shell and in QT Creator.
Just a guess, QT Creator may set CMAKE_PREFIX_PATH environment variable to contain /usr directory, so it finds an installation under /usr before one under /usr/local.
For choose specific OpenCV installation, just set OpenCV_DIR cache variable accordingly and rerun configuration process.

Resources