SVO : Fast - Coner Detector - Installation: Plain CMake (No ROS) - c++

I'm working on a project of drone and I'm having an issue with my Raspberry Pi 2 B. When I'm trying to install Fast - Corner Detector I get this on screen
pi#raspberrypi ~/workspace/fast/build $ make
/usr/bin/cmake -H/home/pi/workspace/fast -B/home/pi/workspace/fast/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/pi/workspace/fast/build/CMakeFiles /home/pi/workspace/fast/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/pi/workspace/fast/build'
make -f CMakeFiles/fast.dir/build.make CMakeFiles/fast.dir/depend
make[2]: Entering directory '/home/pi/workspace/fast/build'
cd /home/pi/workspace/fast/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/pi/workspace/fast /home/pi/workspace/fast /home/pi/workspace/fast/build /home/pi/workspace/fast/build /home/pi/workspace/fast/build/CMakeFiles/fast.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/pi/workspace/fast/build'
make -f CMakeFiles/fast.dir/build.make CMakeFiles/fast.dir/build
make[2]: Entering directory '/home/pi/workspace/fast/build'
/usr/bin/cmake -E cmake_progress_report /home/pi/workspace/fast/build/CMakeFiles 1
[ 20%] Building CXX object CMakeFiles/fast.dir/src/fast_10.cpp.o
/usr/bin/c++ -Dfast_EXPORTS -DTEST_DATA_DIR=\"/home/pi/workspace/fast/test/data\" -Wall -Werror -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -Wall -Werror -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unknown-pragmas -O3 -mmmx -msse -msse -msse2 -msse3 -mssse3 -fomit-frame-pointer -fPIC -I/home/pi/workspace/fast/include -I/home/pi/workspace/fast/src -I/usr/local/include/opencv -I/usr/local/include -o CMakeFiles/fast.dir/src/fast_10.cpp.o -c /home/pi/workspace/fast/src/fast_10.cpp
cc1plus: error: unrecognized command line option ‘-mmmx’
cc1plus: error: unrecognized command line option ‘-msse’
cc1plus: error: unrecognized command line option ‘-msse’
cc1plus: error: unrecognized command line option ‘-msse2’
cc1plus: error: unrecognized command line option ‘-msse3’
cc1plus: error: unrecognized command line option ‘-mssse3’
CMakeFiles/fast.dir/build.make:60: recipe for target 'CMakeFiles/fast.dir/src/fast_10.cpp.o' failed
make[2]: *** [CMakeFiles/fast.dir/src/fast_10.cpp.o] Error 1
make[2]: Leaving directory '/home/pi/workspace/fast/build'
CMakeFiles/Makefile2:66: recipe for target 'CMakeFiles/fast.dir/all' failed
make[1]: *** [CMakeFiles/fast.dir/all] Error 2
make[1]: Leaving directory '/home/pi/workspace/fast/build'
Makefile:119: recipe for target 'all' failed
make: *** [all] Error 2
I have Cmake installed (sudo apt-get cmake), Gcc (4.6.3) and OpenCV.
How can I solve the problem?

Raspberry Pi is ARM, -msse* does it apply. Based on the CMakeFile, they detect ARM and disabled SSE flags. Maybe it is not working for you, perhaps due to a different cmake version
Try changing this
IF(DEFINED ENV{ARM_ARCHITECTURE})
to
IF(DEFINED $ENV{ARM_ARCHITECTURE})
This is line 34 in CMakeLists.txt
If the fix does not work, then you could manually enable ARM specified flags by editing CMakeLists.txt
Remove this:
IF(DEFINED ENV{ARM_ARCHITECTURE})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmmx -msse -msse -msse2 -msse3 -mssse3")
ENDIF()
and replace with this
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -march=armv7-a")
Maybe report an issue on github and tell the authors about it.
EDIT: you want to do these edits in https://github.com/uzh-rpg/fast/blob/master/CMakeLists.txt
Also try setting export ARM_ARCHITECTURE=1 before compiling

Related

How do I debug missing headers in CMake project?

What would be the general algorithm I should follow to debug issues such as this one?
23:28:12: Running steps for project jumper-qt...
23:28:12: Starting: "/usr/bin/cmake" --build . --target all
/usr/bin/cmake -S/home/skrat/Workspace/jumper-qt -B/home/skrat/Workspace/jumper-qt/build/Debug --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/skrat/Workspace/jumper-qt/build/Debug/CMakeFiles /home/skrat/Workspace/jumper-qt/build/Debug/CMakeFiles/progress.marks
/usr/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
/usr/bin/make -f src/CMakeFiles/jumper-qt_autogen.dir/build.make src/CMakeFiles/jumper-qt_autogen.dir/depend
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
cd /home/skrat/Workspace/jumper-qt/build/Debug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/skrat/Workspace/jumper-qt /home/skrat/Workspace/jumper-qt/src /home/skrat/Workspace/jumper-qt/build/Debug /home/skrat/Workspace/jumper-qt/build/Debug/src /home/skrat/Workspace/jumper-qt/build/Debug/src/CMakeFiles/jumper-qt_autogen.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
/usr/bin/make -f src/CMakeFiles/jumper-qt_autogen.dir/build.make src/CMakeFiles/jumper-qt_autogen.dir/build
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
[ 14%] Automatic MOC and UIC for target jumper-qt
cd /home/skrat/Workspace/jumper-qt/build/Debug/src && /usr/bin/cmake -E cmake_autogen /home/skrat/Workspace/jumper-qt/build/Debug/src/CMakeFiles/jumper-qt_autogen.dir/AutogenInfo.json Debug
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
[ 14%] Built target jumper-qt_autogen
/usr/bin/make -f src/CMakeFiles/jumper-qt.dir/build.make src/CMakeFiles/jumper-qt.dir/depend
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
cd /home/skrat/Workspace/jumper-qt/build/Debug && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/skrat/Workspace/jumper-qt /home/skrat/Workspace/jumper-qt/src /home/skrat/Workspace/jumper-qt/build/Debug /home/skrat/Workspace/jumper-qt/build/Debug/src /home/skrat/Workspace/jumper-qt/build/Debug/src/CMakeFiles/jumper-qt.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
/usr/bin/make -f src/CMakeFiles/jumper-qt.dir/build.make src/CMakeFiles/jumper-qt.dir/build
make[2]: Entering directory '/home/skrat/Workspace/jumper-qt/build/Debug'
[ 28%] Building CXX object src/CMakeFiles/jumper-qt.dir/magnum_item.cpp.o
cd /home/skrat/Workspace/jumper-qt/build/Debug/src && /usr/bin/g++ -DCORRADE_IS_DEBUG_BUILD -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_QMLMODELS_LIB -DQT_QML_DEBUG -DQT_QML_LIB -DQT_QUICK_LIB -I/home/skrat/Workspace/jumper-qt/build/Debug/src -I/home/skrat/Workspace/jumper-qt/src -I/home/skrat/Workspace/jumper-qt/build/Debug/src/jumper-qt_autogen/include -isystem /usr/include/MagnumExternal/OpenGL -isystem /usr/include/qt -isystem /usr/include/qt/QtCore -isystem /usr/lib/qt/mkspecs/linux-g++ -isystem /usr/include/qt/QtQuick -isystem /usr/include/qt/QtQmlModels -isystem /usr/include/qt/QtQml -isystem /usr/include/qt/QtNetwork -isystem /usr/include/qt/QtGui -DQT_QML_DEBUG -g -DQT_QML_DEBUG -Wall -Wextra -Wold-style-cast -Winit-self -Werror=return-type -Wmissing-declarations -Wpedantic -fvisibility=hidden -fvisibility-inlines-hidden -Wzero-as-null-pointer-constant -Wdouble-promotion -fPIC -std=gnu++14 -o CMakeFiles/jumper-qt.dir/magnum_item.cpp.o -c /home/skrat/Workspace/jumper-qt/src/magnum_item.cpp
In file included from /home/skrat/Workspace/jumper-qt/src/magnum_item.cpp:4:
/usr/include/Magnum/GL/Renderer.h: In static member function ‘static void Magnum::GL::Renderer::flush()’:
/usr/include/Magnum/GL/Renderer.h:1838:31: error: ‘glFlush’ was not declared in this scope; did you mean ‘flush’?
1838 | static void flush() { glFlush(); }
| ^~~~~~~
| flush
/usr/include/Magnum/GL/Renderer.h: In static member function ‘static void Magnum::GL::Renderer::finish()’:
/usr/include/Magnum/GL/Renderer.h:1846:32: error: ‘glFinish’ was not declared in this scope; did you mean ‘finish’?
1846 | static void finish() { glFinish(); }
| ^~~~~~~~
| finish
In file included from /home/skrat/Workspace/jumper-qt/src/magnum_item.cpp:4:
/usr/include/Magnum/GL/Renderer.h: In static member function ‘static Magnum::GL::Renderer::Error Magnum::GL::Renderer::error()’:
/usr/include/Magnum/GL/Renderer.h:2053:58: error: ‘glGetError’ was not declared in this scope
2053 | static Error error() { return static_cast<Error>(glGetError()); }
| ^~~~~~~~~~
make[2]: *** [src/CMakeFiles/jumper-qt.dir/build.make:122: src/CMakeFiles/jumper-qt.dir/magnum_item.cpp.o] Error 1
make[2]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
make[1]: Leaving directory '/home/skrat/Workspace/jumper-qt/build/Debug'
make[1]: *** [CMakeFiles/Makefile2:118: src/CMakeFiles/jumper-qt.dir/all] Error 2
make: *** [Makefile:107: all] Error 2
23:28:15: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project jumper-qt (kit: Desktop)
When executing step "CMake Build"
23:28:15: Elapsed time: 00:04.
The example project use both Qt (Quick 2) and Magnum, both of these libraries make extensive use of OpenGL. When I start example projects for them separately, they both work well and build with no error. When I try to marry them, it falls a part.
So what would be a procedure to follow in this case? How do I find out out why these (glFlush) declarations are missing? I tried adding find_package(OpenGL.... to my project, with no success. I'm interested in the process of finding out what's the problem, not in a solution to this particular problem.
Thank you SO
UPDATE: CMake files here https://gist.github.com/skrat/c5b20d6753e6476a4a0d60227cb73cda
Before including Magnum, I had the same project, where I included find_package(OpenGL... and was able to use raw OpenGL calls successfully. In a separate Magnum only project, I don't have to find package OpenGL and all is fine, I assume Magnum's CMake files do the hard work.
Also this might be relevant https://github.com/mosra/magnum-bootstrap/blob/base-qt/modules/FindMagnum.cmake

Installing a higiher version of GCC on Raspian Wheezy that doesn't rely on a newer glibc

We have software that we distributed to a bunch of Pis that have Raspian Wheezy. Recently, we've added in a bit of code that uses C++ standards that aren't integrated until >=gcc-4.8. If I compile on a newer version of Raspian, there are glibc mismatch errors when running on the Wheezy installed Pis.
Can I get >=gcc-4.8 on one of the Wheezy Pis without also having to install a higher version of glibc (which automatically makes any binary compiled refuse to work on the other Pis)?
Side note:
I've been trying to compile gcc-4.8 but I'm having the worst time because it keeps throwing a bits/predefs.h is missing error. Even though I configured it with --disable-multilib:
make[3]: Entering directory '/root/gcc-4.8/gcc-4.8-20150611/armv7l-unknown-linux-gnueabihf/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/root/gcc-4.8/gcc-4.8-20150611/host-armv7l-unknown-linux-gnueabihf/gcc/xgcc -B/root/gcc-4.8/gcc-4.8-20150611/host-armv7l-unknown-linux-gnueabihf/gcc/ -B/usr/local/armv7l-unknown-linux-gnueabihf/bin/ -B/usr/local/armv7l-unknown-linux-gnueabihf/lib/ -isystem /usr/local/armv7l-unknown-linux-gnueabihf/include -isystem /usr/local/armv7l-unknown-linux-gnueabihf/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -fno-inline -I. -I. -I../../host-armv7l-unknown-linux-gnueabihf/gcc -I../.././libgcc -I../.././libgcc/. -I../.././libgcc/../gcc -I../.././libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../.././libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
from ../.././libgcc/../gcc/tsystem.h:87,
from ../.././libgcc/libgcc2.c:27:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
Makefile:460: recipe for target '_muldi3.o' failed
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611/armv7l-unknown-linux-gnueabihf/libgcc'
Makefile:14787: recipe for target 'all-stage1-target-libgcc' failed
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611'
Makefile:18655: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611'
Makefile:884: recipe for target 'all' failed
make: *** [all] Error 2
This article (https://superuser.com/questions/762274/error-compiling-gcc-on-raspberry-pi) doesn't fix my issue unfortunately.

Problems linking Bonmin using Cmake under macOS High Sierra with "ld: framework not found -lAccelerate"

I am currently trying to link Bonmin using cmake in my project under macOS High Sierra (10.13.4) with Xcode version 9.3. Before I describe the setup I should mention that the Bonmin example (/PATH_TO_BONMIN/Bonmin/examples/CppExample) compiles with the included make files. Later example I try to get to work in my environment, but it is not working. Thus, I think there must be an incompatibility.
Bonmin 1.8 (https://www.coin-or.org/Tarballs/Bonmin/) was build on my Mac using
../configure -C --disable-shared F77="/usr/local/bin/gfortran" FFLAGS="-fexceptions -m64 -fbackslash" CFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64" CXXFLAGS="-fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64"
My FindBonmin.cmake uses the package configuration files from "${BONMIN_LIBRARY_DIR}/pkgconfig":
find_path(BONMIN_LIBRARY_DIR
NAMES libbonmin.a
HINTS ...
HINTS /usr/local/include/coin
HINTS ${BONMIN_ROOT_DIR}/include/coin
HINTS ${BONMIN_ROOT_DIR}/include
)
if(IS_DIRECTORY "${BONMIN_LIBRARY_DIR}/pkgconfig")
set(CMAKE_PREFIX_PATH "${BONMIN_LIBRARY_DIR}/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "${BONMIN_LIBRARY_DIR}/pkgconfig")
else()
message("Directory ${BONMIN_LIBRARY_DIR}/pkgconfig does not exist!")
endif()
From this I get the following:
${BONMIN_LIBRARY_DIR}/pkgconfig =
/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig
${PKG_BONMIN_INCLUDE_DIRS} =
/Users/<PATH>/Bonmin-1.8/build/include/coin;/Users/<PATH>/Bonmin-1.8/build/include/coin/ThirdParty;/Users/<PATH>/Bonmin-1.8/build/include/coin;/Users/<PATH>/Bonmin-1.8/build/include/coin/ThirdParty
${PKG_BONMIN_LDFLAGS} = -L/Users/<PATH>/Bonmin-1.8/build/lib;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3;-L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../..;-lbonmin;-lCbcSolver;-lCbc;-lCgl;-lOsiClp;-lClpSolver;-lClp;-lcoinasl;-lm;-ldl;-lOsi;-lCoinUtils;-lbz2;-lz;-framework;Accelerate;-lm;-lipopt;-framework;Accelerate;-lm;-ldl;-lcoinmumps;-framework;Accelerate;-lgfortranbegin;-lgfortran;-lSystem
This is used for the example:
include_directories(${PKG_BONMIN_INCLUDE_DIRS} )
add_executable(bonminExample runnables/bonminExample.cpp)
target_link_libraries(bonminExample ${PKG_BONMIN_LDFLAGS})
Additional information:
cmake_minimum_required(VERSION 3.6)
project(MyProject CXX)
# The version number.
set (MyProject_VERSION_MAJOR 1)
set (MyProject_VERSION_MINOR 0)
set(CMAKE_C_COMPILER "/usr/local/Cellar/llvm/5.0.1/bin/clang" CACHE FILEPATH "Path to the used C compiler; default clang." FORCE)
set(CMAKE_CXX_COMPILER "/usr/local/Cellar/llvm/5.0.1/bin/clang++" CACHE FILEPATH "Path to the used C++ compiler; default clang++." FORCE)
set(OPENMP_LIBRARIES "/usr/local/Cellar/llvm/5.0.1/lib" CACHE FILEPATH "Path to the OpenMP libraries." FORCE)
set(OPENMP_INCLUDES "/usr/local/Cellar/llvm/5.0.1/include" CACHE FILEPATH "Path to the OpenMP includes." FORCE)
## Set c++14
set(CMAKE_CXX_STANDARD 14)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
...
The error message I get, while trying to link Bonmin is:
ld: framework not found -lAccelerate
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/<PATH>/myproject/bin/bonminExample] Error 1
make[1]: *** [src/CMakeFiles/bonminExample.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
With the details:
[ 3%] Linking CXX executable /Users/<PATH>/myproject/bin/bonminExample
cd /Users/<PATH>/build_debug/src && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/bonminExample.dir/link.txt --verbose=1
cd /Users/<PATH>/build_debug && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/<PATH>/myproject /Users/<PATH>/build_debug/googletest-src/googlemock /Users/<PATH>/build_debug /Users/<PATH>/build_debug/googletest-build/googlemock /Users/<PATH>/build_debug/googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/DependInfo.cmake --color=
cd /Users/<PATH>/build_debug && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/<PATH>/myproject/ /Users/<PATH>/myproject/src /Users/<PATH>/build_debug /Users/<PATH>/build_debug/src /Users/<PATH>/build_debug/src/CMakeFiles/PGT.dir/DependInfo.cmake --color=
/usr/local/Cellar/llvm/5.0.1/bin/clang++ -fopenmp=libomp -Wno-unused-command-line-argument -DCOIN_USE_MUMPS_MPI_H -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD -march=native -g -Wall -ggdb -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/bonminExample.dir/runnables/BonminExample.cpp.o CMakeFiles/bonminExample.dir/bonminExample_autogen/mocs_compilation.cpp.o -o /Users/<PATH>/myproject/bin/bonminExample -L/usr/local/Cellar/llvm/5.0.1/lib -L/Users/<PATH>/external_libraries/ogdf20170723 -Wl,-rpath,/usr/local/Cellar/llvm/5.0.1/lib -Wl,-rpath,/Users/<PATH>/external_libraries/ogdf20170723 -L/Users/<PATH>/external_libraries/Bonming-1.8/build/lib -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../../x86_64 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3 -L/usr/local/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lbonmin -lCbcSolver -lCbc -lCgl -lOsiClp -lClpSolver -lClp -lcoinasl -lm -ldl -lOsi -lCoinUtils -lbz2 -lz -framework -lAccelerate -lm -lipopt -framework -lAccelerate -lm -ldl -lcoinmumps -framework -lAccelerate -lgfortranbegin -lgfortran -lSystem -lm -ldl -lOsi -lCoinUtils -lbz2 -lz -lipopt -lcoinmumps -lgfortranbegin -lgfortran -lSystem
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_autogen.dir/build
[ 4%] Automatic MOC for target gmock
cd /Users/<PATH>/build_debug/googletest-build/googlemock && /opt/local/bin/cmake -E cmake_autogen /Users/<PATH>/build_debug/googletest-build/googlemock/CMakeFiles/gmock_autogen.dir Debug
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/PGT.dir/build.make src/CMakeFiles/PGT.dir/build
ld: framework not found -lAccelerate
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/<PATH>/myproject/bin/bonminExample] Error 1
make[1]: *** [src/CMakeFiles/bonminExample.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f src/CMakeFiles/PGTIP.dir/build.make src/CMakeFiles/PGTIP.dir/build
Does anybody know what might be an issue or even has a solution to it?
Note that the make file from the Bonmin example gives me the following:
MBP:CppExample myname$ make VERBOSE=1
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --cflags bonmin` -c -o MyBonmin.o `test -f '../../../../Bonmin/examples/CppExample/MyBonmin.cpp' || echo '../../../../Bonmin/examples/CppExample/'`../../../../Bonmin/examples/CppExample/MyBonmin.cpp
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --cflags bonmin` -c -o MyTMINLP.o `test -f '../../../../Bonmin/examples/CppExample/MyTMINLP.cpp' || echo '../../../../Bonmin/examples/CppExample/'`../../../../Bonmin/examples/CppExample/MyTMINLP.cpp
bla=;\
for file in MyBonmin.o MyTMINLP.o; do bla="$bla `echo $file`"; done; \
clang++ -fno-common -no-cpp-precomp -fexceptions -arch x86_64 -m64 -DBONMIN_BUILD -o CppExample $bla `PKG_CONFIG_PATH=/Users/<PATH>/Bonmin-1.8/build/lib64/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/lib/pkgconfig:/Users/<PATH>/Bonmin-1.8/build/share/pkgconfig:/opt/X11/lib/pkgconfig pkg-config --libs bonmin`
Before XXX_LDFLAGS variable, obtained from PkgConfig module, is used in target_link_libraries call, modify that variable:
string(REPLACE "-framework;" "-framework " PKG_BONMIN_LDFLAGS "${PKG_BONMIN_LDFLAGS}")
(The quotation marks at "${PKG_BONMIN_LDFLAGS}" are important.)
After that, -framework option will be processed correctly:
target_link_libraries(... ${PKG_BONMIN_LDFLAGS})
Explanations
It seems that CMake incorrectly works with pkg-config when framework is used. When extract
-framework Acceletate
from the pkg-config output, these 2 words are interpreted as separate arguments. So, when passed to target_link_libraries:
target_link_libraries(... -framework Acceletate)
-l is appended to the second word according to the command's rules:
ld .... -framework -lAccelerate
Proper command's call should be
target_link_libraries(... "-framework Acceletate")
And this is exactly the purpose of above-mentioned string(REPLACE): It replaces CMake arguments delimiter ;, following -framework option, with normal space .

Cannot compile RGBdemo 0.7 Linux Mint 17 - undefined reference to symbol 'glOrtho'

This is my very first post here. I am trying to compile RGBdemo to test its reconstruction capabilities with kinect.
I have followed these instructions
RGBdemo compiling instructions
I was able to follow all the instructions more or less consistently but I stomp at the ending (compiling RGBdemo 0.7). Here is the make code.
[ 48%] Built target XnSensorServer
make -f nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build.make nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/depend
make[2]: Entering directory `/home/andre/.RGBDemo-0.7.0-Source/build'
cd /home/andre/.RGBDemo-0.7.0-Source/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/andre/.RGBDemo-0.7.0-Source /home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Samples/Players /home/andre/.RGBDemo-0.7.0-Source/build /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make -f nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build.make nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build
make[2]: Entering directory `/home/andre/.RGBDemo-0.7.0-Source/build'
Linking CXX executable ../../../../../../bin/Sample-Players
cd /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players && /usr/bin/cmake -E cmake_link_script CMakeFiles/Sample-Players.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -g -DNDEBUG CMakeFiles/Sample-Players.dir/signal_catch.cpp.o CMakeFiles/Sample-Players.dir/SceneDrawer.cpp.o CMakeFiles/Sample-Players.dir/main.cpp.o CMakeFiles/Sample-Players.dir/kbhit.cpp.o -o ../../../../../../bin/Sample-Players -L/home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Lib/Linux64 -rdynamic ../../../../../../lib/libOpenNI.so -lglut -lusb-1.0 -ldl ../../../../../../lib/libTinyXml.a -Wl,-rpath,/home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Lib/Linux64:/home/andre/.RGBDemo-0.7.0-Source/build/lib
/usr/bin/ld: CMakeFiles/Sample-Players.dir/main.cpp.o: undefined reference to symbol 'glOrtho'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [bin/Sample-Players] Error 1
make[2]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make[1]: *** [nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/all] Error 2
make[1]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make: *** [all] Error 2
I have not much experience in compiling programs although I have some programming skills.
I have searched extensively how to solve this issue searching for the errors
"reference to symbol 'glOrtho'" and "adding symbols: DSO missing from command line" but I can't find a decent solution that helped me.
For example this case
Linker error : undefined reference to symbol 'glOrtho'
states that I should link an OpenGL library to a certain file. In my case I think it should be main.cpp but I am unable to find it :-(.
Any help is much appreciated.
Update
Here is the current progress that I was able to achieve in the make
Scanning dependencies of target nestk
make[2]: Leaving directory `/home/andre/.rgbdemo/build'
make -f nestk/ntk/CMakeFiles/nestk.dir/build.make nestk/ntk/CMakeFiles/nestk.dir/build
make[2]: Entering directory `/home/andre/.rgbdemo/build'
/usr/bin/cmake -E cmake_progress_report /home/andre/.rgbdemo/build/CMakeFiles 56
[ 59%] Building CXX object nestk/ntk/CMakeFiles/nestk.dir/aruco/board.o
cd /home/andre/.rgbdemo/build/nestk/ntk && /usr/bin/c++ -DHAVE_OPENCV_GREATER_THAN_2_2 -DHAVE_OPENCV_GREATER_THAN_2_3_0 -DNESTK_USE_CUSTOM_OPENNI -DNESTK_USE_EIGEN -DNESTK_USE_FREENECT -DNESTK_USE_GLEW -DNESTK_USE_OPENNI -DNESTK_USE_QT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_XML_LIB -Dnestk_EXPORTS -fPIC -Wall -W -Wno-unused -Wno-sign-compare -O2 -g -DNDEBUG -fPIC -I/home/andre/.rgbdemo/build/nestk/deps -I/home/andre/.rgbdemo/nestk/deps -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtXml -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4/QtCore -I/home/andre/.rgbdemo/nestk/deps/include -I/home/andre/.rgbdemo/nestk/deps/eigen -I/home/andre/.rgbdemo/nestk/deps/libfreenect/include -I/home/andre/.rgbdemo/nestk/deps/openni/Include -I/home/andre/.rgbdemo/nestk/deps/openni/Nite/Include -I/home/andre/.rgbdemo/nestk/deps/glew/include -I/home/andre/.rgbdemo/nestk -I/home/andre/.rgbdemo/build/nestk -o CMakeFiles/nestk.dir/aruco/board.o -c /home/andre/.rgbdemo/nestk/ntk/aruco/board.cpp
In file included from /home/andre/.rgbdemo/nestk/ntk/geometry/pose_3d.h:23:0,
from /home/andre/.rgbdemo/nestk/ntk/aruco/marker.h:17,
from /home/andre/.rgbdemo/nestk/ntk/aruco/board.h:19,
from /home/andre/.rgbdemo/nestk/ntk/aruco/board.cpp:1:
/home/andre/.rgbdemo/nestk/ntk/core.h:31:38: fatal error: opencv2/legacy/compat.hpp: No such file or directory
# include "opencv2/legacy/compat.hpp"
^
compilation terminated.
make[2]: *** [nestk/ntk/CMakeFiles/nestk.dir/aruco/board.o] Error 1
make[2]: Leaving directory `/home/andre/.rgbdemo/build'
make[1]: *** [nestk/ntk/CMakeFiles/nestk.dir/all] Error 2
make[1]: Leaving directory `/home/andre/.rgbdemo/build'
make: *** [all] Error 2
I will try to find how to correct those directories but I would really apreciate some help on this. Please, I am doing this a bit by trial and error and I know this is not the right way to go. I am not an expert on cmake compilation.
I had to remove and reinstall OpenCV 2.3.1 with these instructions
http://www.ozbotz.org/opencv-installation-2-3-1/
And after some magic...voilá. It works. I hope that this tips can somehow help anyone.

Cross-compiling kernel module for ARM

I want to cross-compile rtl8192cu driver targeting ARM Angstrom (BeagleBoard), on x86 Ubuntu 13.04.
Cross-compile prerequisites:
rtl8192cu driver
Cross-toolchain (CodeSourcery / arm-angstrom-linux-gnueabi)
kernel sources
For this reason, I copied kernel sources usr/src directory of BeagleBoard, on Ubuntu machine (they heve been compiled on BeagleBoard, as I needed to rebuild the kernel).
Running make for cross-compile, I get this error:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks1 M=/home/demetres/Desktop/rtl3 modules
make[1]: Entering directory `/home/demetres/Desktop/ks1'
CC [M] /home/demetres/Desktop/rtl3/core/rtw_cmd.o
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl3/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl3] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks1'
make: *** [modules] Error 2
If I run file fixdep I get:
fixdep: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped
This makes sense, as fixdep, is part of kernel sources (compiled on ARM platform).
My query is: Is that procedure correct and how can I fix this error?
EDIT:
Running make V=1:
make ARCH=arm CROSS_COMPILE=/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi- -C /home/demetres/Desktop/ks M=/home/demetres/Desktop/rtl modules
make[1]: Entering directory `/home/demetres/Desktop/ks'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/linux/autoconf.h or include/config/auto.conf are missing."; \
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
mkdir -p /home/demetres/Desktop/rtl/.tmp_versions ; rm -f /home/demetres/Desktop/rtl/.tmp_versions/*
make -f scripts/Makefile.build obj=/home/demetres/Desktop/rtl
/home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc -Wp,-MD,/home/demetres/Desktop/rtl/core/.rtw_cmd.o.d -nostdinc -isystem /home/demetres/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/../lib/gcc/arm-none-linux-gnueabi/4.7.3/include -Iinclude -I/home/demetres/Desktop/ks/arch/arm/include -include include/linux/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-versatile/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm9tdmi -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -O1 -Wno-unused-variable -Wno-unused-value -Wno-unused-label -Wno-unused-parameter -Wno-unused-function -Wno-unused -Wno-uninitialized -I/home/demetres/Desktop/rtl/include -DCONFIG_POWER_SAVING -DCONFIG_LITTLE_ENDIAN -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(rtw_cmd)" -D"KBUILD_MODNAME=KBUILD_STR(8192cu)" -c -o /home/demetres/Desktop/rtl/core/rtw_cmd.o /home/demetres/Desktop/rtl/core/rtw_cmd.c
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [/home/demetres/Desktop/rtl/core/rtw_cmd.o] Error 126
make[1]: *** [_module_/home/demetres/Desktop/rtl] Error 2
make[1]: Leaving directory `/home/demetres/Desktop/ks'
make: *** [modules] Error 2
fixdep is an ARM binary and you are trying to run it on x86 machine(intel). You probably have to recompile kernel resources (just make them) and try cross compiling again.