Vikit_common - Installation failed - Raspberry Pi 2 B - c++

I'm working an a project of drone and I'm having an issue with my Raspberry Pi 2 B. When I'm trying to install vikit_common, I've this on screen :
pi#raspberrypi ~/workspace/rpg_vikit/vikit_common/build $ cmake ..
-- Eigen found (include: /usr/include/eigen3)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/workspace/rpg_vikit/vikit_common/build
pi#raspberrypi ~/workspace/rpg_vikit/vikit_common/build $ make
[ 7%] Building CXX object CMakeFiles/vikit_common.dir/src/atan_camera.cpp.o
cc1plus: error: bad value (native) for -march switch
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’
cc1plus: error: bad value (native) for -march switch
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/vikit_common.dir/build.make:57: recipe for target 'CMakeFiles/vikit_common.dir/src/atan_camera.cpp.o' failed
make[2]: *** [CMakeFiles/vikit_common.dir/src/atan_camera.cpp.o] Error 1
CMakeFiles/Makefile2:168: recipe for target 'CMakeFiles/vikit_common.dir/all' failed
make[1]: *** [CMakeFiles/vikit_common.dir/all] Error 2
Makefile:116: 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 ?

Apparently you have an incorrect cmake configuration
A quick gcc 4.6.3 man says
-march=
This specifies the name of the target ARM architecture. GCC uses this name to determine what kind of instructions it can use when
generating assembly code. This option can be used in conjunction with
or instead of the `-mcpu=' option. Permissable names are: ‘armv2’, ‘armv2a’, ‘armv3’, ‘armv3m’, ‘armv4’,‘armv4t’, ‘armv5’, ‘armv5t’, ‘armv5e’, ‘armv5te’, ‘armv6’, ‘armv6j’, ‘armv6t2’,‘armv6z’, ‘armv6zk’, ‘armv6-m’, ‘armv7’, ‘armv7-a’, ‘armv7-r’, ‘armv7-m’,‘iwmmxt’, ‘iwmmxt2’, ‘ep9312’
Firstly looks like you have a wrong value for -march.
So check your cmake configuration

Related

Running C++ units failed when building turicreate from source

I am experiencing problem while building turicreate from source on Ubuntu 20.04. while running make to build C++ unit tests, it failed with the following error.
[ 79%] Building CXX object test/util/CMakeFiles/SpanTests.cxxtest.dir/SpanTests.cxx.o
In file included from /usr/include/c++/9/vector:67,
from /home/oem/Desktop/turicreate/src/core/util/Span.hpp:12,
from /home/oem/Desktop/turicreate/test/util/SpanTests.cxx:9:
/usr/include/c++/9/bits/stl_vector.h: In instantiation of ‘class std::vector<const int, std::allocator<const int> >’:
/home/oem/Desktop/turicreate/test/util/SpanTests.cxx:66:41: required from here
/usr/include/c++/9/bits/stl_vector.h:398:66: error: static assertion failed: std::vector must have a non-const, non-volatile value_type
398 | static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
| ^~~~~
cc1plus: error: unrecognized command line option ‘-Wno-unknown-warning-option’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-parentheses-equality’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-constant-logical-operand’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-mismatched-tags’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: error: unrecognized command line option ‘-Wno-unused-command-line-argument’ [-Werror]
cc1plus: all warnings being treated as errors
make[2]: *** [test/util/CMakeFiles/SpanTests.cxxtest.dir/build.make:63: test/util/CMakeFiles/SpanTests.cxxtest.dir/SpanTests.cxx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:8206: test/util/CMakeFiles/SpanTests.cxxtest.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Makefile.unix error unrecognized command line option “-std=c++03”

When I run make -f makefile.unix it gives me an error like this:
cc1plus: error: unrecognized command line option "-std=c++03"
Then I tried the following command: make -f makefile.unix CXXFLAGS="-std=c++0x" and still the same error is showing up.
I'm using g++ 4.3.3 because the software requires to do so.
Anyone any idea how to approach this?

Qt Creator compile error when executing step "make", -fno-stack-limit

Having some problems compiling a project, project was provided by the school and even if I don't change anything I get these errors while compiling in Qt Creator:
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
clang: error: unknown argument: '-fno-stack-limit'
make: clang: error: unknown argument: '-fno-stack-limit'
*** [adapter.o] Error 1
make: *** Waiting for unfinished jobs....
clang: error: unknown argument: '-fno-stack-limit'
make: *** [trailblazer.o] Error 1
make: *** [types.o] Error 1
make: *** [trailblazergui.o] Error 1
make: *** [BasicGraph.o] Error 1
clang: error: unknown argument: '-fno-stack-limit'
make: *** [console.o] Error 1
clang: error: unknown argument: '-fno-stack-limit'
make: *** [costs.o] Error 1
make: *** [direction.o] Error 1
22:27:18: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project Trailblazer (kit: Desktop Qt 5.13.0 clang 64bit)
When executing step "Make"
Any ideas on what could be wrong?
Running on Mac OS
The clang compiler doesn't support '-fno-stack-limit'. But you can get the same effect by passing the --stack flag to GNU linker:
--stack reserve
--stack reserve,commit
Specify the number of bytes of memory to reserve (and optionally commit) to be used as stack for this program. The default is 2MB
reserved, 4K committed. [This option is specific to the i386 PE targeted port of the linker]
For Mac OS default linker you can pass -stack_size:
-stack_size size
Specifies the maximum stack size for the main thread in a program. Without this
option a program has a 8MB stack. The argument size is a hexadecimal number with
an optional leading 0x. The size should be an even multiple of 4KB, that is the
last three hexadecimal digits should be zero.
to pass a flag to linker you can use -Wl. e.g.,
clang++ -Wl,-stack_size -Wl,0x1000000 -o test test.cpp
Where 0x1000000 = size of stack 16MB.

About the compilation problem of Kaleidoscope in llvm tutorial

I am learning llvm.
I am trying to compile the code in Kaleidoscope Tutorial 3.6.
https://llvm.org/docs/tutorial/LangImpl03.html
clang++ -g -O3 toy.cpp `llvm-config --cxxflags --ldflags --system-libs --libs core` -o toy
I got some errors, but I don't know what to do.
clang++.exe: error: unsupported option '--cxxflags'
clang++.exe: error: unsupported option '--ldflags'
clang++.exe: error: unsupported option '--system-libs'
clang++.exe: error: unsupported option '--libs'
clang++.exe: error: no such file or directory: 'llvm-config'
clang++.exe: error: no such file or directory: 'core -o'
clang++.exe: error: no such file or directory: 'toy'
By the way, I compiled it under Windows.
The main reason you get this error is that your shell does not interpret your command correctly.
See:
clang++.exe: error: no such file or directory: 'llvm-config'
Thus flags that should be passed to llvm-config are passed to clang.exe.
See:
clang++.exe: error: unsupported option '--cxxflags'
clang++.exe: error: unsupported option '--ldflags'
clang++.exe: error: unsupported option '--system-libs'
clang++.exe: error: unsupported option '--libs'
To solve this issue make sure to get llvm-config on you machine and make sure that you use a command line that supports the correct shell semantics. Example of such shells would be git bash or mingw.

c++: error: unrecognized command line option ‘-std=gnu++14’

I try to build the fblualib. However, when running build.sh I get the following error:
-- Found Folly: /usr/local/include
-- Found Torch7 in /home/dmus/torch/install
-- Found Folly: /usr/local/include
-- Configuring done
-- Generating done
-- Build files have been written to: /home/dmus/fblualib/fblualib/build
[ 25%] Building CXX object CMakeFiles/fblualib.dir/LuaUtils.cpp.o
c++: error: unrecognized command line option ‘-std=gnu++14’
make[2]: *** [CMakeFiles/fblualib.dir/LuaUtils.cpp.o] Error 1
make[1]: *** [CMakeFiles/fblualib.dir/all] Error 2
make: *** [all] Error 2
g++ --version outputs g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4. I see related questions, however I do not see how to fix this.
You need to upgrade your g++ (At least to version 4.9.*).
Once upgrade is done, try compiling using g++ -std=c++14 file.cpp or g++ -std=c++1y file.cpp.