I\'m working with Point Cloud Library. It\'s mostly in C++ When I compile it, gives such error:
[ 0%] Building CXX object common/CMakeFiles/pcl_common.dir/s
You can add -march=native -mno-avx
This worked for me.
In my CMakeLists.txt, I added the above to the CMAKE_CXX_FLAGS
:
SET(CMAKE_CXX_FLAGS "-ggdb -O3 -fPIC -std=c++0x -march=native -mno-avx")
[Source can be found in this page.]
I faced this issue when trying to install glove.
The problem I faced was resolved by upgrading the g++ version installed in my ubuntu 14.04 machine.
My original g++ version was 4.6.4 and I upgraded it to the g++-5 (5.4.1 when I upgraded it).
I have met the same error messages,
I removed the -march=native
from CXXFLAGS
and CFLAGS
in my makefile,
it works in my case. But since you didn't put out your makefile, I am not sure this will works in your case, any way you can have a try.
There are error message from assembler, which means assembler doesn't know these assembly code, for example vfmadd312ss
.
This happens when compiler generate some CPU only assembly code, for example intel E5 with arch core-avx2
have extra instruction set advanced vector extensions
, but if "as" is tool old to know the new CPUs, this error would happen.
Try a new version Binutils, the latest is 2.29
now.
If you compile code from another tool, for example bazel
, make sure it will call the new "as".
Have you tried using a different compiler?
I had assembler errors in a project using Point Cloud Library. It was possibly due to using Ubuntu 12.04 on an core i7 processor (see https://github.com/uzh-rpg/rpg_svo/issues/7).
I was able to compile by installing the 'clang' compiler
sudo apt-get install clang
and then running cmake with:
cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ .
You can use the command below to see what is your CPU (for the compiler):
gcc -march=native -Q --help=target | grep march
Then you can add your cpu type in the ccmake CMAKE_CXX_FLAGS
option, for me:
CMAKE_CXX_FLAGS = -march=corei7-avx